Skip to content

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

Fušla: deriveScale() ​

deriveScale(hex, curve): CustomColorScale

Behta

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.

Parametera ​

hex ​

string

A hex color accepted by parseHexColor.

curve ​

ReferenceCurve

Output of buildReferenceCurve.

Gullii / Gávdnat ​

CustomColorScale

The CustomColorScale.