yukuku / ambilwarna

Android Color Picker aka AmbilWarna library ("Pick a Color" in Indonesian)
Other
226 stars 88 forks source link

bugs when passing RGBA color as integer #10

Closed rafalsk closed 7 years ago

rafalsk commented 9 years ago

On a couple of phone we are testing the color picker goes crazy when you pass an initial color as a proper 32 bit integer containing alpha channel information. The supportalpha boolean variable is set to true.

When you pass such a initial color variable; the color pallete is Empty; changing the Alpha channel slider does not help. the current color gets updated though and displayed in the right current color box.

denisk20 commented 9 years ago

Thanks for reporting this, I'll take a look once I get to proper internet.

rafalsk commented 9 years ago

you are welcome; the app in which we are using it is Locayt which is available on public bete since a couple of days. You can see that of on some of the mobile devices color picker does not work properly (settings tab). When you choose to pick up a color it does not render the color pallet properly ; just a blank field/rectangle. We pass a 32-bit integer to the constructor which contains encoded Alha channel. THe value is correct since Android gui renders the value properly.

denisk20 commented 9 years ago

I can't reproduce it, can you post the actual color value you're trying to set? Actually in demo activity we create the dialog with integer value and it works fine. Are you using proper bits for color encoding? It should be

0xAARRGGBB

(all in hex). So, for example, if you have hex values of alpha = ff (which is 255 in decimal), red = 10, green = 20 and blue = 30 you would write your color as

int color = 0xff102030