

In HSV, tinting alone reduces saturation.įig. In HSL, saturation is also unchanged by tinting with white, and only mixtures with both black and white-called tones-have saturation less than 1. Mixing these pure colors with black-producing so-called shades-leaves saturation unchanged. These saturated colors have lightness 0.5 in HSL, while in HSV they have value 1.


In both geometries, the additive primary and secondary colors-red, yellow, green, cyan, blue and magenta-and linear mixtures between adjacent pairs of them, sometimes called pure colors, are arranged around the outside edge of the cylinder with saturation 1. In each geometry, the central vertical axis comprises the neutral, achromatic, or gray colors ranging, from top to bottom, white at lightness 1 (value 1) to black at lightness 0 (value 0). 2), with hue, their angular dimension, starting at the red primary at 0°, passing through the green primary at 120° and the blue primary at 240°, and then wrapping back to red at 360°. HSL and HSV are both cylindrical geometries ( fig. This can be seen when the saturation settings are altered - it is quite easy to notice the difference in perceptual lightness despite the "V" or "L" setting being fixed. The issue with both HSV and HSL is that these approaches do not effectively separate color into their three value components according to human perception of color. shining a bright white light on a red object causes the object to still appear red, just brighter and more intense, while shining a dim light on a red object causes the object to appear darker and less bright). The difference between HSL and HSV is that a color with maximum lightness in HSL is pure white, but a color with maximum value/brightness in HSV is analogous to shining a white light on a colored object (e.g. Meanwhile, the HSV representation models how colors appear under light. Fully saturated colors are placed around a circle at a lightness value of ½, with a lightness value of 0 or 1 corresponding to fully black or white, respectively.

to create "light red", a red pigment can be mixed with white paint this white paint corresponds to a high "lightness" value in the HSL representation). The HSL representation models the way different paints mix together to create color in the real world, with the lightness dimension resembling the varying amounts of black or white paint in the mixture (e.g. In these models, colors of each hue are arranged in a radial slice, around a central axis of neutral colors which ranges from black at the bottom to white at the top. HSL (for hue, saturation, lightness) and HSV (for hue, saturation, value also known as HSB, for hue, saturation, brightness) are alternative representations of the RGB color model, designed in the 1970s by computer graphics researchers. Below: two-dimensional plots showing two of a model’s three parameters at once, holding the other constant: cylindrical shells (b, f) of constant saturation, in this case the outside surface of each cylinder horizontal cross-sections (c, g) of constant HSL lightness or HSV value, in this case the slices halfway down each cylinder and rectangular vertical cross-sections (d, h) of constant hue, in this case of hues 0° red and its complement 180° cyan. Above (a, e): cut-away 3D models of each. Actually, note that out minimum is now not fully off (it is 1 not 0) and our maximum is out of range ( 256 not 255).Fig. In our case, given that we are dealing with computers that like binary, powers of two are convenient. You can generate this result by treating your intensity as a power to raise some number to. What you need to do instead is set your intensity exponentially. So by taking the minimum duty cycle (say 0) and maximum duty cycle (say, for the sake of easy math this is 10) and dividing it into equal chunks, you will be controlling the intensitiy linearly which will not give satisfying results. The analogWrite() routines are setting the output pin's PWM duty cycle, and are linear. What the other answers omit about this topic is the fact that that human perception of light intensity is logarithmic, not linear.
