A web color is usually specified as a 6-digits hexadecimal number.
The 6-digits represents the Red Green Blue value of the color,
commonly referred as the RGB values. Even though there are 6
digits on each number, these six digits are actually three separate
pairs of numbers, specifically:
The first two digits are the Red (R) value of
the color.
The next two digits are the Green (G) value
of the color.
The last two digits are the Blue (B) value of
the color.
You might attempt to interpret all six digits as a whole, but that
will be meaningless. Instead, you should always break
up the six digits into RGB values like this RRGGBB.
So for example, if a
hex value is FF6699, then RR=FF, GG=66, BB=99.
Here are more examples:
FF0000
The Red value for the color is FF (full red).
The Green value for the color is 00 (no green).
The Blue value for the color is 00 (no blue).
So:
Full Red + No Green + No Blue = Full Red
(I.e.: Red mixed with nothing is always red.)
The result is this color.
00FF00
The Red value for the color is 00 (no red).
The Green value for the color is FF (full green).
The Blue value for the color is FF (no blue).
So:
No Red + Full Green + No Blue = Full Green
(I.e.: Green mixed with nothing is always green.)
The result is this color.
0000FF
The Red value for the color is 00 (no red).
The Green value for the color is 00 (no green).
The Blue value for the color is FF (full blue).
So:
No Red + No Green + Full Blue = Full Blue
(I.e.: Blue mixed with nothing is always blue.)
The result is this color.
FFFF00
The Red value for the color is FF (full red).
The Green value for the color is FF (full green).
The Blue value for the color is 00 (no blue).
So:
Full Red + Full Green + No Blue = Full Yellow
(I.e.: Red mixed with green produces yellow.)
The result is this color.
FF00FF
The Red value for the color is FF (full red).
The Green value for the color is 00 (no green).
The Blue value for the color is FF (full blue).
So:
Full Red + No Green + Full Blue = Full Purple
(I.e.: Red mixed with blue produces purple.)
The result is this color.
At this point, realize that each Red, Green, and Blue values
represent the amount of tint/hue for each component. The bigger
the value of the component, the brighter that particular component
will be. 00 means no tint at all, FF means full
tint.
For example:
000000 is a complete black. If we add some Red tint (for
example set the Red value to 33), then we get something like this:
330000 (this is actually reddish
black, but you might not notice it on the monitor) If we
keep adding Red tints, then the brightness of the Red will increase:
660000
990000
CC0000
FF0000
You can apply this principle to other
colors. For example, if you want to create the color yellow, you
can mix red and green, like this:
666600
Now if you find that too dark, you
can increase the values until you find the one you like without having
too consult to a color table every time:
AAAA00
FFFF00
So, the most important thing to
remember is that the 6 digits hexadecimal color value aren't meant to be taken
as a whole. So, let's say you want to know what FF0099
means; you don't try to interpret the whole number (FF0099); instead,
break it up into the the Red, Green, and Blue values as
shown in the examples below. So, in this case:
FF0099
should be interpreted like this:
The Red value for FF0099 is FF (full red).
The Green value for FF0099 is 00 (no green).
The Blue value for FF0099 is 99 (some blue, but there's less blue tint
than the red tint).
So:
Full Red + No Green + Some Blue = Reddish Purple
(Remember that red mixed with blue produces purple.)
FF0099
Consequently,
9900FF can be interpreted as
Some Red + No Green + Full Blue = Bluish Purple
9900FF
How about trying to create an orange?
Well, yellow is Red+Green. Adding more red tints than green
tints will produce orange. For example: FFAA00,
FF9900, CC6600.
As the tint decreases, the colors becomes closer to black, as you seen
in the case of CC6600 (dark orange - brown).