Skip to content

Function: registerColormap()

ts
function registerColormap(name, stops): void;

Defined in: color/colormap.ts:151

Register a custom colormap under name, so it can be used anywhere a colormap name is accepted — plot.addHeatmap({ …, colormap: "brand" }). Anchors are evenly spaced and linearly interpolated; pass [r,g,b] triples in 0..1 or CSS hex strings. Re-registering a name replaces it.

Parameters

ParameterType
namestring
stopsreadonly (string | RGB)[]

Returns

void

MIT licensed. WebGL2 required.