Hex Colors in Android are some times 8 digits. How? What is the difference between #FFFFFF and #FFFFFF00
I sometimes have seen in examples where the coloring in Android is done as #FF191919. I mean a 8 digit hex number . But it should be only a 6 digit number. How are they related? If I want o convert a 6 digit number to a 8 digit number. How to do it? I mean convert #424242 to a 8 digit number coloring? Please let me know the details. Thank you for your time and help.
The extra 2 digits are used to define the colors transparency, or alpha channel.
Android uses the ARGB format (or AARRGGBB as you use in your example)
For more (Android-specific) information take a look at the Color documentation
The first two characters are representing the alpha (transparency) value, where FF
is fully visible. This is known as aRGB.
8-digit hex is an ARGB color. It is the same as usual RGB, but provides an extra alpha channel.
#RRGGBB
in RGB is the same as #00RRGGBB
in ARGB. Also take a look at Color.argb.
上一篇: CSS删除与文本不同的颜色?
下一篇: Android中的十六进制颜色有时是8位数字。 怎么样? What is the difference between #