Sunday, April 22, 2012

BASICS OF WEB DESIGN: HTML Color Codes

      Now to add background color to your page, you have to add it as a background attribute to the body element  using either hexadecimal color coding, RGB coding or using predefined color names.
I'll like to explain the HTML color coding before going further. The RGB(r=red, g=green, b=blue) color coding simply represents the amount(in decimal or hexadecimal) of red, green and blue mixed with additively to get a vast combination of color although only 216 colors are popularly used by old browsers but today, computers supports millions of colors so web masters aren't limited to web safe colors anymore.
     For instance, the RGB code for white color in hexadecimal (Hex tripet) is #ffffff with each pair of hexadecimal digit representing the the amount of red, green and blue that gives us white color. On the other hand the RGB decimal code (RGB tripet) for white is 255,255,255. This is gotten by converting the hexadecimal value for red, green and blue to their decimal equivalent (if you have been obedient enough when your math teacher is teaching number bases in school, you wont have a problem with that), hexadecimal is simply base 16 and decimal is base 10. But if you dont get it, dont worry because you can get the code for any color at all online or you can use your calculator compute it (if you want get the satisfaction of doing things by yourself). The picture below shows a color chart. You can view similar codes on http://computerhope.com/htmcolor.htm. we'll apply this knowledge to our page in the next tutorial.
The HTML color picker below gives you the Hex, decimal as well as other information about just any color. All you have to do is to use your mouse to adjust the hue, saturation and brightness and once the color you want appears on the swatch, you can read off its Hex(hexadecimal) or decimal value.









No comments:

Post a Comment