PitchKit
API Reference@pitchkit/coreFunctions

createColorScale()

function createColorScale(
   minValue, 
   maxValue, 
   colorMin, 
   colorMax
): (value) => string;

Defined in: packages/core/src/heatmap/colormap.ts:25

Builds a value -> color function that linearly interpolates between two 6-digit hex colors across [minValue, maxValue]. Hand-rolled rather than a colormap dependency, to preserve @pitchkit/core's zero-runtime-dependency invariant. Values outside the domain are clamped to the nearest end color.

Parameters

ParameterType
minValuenumber
maxValuenumber
colorMinstring
colorMaxstring

Returns

(value) => string

On this page