Skip to content

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 ​

ParameterType
valuenumber

Returns ​

string

Properties ​

PropertyTypeDescriptionDefined in
domainnumber[]The numeric input domain the scale maps from.packages/core/src/color/scales.ts:25
interpolatorColorInterpolatorThe 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 ​

ParameterType
count?number

Returns ​

number[]