Jump to content
  • Advertisement
Sign in to follow this  
AndyTang

HSL Colour Wheel

This topic is 4790 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know how to program a colour wheel with the triangle pointer for HSL values? I don't really understand how you can fit all the colours from a rectangle SL to a triangle SL.

Share this post


Link to post
Share on other sites
Advertisement
I probably can't explain it in terms of the math involved, but I can give you a good asbtraction about it.

See, at 0.0 Luminance, any hue and saturation yields black. Likewise, at 1.0 Luminance, any hue and saturation yields white. So, if you think about the color space as a sphere, with black at the bottom, white at the top, and solid hues on the circumferense, with gray at the center, this'll put you in a good mind frame.

An SL triangle puts each vertex at either the Black, the White, or the Hue. Logically, the Saturation along the BW segment is 0.0, with the Luminance sliding from 0.0 to 1.0 between the two points. The Hue vertex would have a 1.0 Saturation, with 0.5 Luminance. The HB segment slides from 0.5 Lum to 0.0 Lum, and slides 1.0 Sat to 0.0 Sat. The HW segment slides 0.5 Lum to 1.0 Lum, and 1.0 to 0.0 Sat.

Now, if you remember that Sphere I mentioned before. Imagine this SL triangle as a half circle with the line segment as the verticle between white and black. This is how it covers the colors a square does.

Sorry I can't spell out the exact algorythms involved, but I just don't know them. Hope this theory helps.

Share this post


Link to post
Share on other sites
I found the source of my problem - its the values outside of a triangle visually.
Say at Luminance of 75% and a Saturation of 75%, this would lie comfortably in a LS square, but seemingly outside of a LS triangle.

At first I though the sides were compressed from the square into a triangle but that would of course leave one side as white (100% luminance) and the other side black (0% luminance) which isn't right is it?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!