untitled

(John Hannent) #1

permanently occupied by useless information, like “The name of the drum-
mer from Cheap Trick is Bun E. Carlos.” See what I mean?


I have no idea why people still bother with hex these days (early in comput-
ing, several decades ago, hex and binary arithmetic were marginally useful).
Manipulating hex numbers themselves is hard enough, but when you try to
do arithmetic with them... well, it’s easier to uncook spaghetti.


When you want to select a color for a Web page element, just pick a color
from a visualrepresentation (like a color gradient in Photoshop or a tabular
palette like the one in Visual Studio shown in Figure 6-4, or an online color
chart). Or, if you must, pick one from the list of color names that follows.


Don’t try to deal with hexadecimal numbers. Who could possibly memorize
which color goes with which “number?” Few people even understand the
numbering system itself. And, truly, you don’t need to understand it at all.


Here’s Microsoft’s list of colors that IE can recognize by name. No need to
bother translating these names into hex values at all:


AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black,
BlanchedAlmond, Blue, BlueViolet, Brown, BurlyWood, CadetBlue, Chartreuse,
Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue,
DarkCyan, DarkGoldenrod, DarkGray, DarkGreen, DarkKhaki, DarkMagenta,
DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, DarkSalmon,
DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkTurquoise, DarkViolet,
DeepPink, DeepSkyBlue, DimGray, DodgerBlue, FireBrick, FloralWhite,
ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, Goldenrod, Gray, Green,
GreenYellow, Honeydew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender,
LavenderBlush, LawnGreen, LemonChiffon, LightBlue, LightCoral, LightCyan,
LightGoldenrodYellow, LightGreen, LightGrey, LightPink, LightSalmon,
LightSeaGreen, LightSkyBlue, LightSlateGray, LightSteelBlue, LightYellow,
Lime, LimeGreen, Linen, Magenta, Maroon, MediumAquamarine, MediumBlue,
MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue,
MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue,
MintCream, MistyRose, Moccasin, NavajoWhite, Navy, OldLace, Olive,
OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenrod, PaleGreen,
PaleTurquoise, PaleVioletRed, PapayaWhip, PeachPuff, Peru, Pink, Plum,
PowderBlue, Purple, Red, RosyBrown, RoyalBlue, SaddleBrown, Salmon,
SandyBrown, SeaGreen, Seashell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray,
Snow, SpringGreen, SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet,
Wheat, White, WhiteSmoke, Yellow, YellowGreen.


Just go ahead and stick one of these (often gracefully descriptive) names
like PapayaWhip into your color property specification, like this:


p.warning {color: lightslategray;}

Chapter 6: Managing Details in Style Sheets 117

Free download pdf