Documentation / @ripl/core / ColorScale
Interface: ColorScale()
Defined in: packages/core/src/color/scales.ts:24
A callable colour scale mapping a numeric value to a CSS colour, with domain and tick access.
ColorScale(
value):string
Defined in: packages/core/src/color/scales.ts:26
Maps a numeric value from the domain to its corresponding CSS colour.
Parameters
| Parameter | Type |
|---|---|
value | number |
Returns
string
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
domain | number[] | The numeric input domain the scale maps from. | packages/core/src/color/scales.ts:28 |
interpolator | ColorInterpolator | The underlying position (0–1) → colour interpolator, e.g. for rendering a legend gradient. | packages/core/src/color/scales.ts:32 |
Methods
ticks()
ticks(
count?):number[]
Defined in: packages/core/src/color/scales.ts:30
Generates approximately count representative tick values across the domain.
Parameters
| Parameter | Type |
|---|---|
count? | number |
Returns
number[]