@pbroom/color-kitManipulation

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.

functionimport { lighten } from '@pbroom/color-kit';index.ts:27
function lighten(  color: Color, ,  amount: number,): Color;

Parameters

colorColor
Color to lighten
amountnumber
Fraction of the distance to white (0-1)

Returns

ColorA new Color

Example

TypeScript
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 }

See also