A colormap should encode data value as a monotonic ramp of perceived lightness — otherwise a viewer's eye reads brightness changes as data features that are not really there. Perceived lightness is computed by converting each colormap color from sRGB to CIE L*a*b*, the color space designed to match human perception:
linear = srgb<=0.04045 ? srgb/12.92 : ((srgb+0.055)/1.055)^2.4
Y = 0.2127·Rlin + 0.7152·Glin + 0.0722·Blin (relative luminance)
L* = 116·f(Y) − 16, f(t)=∛t for t>0.008856
Perceptual uniformity samples L* at 64 points across the colormap and measures how consistent the step-to-step change in L* is (low spread in dL* = a fair ramp). Jet famously plateaus through its green/yellow band and has a bright cyan and bright yellow flanking a darker green — the same L* value appears twice, which is why jet plots show a false "ridge" that isn't in the data. Viridis was designed by construction to keep dL*/dt nearly constant.
Colorblindness simulation applies a linearized Brettel/Machado-style 3×3 matrix to linear RGB before converting back to sRGB — this approximates what a deuteranope or protanope perceives. The distinguishability lost readout compares the average perceptual step size (CIE76 ΔE in L*a*b*) between adjacent colormap samples with and without the simulated deficiency — a colormap that leans on red/green contrast (like jet) loses far more of its signal than one built mostly from a lightness ramp (like viridis).
- Colormap — recolors the terrain by height using the selected function.
- Vision simulation — recolors the same terrain as a deuteranope/protanope would perceive it.
- Terrain features / Noise — reshapes the underlying data (Gaussian bumps + smooth noise) so you can see the same colormap on different data.
Real-world relevance: this is the exact reason NASA, matplotlib and most scientific-plotting guides retired "jet" as a default colormap in favor of viridis-family maps — and why dashboards built for color-vision-deficient viewers should avoid pure red/green encoding.