|
|
|
@ -68,7 +68,7 @@ const rgbToHsl: ColorProcessingFunc<HSL> = (rIN, gIN, bIN) => {
|
|
|
|
export const hslToRgb: ColorProcessingFunc<RGB> = (h, s, l) => {
|
|
|
|
export const hslToRgb: ColorProcessingFunc<RGB> = (h, s, l) => {
|
|
|
|
// Нормализация
|
|
|
|
// Нормализация
|
|
|
|
const hue = ((h % DEGREES_IN_CIRCLE) + DEGREES_IN_CIRCLE) % DEGREES_IN_CIRCLE;
|
|
|
|
const hue = ((h % DEGREES_IN_CIRCLE) + DEGREES_IN_CIRCLE) % DEGREES_IN_CIRCLE;
|
|
|
|
const sat = clamp(s / PERCENT_FACTOR);
|
|
|
|
const sat = clamp(s / (PERCENT_FACTOR * 1.5));
|
|
|
|
const light = clamp(l / PERCENT_FACTOR);
|
|
|
|
const light = clamp(l / PERCENT_FACTOR);
|
|
|
|
|
|
|
|
|
|
|
|
const c = (1 - Math.abs(2 * light - 1)) * sat;
|
|
|
|
const c = (1 - Math.abs(2 * light - 1)) * sat;
|
|
|
|
|