Continued from page 1
RGB Triplet for Cornflowerblue
color dec hex red 100 64 green 149 95 blue 237 ED
We could then specify
color of text within a span using
hexadecimal notation as shown below.
<span style="color:#6495ed;">Text</span>
Note that when we indicate
use of hexadecimal notation by placing a pound (#) sign in front of
number, and we don't use commas to separate
color components.
If it's not easy to convert between decimal and hexadecimal in your head, then how do you do it? You can use a calculator that has a decimal to hexadecimal coversion function, or you can learn to think in hexadecimal. For example, what's
next number after CE? That would be CF. what's
next number after CF? That would be D0. Which hexadecimal number is higher 99 or B2? B2 would be higher than 99. It gets easier with experience.
Here's Java Script code for a simple decimal to hexidecimal color converter
function convert(decvalue) { var num = parseInt(decvalue); if(num >= 0 && num < 256) { var hexnum = num.toString(16); alert("#" + hexnum); } else {alert("Error!");} }
It's important to use hexadecimal notation to specify colors when you use DHTML with visual effects, because to create a dynamic color change you have to increment or add a value to a color. The vast amount of color specification on webpages is in hexadecimal notation, so it would be wise to become familiar with it.
---------------------------------------------------------- Resource Box: Copyright(C) Bucaro TecHelp. To learn how to maintain your computer and use it more effectively to design a Web site and make money on
Web visit bucarotechelp.com To subscribe to Bucaro TecHelp Newsletter visit http://bucarotechelp.com/search/000800.asp ----------------------------------------------------------

To learn how to maintain your computer and use it more effectively to design a Web site and make money on the Web visit bucarotechelp.com To subscribe to Bucaro TecHelp Newsletter visit http://bucarotechelp.com/search/000800.asp