java - Android: changing colors gradually for multiple imageview backgrounds using seekbar -
I am using background color to make a rectangular color and I want to gradually convert How can I do this without writing a million links code to remove RG or B from a hex color? This is an example of what I want to do, though experimenting with a box.
seekBar.setOnSeekBarChangeListener (New SeekBar.OnSeekBarChangeListener () {@Override Public Zero onProgressChanged (seekbar seekbar, j i, boolean b) {if (i> = 25 & amp; amp; ; I & lt; 50) {imageView.setBackgroundColor (Color.BLUE);} else if (i> = 50 & amp; I & lt; 75) {imageView.setBackgroundColor (Color.GREEN); } Else if (i> = 75 & amp; amp; i & lt; = 100) {imageView.setBackgroundColor (Color.YELLOW);} and {imageView.setBackgroundColor (Color.WHITE);}} < / code> Answer found:
seekBar.setOnSeekBarChangeListener (New SeekBar.OnSeekBarChangeListener () {@Override Public Zero onProgressChanged (seekbar seekbar, j i, boolean b) { Iv1.setBackgroundColor (Color.argb (0xFF, I, I, 200));} The color that you want Depending on what you think, on 255, set the maximum when you search and you can play with the numbers to get your desired color on gradual change. When context is trying to find color < p>
seekBar.setOnSeekBarChangeListener (New SeekBar.OnSeekBarChangeListener () {@Override Public Zero onProgressChanged (seekbar seekbar, ji i, boolean b ) {Iv1.setBackgroundColor (Color.argb (0xFF, I, i, 200)); } Depending on the color you want, set the searcher to a maximum of 255 and you can play with the numbers to get your desired color on gradual change. Great reference while trying to find colors
Comments
Post a Comment