@graphty/graphty-element / schema / colorDifference
Function: colorDifference() ​
colorDifference(
hex1,hex2):number
Defined in: graphty-element/src/utils/styleHelpers/accessibility/colorblindSimulation.ts:137
Calculate perceptual color difference (Delta E CIE76) Returns a value where:
- < 1.0 = Not perceptible
- 1-2 = Perceptible through close observation
- 2-10 = Perceptible at a glance
- > 10 = Colors are very different
Parameters ​
hex1 ​
string
First hex color string to compare
hex2 ​
string
Second hex color string to compare
Returns ​
number
Perceptual difference value (0-100+ scale)