# Working with the color attribute in HTML

• Mastermind
• Posts: 1571
• Loc: Seattle, WA

3+ Months Ago

Um, I hope its ok if i post a quick question here. Im having troublke with the colors. I can get it just straight colors, like <BG COLOR="OOOOFF"> But I cant get any other colors except the 3 "FF" colors. Im using crimson, trying at least. Ive tried combos like "OOFOGO" and it didnt work. What am I doin wrong?
• Posts: 9128
• Loc: Seattle, WA

3+ Months Ago

Code: [ Select ]
<body bgcolor="#0000ff">

would be correct. Now as far as the actually colors like #0000ff or #OOFOGO - the second would be wrong because you got to remember that the color is a hexadecimal number.

So for instance regular decimal number valid digits would be:

0123456789

and for a hexadecimal number valid digits would be:

0123456789abcedf

So now back to your color of #OOFOGO it is wrong because the only valid digit you have in there is the f. The Os are wrong because they need to be zeros, and the G is wrong because that is not a valid digit.
• Mastermind
• Posts: 1571
• Loc: Seattle, WA

3+ Months Ago

Oh....ok. cool. I think I understand. Thx. Im gonna try it out.
• Posts: 9128
• Loc: Seattle, WA

3+ Months Ago

Here is even more detail if you are interested:

The numbers in the color attribute represent RGB (Red, Green, Blue). Each number in the color attribute is six numbers in length always. The first two numbers represent the intensity of red, the second two numbers represent the intensity of green, and the last two numbers represent the intensity of Blue. Each set of numbers starts out at 00 and works its way to ff. Each digits order is as follows, 01, 02, 03, 04, 05, 06, 07, 08, 09, 0a, 0b, 0c, 0d, 0e, 0f, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1a, 1b, 1c, 1d, 1e, 1f, 20, 21... and so on until you reach ff. By combining different intensities of colors you can create and endless number of colors. 00 is the darkets intensity while ff is the lightest intensitsy. 77 is a mid intensity for a color. Thus a color of #000000 would be black and #ffffff would be white. #77777 would be a medium gray. Since the first two numbers represent red then #ff0000 would be a bright red since ff is the higest intensity for that color. #00ff00 would be a bright green and #0000ff would be a bright blue. This should all be straight forward. Things get confusing when you start mixing colors and that is why I created the chart on the next page. Below you will find different text in different colors.

<font color="#ffffff">#ffffff White </font>
<font color="#ff0000">#ff0000 Red </font>
<font color="#00ff00">#00ff00 Green</font>
<font color="#0000ff">#0000ff Blue</font>
<font color="#888888">#888888 Gray</font>
<font color="#ffff00">#ffff00 Yellow</font>
<font color="#ff00ff">#ff00ff Magenta</font>
<font color="#00ffff">#00ffff Cyan</font>
<font color="#55ff55">#55ff55 Green (melow)</font>
<font color="#6688ff">#6688ff Blue (melow)</font>
<font color="#ff5555">#6688ff Red (melow)</font>

You can find even more details here:

http://www.unmelted.com/font-tag4.html

and a small color chart here:

http://www.unmelted.com/font-tag5.html
• Mastermind
• Posts: 1571
• Loc: Seattle, WA

3+ Months Ago

Ok, cool. Now it makes perfect sense. Thx for the help.

## Post Information

• Total Posts in this topic: 5 posts
• Users browsing this forum: No registered users and 14 guests
• You cannot post new topics in this forum
• You cannot reply to topics in this forum
• You cannot edit your posts in this forum
• You cannot delete your posts in this forum
• You cannot post attachments in this forum