Color names can be used in place of RGB or hexadecimal color coding in bgcolor, font, and basefont tags.
Examples:
The sixteen color names are supported rather well by the graphical browsers tested, the only problem being in AOL 4.0: the color name gray is displayed as 999999, while on all other browsers tested it is a darker 808080.
The 140 color names are less supported by the browsers tested. Depending upon the browser, unsupported color names may appear as a color similar to the expected color, another color very different than expected, black, or "transparent". Actually, while there are 140 different names, there are only 138 colors represented: aqua and cyan represent the same color (00FFFF), and fuchsia and magenta represent he same color (00FFFF) .
Some sources state that there four levels of depth to each color as well, with level one being the lightest, and level four being the darkest (i.e., blue1 is lighter than blue4). There are even a few web sites that purport to show this (but like most sites purporting to show color names in action, they actually use RGB coding to show the colors which can be very misleading at times). The color levels are only true for Unix (X Window System). I would strongly advise against using them for cross-platform web design.
Other sources will add extra color names, adding in color names like "navyblue." When most (but not all) browsers come across an unsupported color name, they try to find a hexadecimal color code within the name presented. Hexadecimal uses the numbers 0-9 and the letters A-F. Thus, in navyblue, most browsers will see the A, the B and the E as hexadecimals, and convert the rest of the letters to however many number of zeroes the browser needs to bring the hexadecimal color code to a total of 6 digits. The result? Navyblue gets rendered as A0B0E0, which is a rather light blue color. If you type in "navygreen," you will get a darker blue: 0A00EE. It is by coincidence that "navyblue" produces a bluish color, but not because it is an official color name. Since not all browsers will interpret non-supported color names in this manner, it is unwise to make up color names.
And finally, I need to address the issue of variant spellings of the word gray. I keep seeing references that "gray" and "grey" are both supported. Not completely. I think the confusion may be that most of the gray colors end in "gray" except for one: "lightgrey". Why this one exception is anyone's guess! The bottom line is, in the browsers tested for this site, with the lone except for lightgrey, gray is the correct ending for any gray color, any other spelling is unsupported (and in the case of "lightgrey", the alternate spelling "lightgray" is not a supported color).
The newest version of WebTV supports the 140 color names com pletely, while on older versions of WebTV several related colors are displayed as the same color: blueviolet is the same as blue, goldendrod is the same as gold, greenyellow is the same as green, limegreen is the same as lime, olivedrab is the same as olive, orangered is the same as orange, and yellowgreen is the same as yellow.
Opera 3.60 also does not support all of the 140 names. If a non- supported color name is used in the font tag, the text becomes black, but if used in the bgcolor in table cells, the table color becomes whatever the bgcolor of the page is! In other words, transparent. The non-supported colors are aliceblue (seems to be the least supported color name), burlywood, crimson, darkblue, darkcyan, darkgray, darkgenta, darkred, indigo, lightgreen, lightgray, saddlebrown, salmon, and whitesmoke.
After you remove the colors that are not supported by all browsers tested (under optimum color depth and video RAM conditions), fifteen out of the sixteen color names and 118 out of the 140 color names remain. Out of those, only ten are in the browser-safe palette.
It's difficult to stay within a set number of colors, it's like being told you can only write a complete word picture within fourteen lines, in iambic pentameter, and restricted to a definite rhyme scheme. Makes choosing words painful. But many a beautiful Sonnet was written under such conditions. It could be worse:
Strict syllable count,(I told you it could be worse!) And while free-verse can also be beautiful, constraints can challenge and encourage the creative juices to new heights. The economy of the rigid structure teaches us the importance of each word choice. And make us better free-verse writers later. You can always go to desk top publishing, with its four color print process, or paint with as many colors as you wish on your large canvas, but when it comes to creating for the web world, until color synchronization becomes uniform and universal, coding a web page for the widest possible audience means restraining yourself. You can still occasionally break the rules, but do so carefully! If your audience is a very select one, for instance, and you don't care about losing visits, then by all means code to your select audience. Otherwise, the advice above applies, as does the final advice of avoiding the use of color names. Use the RGB or hexadecimal coding instead; if you do use them, avoid using the ones that are not widely supported and try to use the browser-safe color names. And then realize that...
the rigid, harsh form becomes
a lovely haiku.
-- Much of the above article was published in 2000 as "The Trouble With Color" in Library Computing Journal, Vol 18 no 3., pages 208-212. Journal published by Sage Publications. Will also be included as a chapter for my up coming book "Merchant's Encyclopedia of Useful HTML" for Scarecrow press later this year.
| |Title Page| |Basic Template| |
|---|
| |Color| |Dynamic HTML/Layers| |Form Tags| |Frame Tags| |HTML Entities / ISO Characters| |
| |Image Tags| |Link Tags| |List Tags| |Other Spacing / Layout Tags| |Rule Tags| |Sound Tags| |
| |Style Sheets| |Table Tags I| |Table Tags II| |Text Tags| |Bibliography / Resources| |Index| |
<© David Merchant 1997 - 2001
editor@mountaindragon.com