There are many cases when HTML and CSS specify colors for presentation
of a portion of the document tree. In the computer and publishing
industries, many different syntaxes and methods have evolved to represent
a color, whether it be by a conglomeration of color component values
or by a friendly common name. Each of the methods available in HTML and
CSS have a specific number of allowed values. When an attempt is
made to render a color, it is displayed as specified, unless the
presentation medium can not support it (for any number of reasons,
such as limitations in the OS or video card capability.)
This method represents a color using a triplet of hexadecimal
values concatenated together. These values represent the Red,
Green and Blue components for a given color. The range of each
component value is 00-FF in Hexadecimal (0-255 Decimal.) The
total value should be prefixed by a pound "#" symbol.
(where RR, GG and BB are the respective hexadecimal values for
Red, Green and Blue).
Possible color values: 216
The syntax of this method is exactly the same as for the general
RGB color component method, but represents a very useful subset of
values within the 16 million allowed colors. This subset represents
the palette of color values that will not
dither on a system using only
256 colors. This "safe" range is composed of six equally spaced values
in the 256 value range for each color component. With six values for
each component, this gives a total of 216 (6 X 6 X 6) color combinations. Hexadecimal: 00, 33, 66, 99,
cc, and ff Decimal: 0,
51, 102, 153, 204, and 255
These friendly color names are taken from the Windows 16-color VGA
palette. The color names represent zero, half and full-values (00, 80 and
ff respectively) in the RGB component method. Associating names with
colors is usually easier for many authors to remember, but the cost
is limiting the choice to only 16 values.
While the VGA color names may be easy to remember, the range of colors
is very limited. Netscape expanded this set of named colors to a
standard set of 140 color names used for many years in the UNIX X11
environment. This set of names assigns arbitrary (and somewhat long)
names to specific RGB values. The color values used seem fairly random
and none of them are in the 216-color "safety palette" (see above,) but
the X11 names DO contain all the names in the Windows VGA
color name palette.
One of the main problems in User Interface design is the inability satisfy
every user. With colors especially, not every user will like or be able to
efficiently use the same colors (because of visual disabilities,
personal preference or other factors.) How can a page be designed with color,
AND allow for such a wide spectrum of user color requirements? The
answer is fairly simple - let the user decide.
Each piece of the user interface in a GUI environment usually has an
addressable system name/label, from scrollbars all the way to the
application background. A user will have specific colors or values
specified for use by each of these pieces in the system. Colors can now
be specified using these system labels to give some control over page
appearance to the viewer. In theory, letting the user decide what their
own user interface should look like will yield the greatest satisfaction.
Some browsers can recognize RGB color component colors without the
"#" symbol present, but this should not be relied on.
Case sensitivity should not be an issue for any of the color name
methods mentioned above.
It is wise to specify the text and link colors when the BGCOLOR
attribute is also specified. This is to ensure proper contrast is
maintained between these basic page elements.
The "GrayText" UI color name is set to #000000 (black) if the display
driver in use does not support a solid gray color.
Looking at the X11 color swatches in Opera 3.5 on Windows 98, it appears
that these color names are NOT supported: AliceBlue, BurlyWood,
Crimson, DarkBlue, DarkCyan, DarkGray, DarkMagenta, DarkRed, Indigo,
LightGreen, LightGray, SaddleBrown, Salmon, WhiteSmoke