HTML colors are defined using a hexadecimal notation (HEX) for the combination of Red, Green, and Blue color values (RGB). The lowest value that can be given to one of the light sources is 0 (in HEX: 00). The highest value is 255 (in HEX: FF). HEX values are specified as 3 pairs of two-digit numbers, starting with a # sign.
Color | Color HEX | Color RGB |
---|---|---|
#000000 | rgb(0,0,0) | |
#FF0000 | rgb(255,0,0) | |
#00FF00 | rgb(0,255,0) | |
#0000FF | rgb(0,0,255) | |
#FFFF00 | rgb(255,255,0) | |
#00FFFF | rgb(0,255,255) | |
#FF00FF | rgb(255,0,255) |
16 Million Different Colors
The combination of Red, Green, and Blue values from 0 to 255, gives more than 16 million different colors (256 x 256 x 256). If you look at the color table, you will see the result of varying the red light from 0 to 255, while keeping the green and blue light at zero.
Gray Shades | Color HEX | Color RGB |
---|---|---|
#080808 | rgb(8,8,8) | |
#101010 | rgb(16,16,16) | |
#303030 | rgb(48,48,48) | |
#383838 | rgb(56,56,56) | |
#585858 | rgb(88,88,88) | |
#606060 | rgb(96,96,96) | |
#707070 | rgb(112,112,112) | |
#787878 | rgb(120,120,120) | |
#909090 | rgb(144,144,144) | |
#989898 | rgb(152,152,152) | |
#B0B0B0 | rgb(176,176,176) | |
#B8B8B8 | rgb(184,184,184) | |
#C0C0C0 | rgb(192,192,192) | |
#E0E0E0 | rgb(224,224,224) | |
#E8E8E8 | rgb(232,232,232) | |
#F0F0F0 | rgb(240,240,240) |
Web Safe Colors
Some years ago, when computers supported max 256 different colors, a list of 216 "Web Safe Colors" was suggested as a Web standard, reserving 40 fixed system colors.
The 216 cross-browser color palette was created to ensure that all computers would display the colors correctly when running a 256 color palette. This is not important today, since most computers can display millions of different colors.
Color Names Supported by All Browsers
147 color names are defined in the HTML and CSS color specification (16 basic color names plus 130 more). The 16 basic color names are: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.
HTML Advanced tutorial 17 : HTML Layouts >>
<< HTML Beginner tutorial 15 : HTML Iframes