Color Checker

Trying Out Colors

Colors in a Web page are given as three numbers, one each for three primary colors—red, green, and blue in this case—from which all other colors can be generated. We will discuss this more in another section. For now, just recognize that each color can be specified as a two-digit hexadecimal number.

Using Hexadecimal Numbers to Specify Colors

What's a hexadecimal number? Well, it is a number written in the base 16 system rather than our usual decimal (base 10 system). Whereas decimal numbers are contructed from the 10 digits

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

numbers in the hexadecimal system are constructed from the 16 digits

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F

Web colors can be represented with a 6-digit hexadecimal number, preceded with a the # symbol so that the browser knows that the number is a hexadecimal number. So #45F89A is a hexidecimal number can refer to a color, where the first two digits—45—represent the amount of red, the second two digits—F8—represent the amount of green, and the last two digits—9A—represent the amount of blue in the combined color. We can use the rectangle below to test different colors.

Try it

Hover your mouse over the rectangle. A dialog box will appear. Enter a valid hexadecimal number to see what color shows up in the rectangle.