Skip to content

Function: complement() ​

ts
function complement(hex): string;

Returns the complementary color (hue rotated 180°) of a hex color.

Parameters ​

ParameterType
hexstring

Returns ​

string

Example ​

ts
complement('#336699') // => '#993366'

Since ​

1.0.0

Released under the MIT License.