lighten

Commons
stable

Lightens an RGBA color by the given amount using CIE-Lab L* adjustment (via XYZ intermediate). Each unit of amount raises L* by 10.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

value
required
TRGBA
The base color as an RGBA object { r, g, b, a? } (channel values 0–255).
amount
required
number
Lightness step. Each unit raises the CIE-Lab L* channel by 10. Negative values darken the color.

API

Return value

The value returned by this util.

A new TRGBA object with the adjusted lightness. The original object is not mutated.

Usage

Examples

Ready-to-paste usage snippets.

Lighten a color by 2 steps

typescript