A
simple method of converting HTML Hex Color Codes
to
Binary RGB (red green blue) formats
for use in your Paint programs |
There is no intention
here of trying to demonstrate the conversion of base number systems, just
a simple way of you being able to achieve the colors you are seeking |
- First a simple explanation
- When you see a hex code such as "FF0088" it is important
to understand that this code represents 3 pairs of numbers representing
the three different colors that go into defining RGB colors.
- The first pair "FF" is the code for the Red Factor
- The second pair "00" is the Green Factor
- And the third pair "88" represents the Blue Factor
|
- Now we can open up the calculator that comes with Windows
- Mine is Windows 95 and might be a little different from yours.
- You should be able to find it under your Start Menu | Accessories
in Win95, if not you can install it through Add Remove software in
your control Panel
- oops -- I just noticed I have my calculator set to "Scientific",
under the "View" options.
|
- In our everyday lives we are only aware of the decimal number system,
and this is the system that RGB uses for its codes versus the Hex
system used in HTML
- Note in the image below you have radio buttons for "Hex"
"Dec" "Oct" and "Bin"
- The only two we are concerned with here are "Hex", and
"Dec"
|
|
- For an example Lets try with the text Color for this table
- The Hex code is "#FFFF00"
- The 3 pairs are "FF", "FF", "00"
- Now to convert the "FF" I click on the Hex radio button
in the calculator and type FF in the input box.
- Then I just click on the "Dec" radio button and the calculator
returns the "Dec" equivalent in this case 255
- There is no point in doing that twice so I will go to the "00"
pair, and repeat the conversion.
- Click on "Hex", enter 00, click on "Bin", and
I get 0
- So now I know that my Red = 255, Green = 255, and Blue = 0
- I can go to my paint program, and in custom colors select the RGB
Color Model, and insert these three values to come up with the same
color. Also Netscape allows me to select "Custom Colors"
in it's "Options | Colors" menu.
- Just keep in mind that the sequence is always the same. The first
pair is for Red, the second is for Green, and the third is for Blue.
- Note that the inverse of this process is the same for building a
"Hex" string. Enter the "Dec" value, click on
"Hex", and build the string remembering to keep the "RGB"
sequence in it proper order.
|
Note to the user. My
memory of Windows 3.xx is not so hot now, but I am sure that I recall
that the calculator does allow for "Dec" "Hex" conversion.
Also it rings a bell that Windows 3.xx has two calculators, a standard
one, and a Scientific one. Don't be afraid of the scientific one. For
what we want here, it is still pretty simple. You might have to play around
with it a bit to find the conversion options. If you have a problem with
your calculator, please contact me and I will try to find a solution for
you. |