HTML and CSS Reference
In-Depth Information
Table 14.5 Common Color Names and Hexadecimal Values
Color Depth. Sometimes colors don't look as crisp and bright as you would expect;
pink might look like red, or some of the colors in a field of flowers might be pale. In
Chapter 10, “It's the BOM! Browser Objects,” we discussed the screen object. It has a
property called colorDepth that will tell you how many distinct colors (bits per pixel) a
computer can handle. For example, a color-bit depth of 4 will display 16 colors and a
color-bit depth of 24, represented as 2 to the 24th power, will provide 16.7 million col-
ors. How many colors can your computer display?
There are a number of color charts available on the Web that provide Web-safe color
palettes. 3 See www.lynda.com, www.paletteman.com, or www.visibone.com
Hexadecimal Codes. These are the codes that define colors. They are groups of
three hexadecimal (base 16) numbers. The first number is red, the second green, and
the third blue. Each hexadecimal number is an RGB triplet. 00 is the lowest hue, and FF
is the highest. For example, red is ff0000, blue is 0000ff, green is 00ff00, and purple is
990099. For a complete list of CSS colors, their names, hex values, shades, and color
mixer, go to http://www.w3schools.com/css/css_colornames.asp. These colors are sup-
ported by all major browsers.
3. “Browser-Safe Palette only contains 216 colors out of a possible 256. That is because the remaining 40 col-
ors vary on Macs and PCs. By eliminating the 40 variable colors, this palette is optimized for cross-plat-
form use.” —Lynda Weinman ( http://www.lynda.com/resources/webpalette.aspx ).
 
Search WWH ::




Custom Search