HSL Colour Wheel

Started by
4 comments, last by AndyTang 18 years, 6 months ago
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.
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.
william bubel
Addendum:

Have a look see at this page:
http://www.cs.brown.edu/courses/cs092/VA10/HTML/ColorModels.html


That HSL Double Cone is the color sphere I was speaking of.
william bubel
It might be easier to use a circle to represent a slice of the hsl color space.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
It is quite difficult to get my head around. I guess it is the maths that gets me.
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?

This topic is closed to new replies.

Advertisement