Colors in Hexadecimal

[Web Safe Colors] [Reminder]

HTML uses RGB format in hexadecimal for displaying colors for text, background, and borders.  "R" in RGB represents how much red is added to the color, while "G" represents how much green is added, and "B" is for blue.  The combination of different amounts of red, green, and blue creates a particular color.  

HTML uses RGB in three sets of hexadecimal numbers.  For example, 0088FF will give a nice blue color since no red (00), a little bit of green (88), and a lot of Blue (FF, F's are 15 in hexadecimal).  To see other samples click here or go to http://www.ctyme.com/colors.htm.  Another good site is http://www.zspc.com/color/index-e.html.

Examples:

As you may have guessed, the first two digits represent the amount of red, the second two digits represent the amount of green, and the last two digits represent the amount of blue in the color you see as a background color.  So, the higher the number for a color, the more of that color is represented.

In the normal decimal number system, we have digits from 0 to 9.  And with those digits we can express all the  numbers we need.  In the hexadecimal system, the digits 0-9 represent their usual meaning in decimal, plus the letters A-F (or a-f) represent hexadecimal digits with values of 10 to 15.  So,  hexadecimal numbers 0 to 9 are the same as normal decimal numbers 0 to 9, hexadecimal A is equivalent to 10 in decimal, hexadecimal B is equivalent to 11 in decimal, and so on up to hexadecimal F being equivalent to 15 in decimal.  So, why does the hexadecimal (hex = 16) system goes up to only 15?  It is because you have 16 numbers including 0.  For the same reason the decimal system goes up to 9, and not 10.  Take a look at the table below.

Decimal Hexadecimal Decimal Hexadecimal
0 0 10 A
1 1 11 B
2 2 12 C
3 3 13 D
4 4 14 E
5 5 15 F
6 6    
7 7    
8 8    
9 9    

You may use either upper or lowercase letters for hexadecimal numbers in coding HTML.  

* Reminder:  No matter what you do with HTML, you do not have complete control over exact display of the color you set up in the Web page.  It is up to the user's browser and/or the user's monitor.  To get a better idea of the color, view the Web page on both Netscape Communicator and Internet Explorer.

* Web Safe Colors:  Different browsers and monitors have different interpretation of color codes.  So, bgcolor="9BAA7F" can be displayed as  

 

on the Internet Explorer, while the same color codes can be displayed as

 

on the Netscape.  Also difference of monitor play a major role in how the colors are projected.  So, there is a few "standard" colors for Web pages.  The set of 216 colors that are deemed "Web-Safe" are limited to a combination of only six RGB values: "00","33","66","99","CC", and "FF".  The RGB number for a Web-safe color can only consist of these two-digit hex numbers.  For example, #0033FF is a safe color while #003344 is not.  So, whenever you want to decide on a background color, unless you are forced to choose a particular color it is safer to stick to Web-Safe colors.  Read more about Web-Safe colors at http://www.webdevelopersjournal.com/articles/websafe1/websafe_colors.html, or search the Internet to find more information.

The Tucows has a Web page that helps you choose a Web-Safe color at http://html.tucows.com/designer/colorhexchart.html.