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

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

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

API

Valeur de retour

La valeur retournée par cet util.

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

Usage

Exemples

Extraits de code prêts à coller.

Lighten a color by 2 steps

typescript