This attempts to measure the perceptual uniformity of three rainbow color scales by computing the CIE76 color difference at various points along the scale. The flatness of the curve, not its absolute value, shows the uniformity of each scale. The HCL rainbow is perfectly flat by definition. Cubehelix is better than HSL, but is not uniform.
It would be better to use CIEDE2000 to compute the difference, but I’m lazy.
forked from mbostock's block: Rainbow Perceptual Distance
https://d3js.org/d3.v4.0.0-alpha.29.min.js