darken
Commons
stable
Darkens an RGBA colour by reducing its CIE L* lightness in CIELAB space by amount × 10. Returns the modified RGBA without mutating the input.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- valuerequiredTRGBA
- The source colour as an RGBA tuple [r, g, b, a] with channels in [0, 255] except alpha in [0, 1].
- amountrequirednumber
- The darkening step. Each unit reduces L* by 10. Use values between 0.5 and 3 for typical tonal shifts.
API
Return value
The value returned by this util.
- A new RGBA tuple with the reduced lightness. The original is not mutated.
Usage
Examples
Ready-to-paste usage snippets.
Darken a primary colour