QuadFlask / colorpicker

🍭color picker for android
1.22k stars 219 forks source link

What is the ColorCode Type? #94

Closed ghost closed 6 years ago

ghost commented 6 years ago

What color code type of representation is this? How can I find the color I picked later elsewhere using the Integer value I picked?

ghost commented 6 years ago

@QuadFlask please respond to this issue.

QuadFlask commented 6 years ago

If I understood it well, the value is just integer(Red is 0xffff0000 == argb(255,255,0,0)). You can set listener to picker view and listen value.

ghost commented 6 years ago

-196608 How do I find this color?

On 18-Feb-2018 11:28 AM, "QuadFlask" notifications@github.com wrote:

If I understood it well, the value is just integer(Red is 0xffff0000 == argb(255,255,0,0)). You can set listener to picker view and listen value.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/QuadFlask/colorpicker/issues/94#issuecomment-366494681, or mute the thread https://github.com/notifications/unsubscribe-auth/AdgMyOolt_7gKM85cWBqj4tT4WWTj-GUks5tV7wHgaJpZM4SAgcX .

QuadFlask commented 6 years ago

That value is decimal number but you can conversion to hex like this.

"0x"+Integer.toHexString(selectedColor)

or, you can use bitwise operator.

blue = selectedColor & 0xff
green = selectedColor & 0xff00 >> 8
red = selectedColor & 0xff0000 >> 16
alpha = selctedColor & 0xff000000 >> 24

that integer value would be use anywhere in android.

ghost commented 6 years ago

Thanks a lot.

On 18-Feb-2018 11:37 AM, "QuadFlask" notifications@github.com wrote:

That value is decimal number but you can conversion to hex like this.

"0x"+Integer.toHexString(selectedColor)

or, you can use bitwise operator.

blue = selectedColor & 0xff green = selectedColor & 0xff00 >> 8 red = selectedColor & 0xff0000 >> 16 alpha = selctedColor & 0xff000000 >> 24

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/QuadFlask/colorpicker/issues/94#issuecomment-366494961, or mute the thread https://github.com/notifications/unsubscribe-auth/AdgMyAGwGEimKsP8XimzNGBlsDrFkU1Zks5tV74cgaJpZM4SAgcX .