Skip to content

pantoken-root / plugins/pantoken/custom-theme-colors/src / deriveScale

Function: deriveScale() ​

deriveScale(hex, curve): CustomColorScale

Beta

Derive a full primitive scale from one hex: anchor it at the step with the nearest reference lightness, then rebuild every step at its reference lightness with the input's hue and a chroma scaled by the reference shape.

Parameters ​

hex ​

string

A hex color accepted by parseHexColor.

curve ​

ReferenceCurve

Output of buildReferenceCurve.

Returns ​

CustomColorScale

The CustomColorScale.