Skip to content

Function: invert() ​

ts
function invert(hex): string;

Inverts a hex color by subtracting each channel from 255.

Parameters ​

ParameterType
hexstring

Returns ​

string

Example ​

ts
invert('#336699') // => '#cc9966'

Since ​

1.0.0

Released under the MIT License.