(color: HexColor, amount: number)
| 286 | } |
| 287 | |
| 288 | export function darken(color: HexColor, amount: number): HexColor { |
| 289 | const oklch = hexToOklch(color) |
| 290 | return oklchToHex({ |
| 291 | ...oklch, |
| 292 | l: clamp(oklch.l - amount, 0, 1), |
| 293 | }) |
| 294 | } |
| 295 | |
| 296 | export function withAlpha(color: HexColor, alpha: number): string { |
| 297 | const { r, g, b } = hexToRgb(color) |
nothing calls this directly
no test coverage detected