delta_e
result = delta_e(a, b)
Input: a, b · Output: result
What it is
Compares colours a and b (each any accepted colour string) in CIE76 Lab space and returns a single number: the perceptual distance. Under 1 is invisible, 2–3 is where people start to notice, over 10 is plainly a different colour.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = delta_e(a, b) | a string or numbernot documented yetb string or numbernot documented yet | result scalar or Num | Returns a scalar Num. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
print(palette(5))
print(to_hsv("royalblue"))
print(delta_e("royalblue", "crimson"))
print(hsv(210, 0.7, 0.9))
print(hsl(210, 0.7, 0.5))
print(lab(50, 20, -30))
print(cmyk(0.1, 0.2, 0, 0.05))
print(rgb(65, 105, 225))
print(rgba(255, 0, 0, 0.5))
print(to_rgb("royalblue"))
print(to_hsl("royalblue"))
print(to_lab("royalblue"))
print(to_cmyk("royalblue"))
("#4c7fc7", "#ac4cc7", "#c74c4e", "#b0c74c", "#4cc77b")
[225, 0.711111, 0.882353]
108.484687
#4595e6
#2680d9
#7f6daa
#dac2f2
#4169e1
#ff000080
[65, 105, 225]
[225, 0.727273, 0.568627]
[47.830074, 26.263097, -65.263665]
[0.711111, 0.533333, 0, 0.117647]from plotting
How it works
delta_e(a, b) — how different two colours LOOK, as opposed to how different their numbers are. Under 1 is invisible, 2-3 is where people start to notice, over 10 is plainly different. The check to run before claiming two series are distinguishable.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.