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.

Answers


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.


the 8 digit color define with alpa level

let extract all we define hex color as 6 value pair of rgb 2 digit per

1st 2 digit for red, 2nd 2 digit for green and 3rd 2 digit for blue now if you want to set the alpha level of that then it define with the 8 digit as ARGB so, now 1st 2 digit value was define for the alpha and rest are for the RGB


AN 8 digit Android HEx is called an aRGB. aRGB values are typically expressed using 8 hexadecimal digits, with each pair of the hexadecimal digits representing the values of the Alpha, Red, Green and Blue channel, respectively. For example 80FFFF00 represents 50.2% opaque (non-premultiplied) yellow. The 80 hex value, which is 128 in decimal, represents a 50.2% alpha value because 128 is approximately 50.2% of the maximum value of 255 (FF hex); to continue to decipher the 80FFFF00 value, the first FF represents the maximum value red can have; the second FF is like the previous but for green; the final 00 represents the minimum value blue can have (effectively – no blue). Consequently red + green yields yellow. In cases where the alpha is not used this can be shortened to 6 digits RRGGBB, this is why it was chosen to put the alpha in the top bits. Depending on the context a 0x or a number sign (#)[1] is put before the hex digits.


Need Your Help

from unix timestamp to datetime

javascript date datetime momentjs

I have something like /Date(1370001284000+0200)/ as timestamp. I guess it is a unix date, isn't it? How can I convert this to a date like this: 31.05.2013 13:54:44

In Ruby, what is stored on the stack?

ruby variables memory stack heap

Does Ruby allocate everything on the heap or are there any instances where something is stored on the stack? I'm under the impression that all variables are essentially on the stack and contain a