Results 1 to 3 of 3

Thread: RGB to HSL

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Posts
    92
    Hi ppl!

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

    Thanks in advance!

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    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
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Posts
    92
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width