Skip to content

Function: darken()

ts
function darken(hex, amount): string;

Darkens a hex color by decreasing its HSL lightness by amount percent.

Parameters

ParameterType
hexstring
amountnumber

Returns

string

Example

ts
darken('#336699', 20) // => '#112244'

Since

1.0.0

Released under the MIT License.