Web Safe Colors Netscape and MSIE Colors
  • Websafe hex table

  • Websafe RGB table
  • Named Color Literals and Hex Values

  • All the X Named Color Constants

  • About Web Colors

    RGB and Hexademical Color Values

    Web colors are represented in combinations of red, green, and blue. Hence RGB. Each value must be between 0 and 255. A pure red would have an R value of 255, with G and B set to 0. Just to make things more complicated, browsers ask for colors in hexadecimal (base 16). Keep with this for a few weeks and you'll be able to convert base 10 to hexadecimal in your sleep (Explanation: Divide by 8 and then divide that by two to get the sixteens place value. If there's a remainder, add 8 to whatever remainder you already have and that's your ones place. Then convert your sixteens place to hexadecimal by counting on your fingers and toes for A for 10 through F for 15, and then do that again for the ones. It's easier than it sounds).

    Here's an example:

    Red = RGB(255,0,0) = "#FF0000"

    255 / 8 = 31 R 7
    31 / 2 = 15 R 1
    (so now you know your 16s place is 15 or F)
    You have a 7 in your ones place and the remainder of 1 from your second division set (the 8s) so multiply that remainder (which will always be 0 or 1) times 8 (1 X 8 = 8) and add it to your ones remainder (7). 8 + 7 = 15 so you have an F in the ones place also.

    Just to complicate matters, java generally asks for RGB but will accept hex.

    Web Safe Colors

    255 x 255 x 255 is more than 16 million colors. That should be enough for anybody. However, not all video monitors can see all 16 million colors. Even those that can run a teensy bit slower so people who are really into performance often set their video mode at 256 colors.

    As if that was not great enough a loss, there are slight differences between browsers running on different platforms (such as PC vs. clones). The result is that there are only 216 colors that are safe, that you reliably predict will be the same color on all most monitors.

    These 216 colors are the web safe colors.

    A strange browser is one that does not present pages the way yours does. What happens when a strange browser sees a color that it does not recognize? It can either display a color that it thinks is pretty close or it can do something known as dithering. Dithering is an attempt to fool the human eye into seeing a color that isn't really there by displaying different colors of pixels next to each other. So if, say, the lovely magenta color you imagined is not available, then there may a blue pixel next to several red pixels. Dithering was a bad idea to start with and never fools anyone.

    Does this mean you are limited to a 216 color world? Not at all. You don't have to design your pages for the worst browser in the world. Just know that if you are really married to have something appear on as many browsers as possible just the way you want it, then you need to make some concessions.

    The background of this page is a web safe color. The text on this page is not. How does it look?

    You can spot a web safe color because the color value is always a multiple of 3. So any combination of 00, 33, 66, 99, CC, and FF will give you a web safe color.

    Named Literals

    Are you still feeling a little woozy from that decimal to hex example? So are a lot of people. To placate them, Netscape came up with named color literals so that you can enter a color name instead of a hexadecimal value. They have fancy names such as "papayawhip". Netscape and MSIE, in their later versions, both recognize named literals. However, they agree on this about as much as they do on anything else.

    Java also accepts named literals, but only for the basic colors.


    Web Design and scripts by Design Passions