HTML and CSS Reference
In-Depth Information
The character pairs are obtained by converting 0 through 255 into a base-16, or hexa-
decimal, format. The math is a little tricky—and worthy of its own book—but it helps to
know that 0 equals black and F equals white.
The Millions of Hexadecimal Colors
There are millions of hexadecimal colors, over 16.7 million to be exact. Here's
There are 16 options for every character in a hexadecimal color, 0 through 9 and
A through F. With the characters grouped in pairs, there are 256 color options per
pair (16 multiplied by 16, or 16 squared).
And with three groups of 256 color options we have a total of over 16.7 million
colors (256 multiplied by 256 multiplied by 256, or 256 cubed).
To create the same maroon and yellow background colors from before, we could replace
the keyword color values with hexadecimal color values, as seen here.
1. .task {
2. background: #800 ;
3. }
4. .count {
5. background: #ffff00 ;
6. }
Hexadecimal color values have been around for a while, and they have become fairly pop-
ular because they offer a large number of color options. They are, however, a little difficult
to work with, especially if you're not too familiar with them. Fortunately Adobe has cre-
ated Adobe Kuler ( ), a free application that provides a color wheel
to help us find any color we want and its corresponding hexadecimal value. Additionally,
most image editing applications, such as Adobe Photoshop, provide the capability to locate
hexadecimal color values (see Figure 3.3 ) .
Search WWH ::

Custom Search