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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RGB html code 1

Status
Not open for further replies.

z35

Programmer
Dec 21, 2001
206
US
hi

can someone tell me the html code for the following grey color:

R=245
G=245
B=245
 
FYI:

HTML uses hexidecimal notation. That means that instead of counting from 0 to 9 before moving into two digits, it goes from 0 to 15. 10 to 15, however, are written as A to F. So, to count from 1 to 20 would be something like:

01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14

When you have two digits, the first digit represents multiples of 16, just like the first digit in two digit decimal numbers represent multiples of ten.

So, to translate 245 into hex, divide by 16 for the first digit, then use the remainder for the second digit.

ie: 245 divided by 16 = 15 remainder 5.
15 is F. 5 is 5.
So 245 is F5.

Do that for Red, Green and Blue, stick them together in that order, and you have a HTML color:

245 Red, 245 Green, 245 Blue becomes
F5 Red, F5 Green, F5 Blue becomes
#F5F5F5.

If you want to make a 'Web Safe' color, both digits have to be the same, and they have to be either 00, 33, 66, 99, CC or FF. Find one close, and round your values up or down.
 
that's what i wanted to know. thanks to you both.
 
the idea behind hexadecimal numbers is well explained there-

if you want to save time, just use one of many RGB to hex converters - here's one:
or maybe a RGB & hex web-safe color picker?
Try this one:
All useful tools :)


Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
although blueark has actually given a lesson on calcualtions :) .....u might hate me for this....

but NONE OF THIS IS NEEDED when working in Photoshop!
u might not have that handy URL available since ur working on your prject in some coffeee shop or park ;-)
Soooo

if ur new doc is RGB mode then simply double click on ([][] switch Forground/Background button) foreground color and "Color Picker" window will come up....type in your R,G and B values and #xxxxxx will be genearated for you....and of course works vice versa!

All the best!

> need more info?
:: don't click HERE ::
 
Hi,

I follow lebisol's routine. This is only possible in PS 5.5+, version 5 and lower do not display the hex box in the color picker.

Hope this helps!

Nate

mainframe.gif

 
lebisol

No, I don't hate you for that - anything for an easy life! It's nice to know the theory, but if you've got the tools, you may as well use them....
 
Anyone know of any charts that separate RGB/CMYK amounts by primary colors?

Example R0 G0 B255 Blue
R74 G0 B180 Blue? Violet?

Color Blindness is a curse!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top