Skip to content

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

Fušla: deriveCustomColorScale() ​

deriveCustomColorScale(hex, tokens?): CustomColorScale

Behta

Derive the custom primitive scale from a brand hex. The input is anchored at the step whose reference lightness (the mean OKLCH lightness of the 13 shipped families) is nearest its own, then every step is rebuilt at its reference lightness with the input's hue — so the anchor step lands close to, but not necessarily exactly on, the input.

Parametera ​

hex ​

string

A #rgb/#rrggbb brand color.

tokens? ​

ruvvojuvvon Token[]

Valjáleaš token-massiivva dahje mapa primitiva steppa fargga válditvuođaid ráhkistusas gávdnojuvvon.

Gullii / Gávdnat ​

CustomColorScale

The CustomColorScale.

Heakserii / Geahččat ​

TypeError when hex isn't a valid hex color.