|
So when someone talks about a "hex code" or "hexadecimal number" or if you see cryptic color codes like 09EC0A, CCFFCC, 00AACC, etc., this is what they're talking about and where it comes from.
Taking it a little further, your computer understands colors in terms of red, green and blue values...
RED - GREEN - BLUE
or
R-G-B
Each of those can have a value from 0 to 255. 0 being the absence of color, 255 being full color. Using that scale, we get the following values...
| |
RED= 255-0-0 |
| |
GREEN= 0-255-0 |
| |
BLUE= 0-0-255 |
| |
BLACK= 0-0-0 |
| |
WHITE= 255-255-255 |
Since we have 3 colors, each with a value that can range from 0 to 255 we have 16,777,216 possible color combinations (256 ³). So, that's how we get 16.7 million colors. Black and white are not considered "colors". White is total saturation of all 3 colors and black is the total absence of any color (at least as far as your computer is concerned).
If we replace the decimal number with it's hexadecimal equivalent we start to get something that looks a little more like those "hex codes".
| |
RED= FF-0-0 |
| |
GREEN= 0-FF-0 |
| |
BLUE= 0-0-FF |
| |
BLACK= 0-0-0 |
| |
WHITE= FF-FF-FF |
If we then use 00 for 0, and 01 for 1, etc., and if we get rid of the dashes(-), we then got ourselves some genuwine color codes!
| |
RED= FF0000 |
| |
GREEN= 00FF00 |
| |
BLUE= 0000FF |
| |
BLACK= 000000 |
| |
WHITE= FFFFFF |
Here are a few random examples of hex color codes...
| |
|
200-0-0 |
|
C8-00-00 |
|
C80000 |
| |
|
255-255-0 |
|
FF-FF-00 |
|
FFFF00 |
| |
|
0-102-204 |
|
00-66-CC |
|
0066CC |
| |
|
191-128-210 |
|
BF-80-D2 |
|
BF80D2 |
| |
|
32-136-23 |
|
20-88-17 |
|
208817 |
| |
|
231-156-3 |
|
E7-9C-03 |
|
E79C03 |
| |
|
0-128-128 |
|
00-80-80 |
|
008080 |
| |
|
71-64-7 |
|
47-40-07 |
|
474007 |
Notice when the red, green and blue values are equal, the result is a shade of gray...
| |
|
210-210-210 |
|
D2-D2-D2 |
|
D2D2D2 |
| |
|
170-170-170 |
|
AA-AA-AA |
|
AAAAAA |
| |
|
117-117-117 |
|
75-75-75 |
|
757575 |
| |
|
60-60-60 |
|
3C-3C-3C |
|
3C3C3C |
Well, I hope that helped you understand a little about "hex codes" and how they put color in your page. The more you understand how all this stuff works, the more control you'll have in your web page. You won't be limited to what some silly HTML editor will let you do. You can do just about anything you want.
Courtesy of: Joe Barta
pagetutor.com
|