Given hue and saturation of a color, how to generate colors in evenly spaced relative luminance level?

StackOverflow https://stackoverflow.com/questions/19667652

Question

Given hue and saturation of a color (H & S of HSL), how to generate colors in evenly spaced relative luminance level? E.g.

Linear by Luminance screencap Source: http://www.workwithcolor.com/hsl-color-schemer-01.htm

If I give it a pure Red @ 50 relative luminance, how can I mathematically generate RED at different relative luminance in 5 - 10 stops?

No correct solution

OTHER TIPS

A lot of interesting things may be found in sources of LESS, which has some built-in color-calculating functions, listed here (search for 'rgb', that will be the first one).

Going to implementation, take a look for their one-liner for luma function, which should return luminance of a color.

What I ended up doing is a dumb linear search from 0 to 100 in L of HSL and stop when it reaches one of the Lum stops.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top