Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 779
Vinod Avatar asked Aug 02 '11 09:08

Vinod


People also ask

What do the numbers in hex colors mean?

Hex color codes start with a pound sign or hashtag (#) and are followed by six letters and/or numbers. The first two letters/numbers refer to red, the next two refer to green, and the last two refer to blue. The color values are defined in values between 00 and FF (instead of from 0 to 255 in RGB).

How many digits are in a hex color?

Hexadecimal Code Defined A hexadecimal color value is a six-digit code preceded by a # sign; it defines a color that is used in a website or a computer program.

Why do hex colors look different?

Numerical values mean nothing until they refer to a specific color space (sRGB, Adobe RGB etc). The color space is what defines the numbers as a certain color. A given set of RGB numbers will produce different colors in different color spaces. Hex is just a different (and outdated) notation for RGB numbers.

What is color number 8?

The famous Horween Color #8 is most often associated with cordovan. Some leather goods makers even call this color cordovan in their product descriptions and titles. It is a deep brown with a reddish undertone that is almost burgundy or dark cherry. The number eight also indicates how this color is made.


1 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

like image 104
Veger Avatar answered Oct 11 '22 14:10

Veger