Skip to main content

lighten

function

Lighten a color by a percentage. Works in HSL space for perceptually uniform results.

function lighten(color: string, amount: number): string

Import

import { lighten } from '@modular/sdk/theme';

Notes

returns
The lightened color as hex or rgba string
throws
Error if the color format is invalid or amount is out of range
example
```ts lighten('#000000', 50) // => '#808080' lighten('#0000ff', 30) // => '#4d4dff' ```