Theme
/ API Reference / Color Manipulation
Theme
/ API Reference / Color Manipulation

saturate

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

The Gist

import { saturate } from '@weser/theme'

const moreSaturated = saturate('red', 0.2)
const saturatedVariable = saturate('var(--background)', 0.5)

Parameters

ParameterTypeDescription
valuestringThe CSS color value to increase the saturation.
amount0-1The relative amount to increase the saturation.

Returns

(string) A string that references a CSS color value with the saturation increased.

On this page