Hexadecimal Colors

Red, Green and Blue
Hexadecimal numbers are used on web pages to set colors.

The color is defined by its mix of Red, Green and Blue, each of which can be in the range:

Color Mixer
Try mixing your own colors to see how it works (or type values into the hexadecimal or decimal boxes):

red

47 = 2F

green

50 = 32

blue

159 = 9F

Hexadecimal:

Decimal:

RandomChanging

© 2015 MathsIsFun.com v0,87

Also see Interactive Color Wheel.

Hexadecimals
Hexadecimal numbers are "natural" to computers, because computers store and handle binary digits, and four binary digits make one hexadecimal digit (see Binary Digits): So one hexadecimal digit can have 16 different values (0 to 15 in decimal), and two hexadecimal digits together (called a "byte") can make 16×16=256 different levels of color.

16 Million Colors
Because each of the three colors can have values from 0 to 255 (256 possible values), there are: (and this is why you see claims of "16 Million Colors" on computer equipment)

Web Format
The format ("notation") used on web pages is #RRGGBB, where RR is how much Red (using two hexadecimal digits), GG is how much Green, and BB how much Blue.

Example: a nice shade of blue is made up of: So it is (64.48,255) in decimal, which is equal to (40.30,FF) in hexadecimal and is coded as #4030FF.
 * 64/255 Red,
 * 48/255 Green
 * 255/255 (i.e. full) Blue

This may help you remember:

Roses are #FF0000 Violets are #0000FF Just don't forget, Grass is #00FF00, too

Some Common Colors
Try entering the hexadecimal code into the color mixer above, and see what you get (you can copy, then right-click the hexadecimal box, and select "paste").