Skip to content

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

ParameterType
valuenumber

Returns

string

Properties

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

ParameterType
count?number

Returns

number[]