(hex: string, lumMod: number)
| 64 | * Multiplies the L channel of HSL. |
| 65 | */ |
| 66 | export function applyLumMod(hex: string, lumMod: number): string { |
| 67 | const { r, g, b } = hexToRgb(hex) |
| 68 | const { h, s, l } = rgbToHsl(r, g, b) |
| 69 | const newL = Math.max(0, Math.min(1, l * (lumMod / 100000))) |
| 70 | const rgb = hslToRgb(h, s, newL) |
| 71 | return rgbToHex(rgb.r, rgb.g, rgb.b) |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Apply luminance offset. |
no test coverage detected