This page will allow you to see how different text and background colors are
viewed in your browser window. HTML allows for 16,777,215 colors to be displayed.
However, many computers are only set to display 256 colors. This just means
that if these computers try to view a color that is not one of those 256, they
will just display the color closest to it or try to combine certain colors to
get a close match (this is not always a pretty sight). Colors are defined in
HTML using a hexadecimal system. We usually think in a decimal system - we count
0 to 9 then add a 1 in front of 0 to get ten and repeat. The hexadecimal system
works about the same, but it uses 16 base numbers, 0 to 15, instead of 0 to
9 like we are used to. Instead of counting 10 through 15, hexadeximal uses the
letters A through F to represent these values. If we lived in a hexadecimal
world, we would count like this:
00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F
then would come 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1F
then 20 and so forth.
The highest two digit hexadecimal number is FF, which is equal to 255 in decimal (16X16=256, minus 1 to adjust for the fact that hexadecimal counts the 0 as a value, decimal does not, to get 255). To define a color in HTML we assign a two digit hexadecimal value to each of three colors - Red, Green, and Blue. Like a painter mixes these three primary colors to get different colors, HTML allows you to do the same thing. A simple hexadecimal color would be 000000. The first two numbers are the Red value, the next two the Green value, and the last two the Blue value. Because each of these is 00, they have no value or it is the same as having no color, which is the absence of color or black.
Another RGB (Red, Green, Blue) value is FFFFFF. In this case, all three color values are FF or the highest two digit value. This would mean the maximum amount of all three colors, which turns out to be white. FF0000, would be the most Red, and no Green or Blue, which of course is red. Thus, we can have up to 256 values for each of the three colors giving us a total of 16,777,215 possible colors.
To see what hexadecimal RGB colors look like click here