PDA

Click to See Complete Forum and Search --> : RGB to HSL


iScanning
Mar 18th, 2001, 09:27 AM
Hi ppl!

Could you tell me how to convert an RGB value to and HSL value?

Thanks in advance!

Sastraxi
Mar 18th, 2001, 09:48 AM
L = R+G+B/3
S = 1 - (1/L)*Min(R,G,B)
H = cos^-1( (.5*(R-G) + (R-B) ) / (((R-G)^2 + (R-G)(G-B))^.5) )

(I stole it off of some1 else's site0

iScanning
Mar 18th, 2001, 07:36 PM
I'm sorry but thats far from correct!

Fisrt of all theree must be a more accurate function for the L, cause in most cases it misses big time, S and H are incorrect cause theres something missing!

Hope to hear from any of you guys who can help me out!