Skip to content

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

फंक्शन: deriveCustomColorScale() ​

deriveCustomColorScale(hex, tokens?): CustomColorScale

बीटा

Derive the custom प्रिमिटिव स्केल एक ब्रांड हेक्स से। इनपुट उस चरण पर एंकर किया जाता है जिसका reference lightness (13 भेजी गई परिवारों की औसत OKLCH लाइटनेस)) उसके अपने के सबसे नज़दीक है, फिर हर चरण को उसके reference lightness पर इनपुट के hue के साथ पुनर्निर्मित किया जाता है — इसलिए एंकर चरण इनपुट के काफी करीब उतरता है, पर जरूरी नहीं कि बिल्कुल उसी पर।

पैरामीटर ​

hex ​

string

A #rgb/#rrggbb ब्रांड रंग।

tokens? ​

केवल-पढ़ने Token[]

प्रिमिटिव स्टेप रंग मानों को हल करने के लिए वैकल्पिक टोकन एरे या मैप।

वापसी ​

CustomColorScale

The CustomColorScale.

थ्रो करता है ​

TypeError जब hex एक मान्य हेक्स रंग नहीं है।