

A common shorthand version reduces each color to 1 hexadecimal digit instead: Together, the three values allow for 16,777,216 unique colors. The colors are ordered RGB - red, green, blue. So, in the example above, red, green, and blue are all 100% present, and combine to make pure white. A typical color expressed in hexadecimal looks like this:Įach color gets two digits, allowing for a range of 256 values between 00 (color not present) and FF (color 100% present). In terms of color, it is common to represent a given color value as consisting of three parts : red, green, and blue, which are mixed together in the specified proportion to produce the final color.

Hexadecimal and octal (base 8) are commonly used in computer programs because it is easy to convert them into binary numbers (base 2). In base sixteen, there are sixteen digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, A, B, C, D, E, and F. In base ten, there are only ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Hexadecimal values specify the three colors of the transmitted spectrum using base 16. The box after each keyword above shows the color as it appears on your computer. The exact color values of these keywords will vary depending on the operating system and browser that the user is running. CSS allows for three different ways to specify color values: by keyword, using hexadecimal values, and by specifying the RGB components.ĬSS 2 introduced a number of color keywords tied to the system default settings so that web developers can make their forms and such match the appearance of the user’s operating system.
