Skip to content

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

函数: deriveScale() ​

deriveScale(hex, curve): CustomColorScale

Beta

从单个十六进制颜色派生完整的原语色阶:将其锚定到参考明度最接近的步骤,然后以输入色相和由参考形状缩放的色度在每个步骤的参考明度处重建每一步。

参数 ​

hex ​

string

被 [parseHexColor]((parseHexColor.md)接受的十六进制颜色。

curve ​

ReferenceCurve

buildReferenceCurve 的输出。

返回值 ​

CustomColorScale

参见 [CustomColorScale]((../interfaces/CustomColorScale.md)。