Web Colors - What are Hexadecimal Colors?

By Charles Hopkins Published 09/22/2007 | Web Design
Hexadecimal notation is the most common method for designating color on a web site. A hexadecimal color code is a six digit number with a # (hash) symbol in front of the value. Computers use units of two to count, rather than base 10. Hex is base 16 or 2 to the power of 4.

In the six digit value, the first two numbers define red, the next two define green and the last two define blue. Each digit has 16 values, using numbers and letters 0-9 and A-F. A through F function as the numbers 11 through 16. Because each color is represented by a pair of base 16 numbers, there are 256 (16 x 16) possible values for each color. When you combine the values of the three colors there is a possibility of 16,777,216 (256 x 256 x 256) combinations of color.

For example, pure red is #FF0000, pure green is #00FF00 and pure blue is #0000FF.

At first it may seem difficult to determine what color you will get with different color codes. A simple solution to this is to remember that FF is the maximum and 00 is the minimum, and use one of the following codes for each component:

FF means full brightness
CC means 80 percent brightness
99 means 60 percent brightness
66 means 40 percent brightness
33 means 20 percent brightness
00 means none of this color component

Sometimes you will find hexadecimal numbers expressed using only three digits, such as #F32. This is an abbreviation for a color that has a pair for each of the three numbers. #F32 is the same as #FF3322.

You will also see web pages that use color names to describe a color that is being used. The W3C's HTML 4.0 specifies only 16 standard color names: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. Most browsers today support more color names, but when specifying a color it is usually best to use a hexadecimal number as hexadecimal colors are supported by all browsers.

You should be aware that when viewing colors on a computer monitor, different monitors may display colors in very different tints. Neutral, earth-tone colors such as medium gray, tan and ivory can lead to even more unpredictable results on many computer monitors, and may even seem to change color on one monitor depending on the lighting conditions in the room and the time of day.