Documentation / @ripl/core / ColorScale
Interface: ColorScale() ​
Defined in: packages/core/src/color/scales.ts:21
A callable color scale mapping a numeric value to a CSS color, with domain and tick access.
ColorScale(
value):string
Defined in: packages/core/src/color/scales.ts:23
Maps a numeric value from the domain to its corresponding CSS color.
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:25 |
interpolator | ColorInterpolator | The underlying position (0–1) → color interpolator, e.g. for rendering a legend gradient. | packages/core/src/color/scales.ts:29 |
Methods ​
ticks() ​
ticks(
count?):number[]
Defined in: packages/core/src/color/scales.ts:27
Generates approximately count representative tick values across the domain.
Parameters ​
| Parameter | Type |
|---|---|
count? | number |
Returns ​
number[]