When programming in HTML, colors are expressed in hexadecimal codes. For instance, Red is #FF0000, white is #FFFFFF, and black is #000000. The blue in the header on this page is #003366. (The # just indicates that a hexadecimal value will follow. Kind of like a dollar sign.)
I had a vague idea of how this all worked, but got a first class lesson today that made it all crystal clear. I’ll try my best to translate, but I’m guessing it will lose something in translation.
First things first- all of the colors that can be displayed in your web browser (all 16,777,216 of them) are made up of different combinations of red, green and blue.
There are 256 different shades of each primary color available. Mix the 256 shades to get variations of colors. (256x256x256 = 16 million options)
In the hexadecimal code, 2 digits correspond to each color. The first set of 2 digits represent red, the second green, and third is blue.
The available values for each single digit range from 0 to F, in this order: 0123456789ABCDEF.
(If it helps, think of the letters kind of like face cards where Jack = 11, Queen = 12 etc.)
You put 2 single digits together to create the pair.
So 00 is the lowest value for any pair. 01 is the next, followed by 02, 03, 04 and so on. When it gets into the letters, they just count up. So it goes 08, 09, 0A, 0B, 0C, OD, 0E, 0F.
When you reach F, add one to the “tens” digit and start over in the “ones” digit. 0D, 0E, 0F, 10, 11, 12, 13 … 19, 1A, 1B, 1C … 1F, 20, 21, 22 and on and on until you reach FF. (When you say it in your head, say them as two digits, not the normal numbers. So “one-eight”, “one-nine”, “one-A” not “eighteen”, “nineteen”, etc.)
Black is #000000. No Red, No Green, No Blue.
White is #FFFFFF. All Red, All Green, All Blue.
Since the first set of 2 digits corresponds to Red, the color code for Red (#FF0000) translates to: The highest value possible for Red (FF), No Green (00) and No Blue (00).
Blue would be #0000FF. No Red (00), No Green (00) and The Maximum Value for Blue (FF).
Purple, a mix of blue and red, is #800080. Half Red (80), No Green (00), Half Blue (80). (In the hexadecimal value system 80 is halfway between 00 and FF.)
Again, there are over 16 million variations available. (#000016 would be a very, very dark blue, for instance.)
And why this cryptic method? The same reason we had the Y2K debacle. It takes less disk space to store a 6 digit hexadecimal number than it would to store in a different format. Add up all of those saved bytes, and you can save a lot of cash on disk storage space.
Source: Zee, who taught me over the phone how to make a darker shade of a color by tweaking the hex codes. Come to think of it, circa 1993 he also taught me how to program my first HTML page over the phone so I could post it to GeoCities (and later FortuneCity). Viva la nerds!

Subscribe / RSS
Nice explanation my friend.
I don’t know if doing this blog has made you a good writer, or good writing makes it a good blog. Whichever the case, it’s consistently entertaining
…and not just because I got a mention, though that did prompt me to comment.
Actually, Zee taught both of this back in 1993 when he was also teaching us to make our first GeoCities page. I know because I already knew this.
Even still, I’m surprised you hadn’t picked it up before this when playing with the background color of Final Fantasy 3.
@Z- I’ll do anything for a comment. I love comments.
@T- Like I said, I knew the basics, but I never gave a lot of thought to exactly how it worked.