Translate and Convert RGB Color Values into Hexadecimal Hex Equivalent
In a html web page, there is code such as <body bgcolor=#ffffff> or color=”#000000″. The “ffffff” is the colour RGB hexadecimal value which will translate into a white, and “000000″ is black.
The RGB colour code must be converted into hexadecimal (Base-16) number in order for the browsers to understand them. Then the resulting two-digit hexadecimal (”hex” for short) numbers are strung together into a single six-digit code. So in the example above, the first two “f”s and “0″s stand for the red value, the next two stand for green, and the last two for blue.
It’s possible to get the RGB hex value from a colour chart. But if you encounter a favorite colour, it’s possible to get its RGB value and convert it into hex code.
To get the RGB value of a colour from a photo, simply open the photo or picture in Microsoft Paint or any image processing software. Use the pick color tools to pick the colour and the RGB value should be shown. For Microsoft Paint, after you pick the colour, click on Colors menu, and then Edit Colors. On the window shown, click on Define Custom Colors, and you will see the RGB value of the color you just selected shown there.
For translation/conversion to Hex calculation, we will use the color of lovely sea green with the RGB values R=51, G=219, B=153 as example.
To translate the RGB value into hexadecimal value, first take the value of Red (51) and divide it by 16. The balance is 3.1875. The integer, 3, will be the first number in the hexadecimal formula. The remainder (0.1875) should be multiplied by 16, which also results in the number 3. So, 51 translates to 33 in hex.
If you get integers and remainders that translate into from 10 or 15, then translate the two-digit number into a single letter (that’s where all the d’s and f’s come in), where 10=A, 11=B, 12=C, 13=D, 14=E, and 15=F. This becomes relevant to our lovely sea green when we calculate the hexadecimal equivalent of its Green value, which is 219. When we divide it by 16, we get 13.69. We translate 13 to D, and then multiply the remainder – 0.69 – by 16, and get 11, which equals B.
Repeat this formula for the Blue value, and then string them together (you should get 33DB99). 33DB99 is the RGB Hexadecimal value for the colour which can be used in the html web page.
Related Articles
- Get the Color Code with Instant Eyedropper
- Translate Movie Subtitles with Subtitle Translation Applications
- Client for Google Translate Simplifies Text Translation and Access to Wikipedia in Webpages and Applications
- Oracle PL/SQL ORA-00947 Not Enough Values Error
- Verbatim’s New Color Nano Wireless Notebook Mouse with 2.4GHz Receiver
- Sony Carnival Color Collection PSP-3000
- Change the Skin Color for Yahoo Messenger 9
- HTML Color Names HEX Codes Chart Table
- How to Remove or Delete a Registry Key, Subkey and Values with .reg Registration Entries File
- eyePilot to help Color-Blind People










































November 8th, 2009 19:43
4655434B
March 31st, 2009 15:38
Yeah…so long i want to get this formula.Thank you so much.
January 17th, 2009 04:03
[...] google_color_border, google_color_bg, google_color_link, google_color_text, google_color_url – Determines the color of the ad border, ad background, ad title of each ad, ad text inside the ad block, and URL at bottom of each ad. Up to 4 separate values (differentiated by commas) can be supplied for automatic color rotation when the ad is served by the Google server. The image ads does not affect by these values. Note that the color value should be converted in hexadecimal format. [...]
January 7th, 2009 04:37
THANK YOU SOOO MUCH!!!! I lost a hex value for a color that I needed desperately! I almost paniced! But when I found this site, it worked perfectly! Thanks to whoever made this site!!!
September 5th, 2008 23:29
Thank you sir, this is exactly what I was looking for. Plus, you are the top result on google when searching “how to translate rgb into hex”
December 5th, 2006 18:33
Hi sorry anon, the keywords are based on what users search, and is not controllable.
December 5th, 2006 18:07
It’s damn misleading to stuff the word “pantone” into you keywords when you don’t talk about it at all.
April 11th, 2006 11:59
What a fantastic page. The web is full of ready-made converter tools, but I love to know HOW things are done. Your page on RGB to Hex conversion is well written and straightforward.
What a bonus to DIY webmasters such as myself. Many thanks.