(hex: string, satMod: number)
| 90 | * Multiplies the S channel of HSL. |
| 91 | */ |
| 92 | export function applySatMod(hex: string, satMod: number): string { |
| 93 | const { r, g, b } = hexToRgb(hex) |
| 94 | const { h, s, l } = rgbToHsl(r, g, b) |
| 95 | const newS = Math.max(0, Math.min(1, s * (satMod / 100000))) |
| 96 | const rgb = hslToRgb(h, newS, l) |
| 97 | return rgbToHex(rgb.r, rgb.g, rgb.b) |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Apply hue modulation. |
no test coverage detected