Skip to content

Function: shade() ​

ts
function shade(hex, weight): string;

Mixes a hex color with black by weight (0–1) to produce a shade.

Parameters ​

ParameterType
hexstring
weightnumber

Returns ​

string

Example ​

ts
shade('#336699', 0.5) // => '#1a334c'

Since ​

1.0.0

Released under the MIT License.