Theming
/ API Reference / Color Manipulation
Theming
/ API Reference / Color Manipulation

lighten

A small utility function that lightens a CSS color value by a relative amount.
It uses the hsl color model to do so.

The Gist

import { lighten } from '@weser/theming'

const lighterRed = lighten('red', 0.5)
const lighterVariable = lighten('var(--background)', 0.5)

Parameters

ParameterTypeDescription
valuestringThe CSS color value to apply the alpha to.
amount0-1The relative amount to lighten the color.

Returns

(string) A string that references a CSS color value with with a lightened channel applied.

On this page