Skip to main content

Function: createMultiHueSequentialScale()

createMultiHueSequentialScale(options): MultiHueSequentialScale

Creates a multi-hue sequential color scale.

This function generates a color scale that smoothly transitions through multiple colors. It's useful for representing continuous data with multiple stages or phases.

Parameters

ParameterTypeDescription
optionsMultiHueSequentialScaleOptionsThe options for creating the multi-hue sequential scale.

Returns

MultiHueSequentialScale

A MultiHueSequentialScale (array of Color objects) representing the multi-hue sequential scale.

Example

const scale = createMultiHueSequentialScale({
colorStops: [
new Color('#ff0000'), // Red
new Color('#00ff00'), // Green
new Color('#0000ff') // Blue
],
steps: 10
});
// Returns an array of 10 Color objects transitioning from red to green to blue

Throws

If fewer than two color stops are provided or if steps is less than 2.

Defined in

scales/components/multi-hue-sequential-scale.ts:25