Skip to main content

compareHEXColorsViaHSL()

function compareHEXColorsViaHSL(
color1,
color2,
tolerance): boolean

Compares two hex colors via HSL

Parameters

ParameterTypeDefault valueDescription
color1`#${string}`undefinedThe first hex color
color2`#${string}`undefinedThe second hex color
tolerancenumber10The tolerance for the comparison

Returns

boolean

True if the colors are similar, false otherwise

Example

compareHEXColorsViaHSL('#FF0000', '#00FF00'); // false

Defined in

hsl/hsl.ts:98