hen you design web pages
in HTML, as you probably So what happens if your web page
know, you can use a includes a color that isn't in
tremendous range of colors (over the color-safe palette, and a
16 million) for fonts, tables, person tries to view on a 256
backgrounds and so forth using color screen?
the COLOR attribute of the
various HTML tags. Answer: It depends on the user's
web browser.
One thing that many novice
webmasters don't think about is - In some cases, the colors that
whether these colors will be aren't available will be
displayed correctly on the converted to their nearest
screens of visitors who don't "color-safe" equivalent. This can
have the latest whiz-bang lead to your web page looking
graphics cards. different from what you intended.
There are still people out there - In other cases, particularly
who have a graphics cards which for large areas of continuous
are only capable of displaying color (such as backgrounds and
256 colors at once. In these tables), the browser may attempt
cases, the only colors which you to simulate the your chosen color
can be sure will be displayed by "dithering" two or more
correctly are those in the color-safe colors together. This
browser-safe color palette. usually makes the colors look
grainy, and very often looks
For information about the absolutely terrible. If you don't
browser-safe color palette see: know what I mean by "dithering",
http://www.graphicsacademy.com/wh see the explanation at:
at_colorsafe.php http://www.graphicsacademy.com/wh
at_dither.php the hash symbol, are actually
three pairs of digits,
The Solution: representing the Red, Green, and
Blue components of the color
Review your HTML coding, and look expressed as hexadecimal numbers
at the colors in each COLOR = in the range 00 to FF.
attribute... then change them to
their closest color-safe So for the color given above:
equivalents.
- C2 is the Red component
(You might want to make a safe - 0F is the Green component
copy of your web pages before - 8C is the Blue component
doing this, in case you make an
oopsy). There is also a three-digit
Understanding The COLOR Attribute variant of the above which you
In HTML Code: may very occasionally run across:
If you look at the COLOR= If you see something like:
attributes in the HTML code, it COLOR="#F9C"
usually looks something like this
Then you simply need to repeat
COLOR="#C20F8C" each digit, thus F9C represents:
(Sometimes you may also see named - FF for the Red component
colors like "RED" or "MAGENTA" - 99 for the Green component
which is beyond the scope of this - CC for the Blue component
discussion, just skip over any of
those). Converting to Color-Safe Colors:
The values in the quotes after Now we understand the theory,
we're ready to convert a color to If we need to convert C20F8C to
its closest color-safe its closest color-safe
equivalent. equivalent:
For each of the Red, Green and - We would convert the C2 part to
Blue components, you need to CC
convert them separately into - We would convert the 0F part to
values, you need to convert them 00
separately into the color-safe - We would convert the 8C part to
equivalents, and then recombine 99
the whole lot together. - And thus we would CC0099 as the
final color.
The conversion step goes like
this: Some other examples:
00 to 19 - converts to 00 2B2CF0 would convert to 3333FF
1A to 4C - converts to 33 C000C0 would convert to CC00CC
4D to 7F - converts to 66 F0A000 would convert to FF9900
80 to B2 - converts to 99 And so on...
B3 to E5 - converts to CC
E6 to FF - converts to FF This article is Copyright (C)
2005, Answers 2000 Limited.
For example:
About the Author:
This article was written by Sunil Tanna of Answers 2000. For more
graphics tutorials, tricks and tips, please visit
http://www.graphicsacademy.com/
Read more articles by:
Sunil Tanna
Article Source: www.iSnare.com