lighten
Lighten a color by moving its OKLCH lightness toward white by a fraction of the remaining distance: l + amount * (1 - l), clamped to [0, 1]. Chroma, hue and alpha are unchanged, and the result is not gamut mapped.
import { lighten } from '@pbroom/color-kit';index.ts:27function lighten( color: Color, , amount: number,): Color;Parameters
- amount
number - Fraction of the distance to white (
0-1)
Returns
ColorA new Color
Example
import { lighten, parse } from '@pbroom/color-kit';
lighten(parse('oklch(0.6 0.1 250)'), 0.5); // → { l: 0.8, c: 0.1, h: 250, alpha: 1 }