@jsvision/core / darken
Function: darken()
darken(
color,amount):Color
Defined in: color/ramp.ts:153
Darken a color by lowering its OKLab lightness.
The perceptual counterpart of lighten; hue and chroma stay put, L is clamped to [0,1].
Parameters
color
A resolvable color — not 'default'.
amount
number
OKLab-lightness decrease, 0..1 (e.g. 0.2 for a pressed state).
Returns
The darkened color as #rrggbb.
Throws
InvalidColorError when color is unresolvable.
Example
ts
import { darken } from '@jsvision/core';
darken('#3b82f6', 0.2); // a darker blue, same hue