Function: registerColorscale()
ts
function registerColorscale(name, scale): () => void;Register a named colorscale (replacing any scale of the same name, case-insensitively). Returns a function that unregisters it.
Parameters
| Parameter | Type |
|---|---|
name | string |
scale | ColorscaleInput |
Returns
() => void
Example
ts
colors.register('Brand', ['#0b1f3a', '#1d6fa5', '#9ad0ec']);
colors.register('Traffic', [
[0, 'green'],
[0.5, 'gold'],
[1, 'red'],
]);
// then: marker: { color: values, colorscale: 'Brand' } (or 'Brand_r')