(hex: string, lumOff: number)
| 77 | * Adds to the L channel of HSL. |
| 78 | */ |
| 79 | export function applyLumOff(hex: string, lumOff: number): string { |
| 80 | const { r, g, b } = hexToRgb(hex) |
| 81 | const { h, s, l } = rgbToHsl(r, g, b) |
| 82 | const newL = Math.max(0, Math.min(1, l + lumOff / 100000)) |
| 83 | const rgb = hslToRgb(h, s, newL) |
| 84 | return rgbToHex(rgb.r, rgb.g, rgb.b) |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Apply saturation modulation. |
no test coverage detected