Skip to content

Function: discreteColormap()

ts
function discreteColormap(spec, steps): (t) => RGB;

Defined in: color/colormap.ts:237

Quantize a colormap into steps flat bands — useful when readers must match a colour back to a legend entry rather than judge a continuous shade.

Parameters

ParameterType
specColormapSpec
stepsnumber

Returns

(t) => RGB

MIT licensed. WebGL2 required.