LAB/HCL and array interpolation
The common evaluator for ordinary paint/filter expressions supports these forms in native libraries, desktop scripts and browser main/Worker hosts.
| Operator | Output |
|---|---|
| interpolate | Numbers, sRGB colours or equal-length numeric/colour arrays |
| interpolate-lab | CIE Lab D50 colours or equal-length colour arrays |
| interpolate-hcl | HCL in the same Lab space; equal-length colour arrays and shorter hue path |
All three accept linear, exponential and cubic-bezier curves with strictly ordered stops. Out-of-range inputs use endpoints; exact stops preserve the original value. Use at to select an array component. Endpoints must have equal lengths and compatible element types; nested array interpolation is unsupported.
map.setPaintProperty('points', 'circle-color', [
'interpolate-lab', ['linear'], ['get', 'value'],
0, 'red', 1, 'lime'
]);
map.setPaintProperty('points', 'circle-radius', [
'at', 1, ['interpolate', ['linear'], ['get', 'value'],
0, ['literal', [10, 20]], 1, ['literal', [30, 40]]]
]);
await map.sqs.flush({ render: true });
SqsMap independently implements sRGB linearization, XYZ, Bradford D65→D50, CIE Lab and inverse conversion. Neutral HCL endpoints borrow the other hue; hue follows the shorter path. Alpha interpolates separately without premultiplication. Results clip to sRGB and quantize to byte channels; CSS advanced gamut mapping and MapLibre internal Color values are not claimed. Red/lime gives #c8ac00 and black/white gives #777777 at the midpoint, independently checked against browser Lab conversion.
Array scans consume the 8192-step budget. Invalid static types/curves/stops reject before mutation; invalid dynamic colours/arrays use paint defaults/warnings. Dedicated heatmap-density/elevation colour ramps retain their separately documented support.
The complete HTML exposes sRGB/Lab/HCL/input controls with all handlers/data/credits. The shared script covers nine checks.
Syntax follows the public MapLibre specification; colour mathematics follows the W3C conversion description. Mobile devices, other systems and formal releases are recorded separately.