Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I seem to be spending a lot of time

Status
Not open for further replies.

MatthewP

Programmer
Jan 16, 2001
176
GB
I seem to be spending a lot of time trying to convert Hexadecimal colour values into RGB values for photoshop, so I can match graphics to background colours and stuff. Surely there's some way I can write a converter in Javascript, so I can input an rgb value and get it to spit out a hex value and vice versa.. can anyone help me - I imagine someone must have done this already..

Thanks
Matt.
 
If you are using windows then just use your calculator.

First, make sure that you have it in scientific mode -- then just type in an rgb value. now, change the mode from Dec (decimal) to Hex (hexcode)

And it will tell you that value in hexcode.

Just do all three values of the rgb and combine them to get the value in hexcode. ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
Doh! How long could I have saved knowing that... Thanks!

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top