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

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

문제

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?

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top