HTML and CSS Reference
In-Depth Information
RGB color will have three values, one each for red, green, and blue. These are always
listed in that order (red, green, blue) and specify the numerical value of each color used.
For example, the RGB values for red are (255,0,0)—all red, no green and no blue. The
RGB values for blue are (0,0,255)—no red, no green, and all blue. These colors can
also be specified using hexadecimal values.
Hexadecimal is the name for the Base 16 numbering system, which uses the characters
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F to specify numeric values. When a hexa-
decimal value is used to specify RGB color, the numeric value pairs range from 00 to FF
(0 to 255 in Base 10). The hexadecimal value contains three numeric value pairs written
sequentially as one number. Each pair is associated with the amount of red, green, and
blue displayed. Using this notation, the color red would be specified as #FF0000 and
the color blue as #0000FF . The # symbol signifies that the value is in hexadecimal. You
can use either uppercase or lowercase letters in hexadecimal color values —#FF0000 and
#ff0000 both configure the color red.
Don't worry—you won't need to do calculations to work with Web colors. Just become
familiar with the numbering scheme. See Figure 3.2 (shown also in the color insert sec-
tion) for an excerpt from the color chart at
Figure 3.2
Partial color chart
Go to the end of the
book for a full color
version of this figure
Take a few moments to examine the color chart. You will observe a display of colors
and their associated hexadecimal RGB values in hexadecimal. You may notice that
there is a pattern to the hexadecimal numbers (pairs of 00, 33, 66, 99, CC, or FF). This
pattern signifies a color on the Web Safe Color Palette (more on this later). As you
examine the color chart further, you will see a list of colors using color names. Some
Web developers find it easier to use the color names. However, the names are not uni-
formly supported by all versions of all browsers, so the W3C recommends using
numeric color values instead of color names.
Web Color Palette
A Web developer usually has no way of knowing what type of computer or browser the
Web site visitors will be using. The various operating systems and browsers display col-
ors differently, and sometimes not at all. The Web Safe Color Palette, also known as the
Web Color Palette, is a collection of 216 colors that display the same on both the
Windows and Mac OS platforms. It is easy to tell if a color is on the Web Color Palette
when you consider the individual hexadecimal RGB value pairs. The values of 00, 33,
66, 99, CC, and FF are the only values for hexadecimal RGB value pairs on the Web
Color Palette. Take another look at the color chart at
color and note that all the colors listed by RGB follow this numbering scheme—they
comprise the Web Color Palette. See Figure 3.3 (shown also in the color insert section)
Search WWH ::

Custom Search