@umijs/utils 3.5.18 → 4.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/compiled/address/index.js +1 -0
- package/compiled/address/lib/address.d.ts +28 -0
- package/compiled/address/package.json +1 -0
- package/compiled/axios/LICENSE +19 -0
- package/compiled/axios/index.d.ts +206 -0
- package/compiled/axios/index.js +1 -0
- package/compiled/axios/package.json +1 -0
- package/compiled/chalk/LICENSE +9 -0
- package/compiled/chalk/index.d.ts +415 -0
- package/compiled/chalk/index.js +1 -0
- package/compiled/chalk/package.json +1 -0
- package/compiled/cheerio/LICENSE +21 -0
- package/compiled/cheerio/domelementtype/lib/index.d.ts +48 -0
- package/compiled/cheerio/domhandler/lib/index.d.ts +85 -0
- package/compiled/cheerio/domhandler/lib/node.d.ts +169 -0
- package/compiled/cheerio/htmlparser2/lib/Parser.d.ts +159 -0
- package/compiled/cheerio/htmlparser2/lib/Tokenizer.d.ts +182 -0
- package/compiled/cheerio/htmlparser2/lib/index.d.ts +39 -0
- package/compiled/cheerio/index.js +16 -0
- package/compiled/cheerio/lib/api/attributes.d.ts +317 -0
- package/compiled/cheerio/lib/api/css.d.ts +41 -0
- package/compiled/cheerio/lib/api/forms.d.ts +31 -0
- package/compiled/cheerio/lib/api/manipulation.d.ts +496 -0
- package/compiled/cheerio/lib/api/traversing.d.ts +644 -0
- package/compiled/cheerio/lib/cheerio.d.ts +53 -0
- package/compiled/cheerio/lib/index.d.ts +91 -0
- package/compiled/cheerio/lib/load.d.ts +73 -0
- package/compiled/cheerio/lib/options.d.ts +31 -0
- package/compiled/cheerio/lib/static.d.ts +88 -0
- package/compiled/cheerio/lib/types.d.ts +20 -0
- package/compiled/cheerio/package.json +1 -0
- package/compiled/color/LICENSE +21 -0
- package/compiled/color/color-convert/conversions.d.ts +149 -0
- package/compiled/color/color-convert/index.d.ts +113 -0
- package/compiled/color/color-convert/route.d.ts +294 -0
- package/compiled/color/color-name/index.d.ts +161 -0
- package/compiled/color/index.d.ts +142 -0
- package/compiled/color/index.js +1 -0
- package/compiled/color/package.json +4 -0
- package/compiled/cross-spawn/LICENSE +21 -0
- package/compiled/cross-spawn/index.d.ts +36 -0
- package/compiled/cross-spawn/index.js +1 -0
- package/compiled/cross-spawn/package.json +1 -0
- package/compiled/debug/LICENSE +19 -0
- package/compiled/debug/index.d.ts +54 -0
- package/compiled/debug/index.js +1 -0
- package/compiled/debug/ms/index.d.ts +25 -0
- package/compiled/debug/package.json +1 -0
- package/compiled/deepmerge/index.d.ts +16 -0
- package/compiled/deepmerge/index.js +1 -0
- package/compiled/deepmerge/package.json +1 -0
- package/compiled/execa/LICENSE +9 -0
- package/compiled/execa/index.d.ts +564 -0
- package/compiled/execa/index.js +1 -0
- package/compiled/execa/package.json +1 -0
- package/compiled/fs-extra/LICENSE +15 -0
- package/compiled/fs-extra/index.d.ts +332 -0
- package/compiled/fs-extra/index.js +1 -0
- package/compiled/fs-extra/package.json +1 -0
- package/compiled/glob/LICENSE +21 -0
- package/compiled/glob/index.d.ts +89 -0
- package/compiled/glob/index.js +1 -0
- package/compiled/glob/minimatch/index.d.ts +204 -0
- package/compiled/glob/package.json +1 -0
- package/compiled/import-lazy/LICENSE +9 -0
- package/compiled/import-lazy/index.d.ts +26 -0
- package/compiled/import-lazy/index.js +1 -0
- package/compiled/import-lazy/package.json +1 -0
- package/compiled/lodash/LICENSE +47 -0
- package/compiled/lodash/common/array.d.ts +2126 -0
- package/compiled/lodash/common/collection.d.ts +1930 -0
- package/compiled/lodash/common/common.d.ts +280 -0
- package/compiled/lodash/common/date.d.ts +23 -0
- package/compiled/lodash/common/function.d.ts +1430 -0
- package/compiled/lodash/common/lang.d.ts +1692 -0
- package/compiled/lodash/common/math.d.ts +405 -0
- package/compiled/lodash/common/number.d.ts +131 -0
- package/compiled/lodash/common/object.d.ts +2519 -0
- package/compiled/lodash/common/seq.d.ts +210 -0
- package/compiled/lodash/common/string.d.ts +788 -0
- package/compiled/lodash/common/util.d.ts +1219 -0
- package/compiled/lodash/index.d.ts +46 -0
- package/compiled/lodash/index.js +9 -0
- package/compiled/lodash/package.json +1 -0
- package/compiled/mustache/LICENSE +11 -0
- package/compiled/mustache/index.d.ts +437 -0
- package/compiled/mustache/index.js +5 -0
- package/compiled/mustache/package.json +1 -0
- package/compiled/pkg-up/LICENSE +9 -0
- package/compiled/pkg-up/index.d.ts +48 -0
- package/compiled/pkg-up/index.js +1 -0
- package/compiled/pkg-up/package.json +1 -0
- package/compiled/portfinder/LICENSE +22 -0
- package/compiled/portfinder/index.js +1 -0
- package/compiled/portfinder/lib/portfinder.d.ts +47 -0
- package/compiled/portfinder/package.json +1 -0
- package/compiled/prettier/LICENSE +7 -0
- package/compiled/prettier/index.d.ts +756 -0
- package/compiled/prettier/index.js +263 -0
- package/compiled/prettier/package.json +1 -0
- package/compiled/prompts/LICENSE +21 -0
- package/compiled/prompts/index.d.ts +120 -0
- package/compiled/prompts/index.js +1 -0
- package/compiled/prompts/package.json +1 -0
- package/compiled/resolve/LICENSE +21 -0
- package/compiled/resolve/index.d.ts +166 -0
- package/compiled/resolve/index.js +1 -0
- package/compiled/resolve/package.json +1 -0
- package/compiled/rimraf/LICENSE +15 -0
- package/compiled/rimraf/glob/index.d.ts +89 -0
- package/compiled/rimraf/index.d.ts +49 -0
- package/compiled/rimraf/index.js +1 -0
- package/compiled/rimraf/minimatch/index.d.ts +204 -0
- package/compiled/rimraf/package.json +1 -0
- package/compiled/semver/LICENSE +15 -0
- package/compiled/semver/classes/comparator.d.ts +17 -0
- package/compiled/semver/classes/range.d.ts +21 -0
- package/compiled/semver/classes/semver.d.ts +62 -0
- package/compiled/semver/functions/clean.d.ts +8 -0
- package/compiled/semver/functions/cmp.d.ts +16 -0
- package/compiled/semver/functions/coerce.d.ts +12 -0
- package/compiled/semver/functions/compare-build.d.ts +16 -0
- package/compiled/semver/functions/compare-loose.d.ts +5 -0
- package/compiled/semver/functions/compare.d.ts +20 -0
- package/compiled/semver/functions/diff.d.ts +13 -0
- package/compiled/semver/functions/eq.d.ts +9 -0
- package/compiled/semver/functions/gt.d.ts +9 -0
- package/compiled/semver/functions/gte.d.ts +9 -0
- package/compiled/semver/functions/inc.d.ts +15 -0
- package/compiled/semver/functions/lt.d.ts +9 -0
- package/compiled/semver/functions/lte.d.ts +8 -0
- package/compiled/semver/functions/major.d.ts +9 -0
- package/compiled/semver/functions/minor.d.ts +9 -0
- package/compiled/semver/functions/neq.d.ts +9 -0
- package/compiled/semver/functions/parse.d.ts +12 -0
- package/compiled/semver/functions/patch.d.ts +9 -0
- package/compiled/semver/functions/prerelease.d.ts +12 -0
- package/compiled/semver/functions/rcompare.d.ts +15 -0
- package/compiled/semver/functions/rsort.d.ts +9 -0
- package/compiled/semver/functions/satisfies.d.ts +14 -0
- package/compiled/semver/functions/sort.d.ts +9 -0
- package/compiled/semver/functions/valid.d.ts +11 -0
- package/compiled/semver/index.d.ts +133 -0
- package/compiled/semver/index.js +1 -0
- package/compiled/semver/internals/identifiers.d.ts +13 -0
- package/compiled/semver/package.json +1 -0
- package/compiled/semver/ranges/gtr.d.ts +14 -0
- package/compiled/semver/ranges/intersects.d.ts +13 -0
- package/compiled/semver/ranges/ltr.d.ts +14 -0
- package/compiled/semver/ranges/max-satisfying.d.ts +14 -0
- package/compiled/semver/ranges/min-satisfying.d.ts +14 -0
- package/compiled/semver/ranges/min-version.d.ts +10 -0
- package/compiled/semver/ranges/outside.d.ts +15 -0
- package/compiled/semver/ranges/simplify.d.ts +14 -0
- package/compiled/semver/ranges/subset.d.ts +13 -0
- package/compiled/semver/ranges/to-comparators.d.ts +9 -0
- package/compiled/semver/ranges/valid.d.ts +12 -0
- package/compiled/strip-ansi/LICENSE +9 -0
- package/compiled/strip-ansi/index.d.ts +17 -0
- package/compiled/strip-ansi/index.js +1 -0
- package/compiled/strip-ansi/package.json +1 -0
- package/compiled/yargs-parser/index.d.ts +112 -0
- package/compiled/yargs-parser/index.js +1 -0
- package/compiled/yargs-parser/package.json +1 -0
- package/dist/BaseGenerator/BaseGenerator.d.ts +18 -0
- package/dist/BaseGenerator/BaseGenerator.js +58 -0
- package/dist/BaseGenerator/generateFile.d.ts +8 -0
- package/dist/BaseGenerator/generateFile.js +25 -0
- package/{lib → dist}/Generator/Generator.d.ts +3 -3
- package/dist/Generator/Generator.js +74 -0
- package/dist/importLazy.d.ts +6 -0
- package/dist/importLazy.js +17 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +88 -0
- package/dist/installDeps.d.ts +9 -0
- package/dist/installDeps.js +39 -0
- package/dist/logger.d.ts +14 -0
- package/dist/logger.js +39 -0
- package/dist/npmClient.d.ts +15 -0
- package/dist/npmClient.js +43 -0
- package/dist/randomColor/randomColor.d.ts +6 -0
- package/dist/randomColor/randomColor.js +19 -0
- package/dist/register.d.ts +6 -0
- package/dist/register.js +48 -0
- package/dist/updatePackageJSON.d.ts +5 -0
- package/dist/updatePackageJSON.js +21 -0
- package/dist/winPath.d.ts +1 -0
- package/dist/winPath.js +11 -0
- package/package.json +102 -18
- package/lib/BabelRegister/BabelRegister.d.ts +0 -9
- package/lib/BabelRegister/BabelRegister.js +0 -66
- package/lib/Generator/Generator.js +0 -120
- package/lib/cheerio/cheerio.d.ts +0 -2
- package/lib/cheerio/cheerio.js +0 -37
- package/lib/cleanRequireCache/cleanRequireCache.d.ts +0 -1
- package/lib/cleanRequireCache/cleanRequireCache.js +0 -40
- package/lib/compatESModuleRequire/compatESModuleRequire.d.ts +0 -7
- package/lib/compatESModuleRequire/compatESModuleRequire.js +0 -22
- package/lib/delay/delay.d.ts +0 -1
- package/lib/delay/delay.js +0 -22
- package/lib/getFile/getFile.d.ts +0 -22
- package/lib/getFile/getFile.js +0 -85
- package/lib/index.d.ts +0 -66
- package/lib/index.js +0 -619
- package/lib/isLernaPackage/isLernaPackage.d.ts +0 -1
- package/lib/isLernaPackage/isLernaPackage.js +0 -42
- package/lib/mergeConfig/mergeConfig.d.ts +0 -8
- package/lib/mergeConfig/mergeConfig.js +0 -42
- package/lib/parseRequireDeps/parseRequireDeps.d.ts +0 -1
- package/lib/parseRequireDeps/parseRequireDeps.js +0 -98
- package/lib/randomColor/randomColor.d.ts +0 -6
- package/lib/randomColor/randomColor.js +0 -42
- package/lib/routes.d.ts +0 -11
- package/lib/routes.js +0 -53
- package/lib/ssr.d.ts +0 -12
- package/lib/ssr.js +0 -41
- package/lib/types.d.ts +0 -7
- package/lib/types.js +0 -17
- package/lib/winEOL/winEOL.d.ts +0 -7
- package/lib/winEOL/winEOL.js +0 -39
- package/lib/winPath/winPath.d.ts +0 -1
- package/lib/winPath/winPath.js +0 -28
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ANSI16,
|
|
3
|
+
ANSI256,
|
|
4
|
+
APPLE,
|
|
5
|
+
CMYK,
|
|
6
|
+
GRAY,
|
|
7
|
+
HCG,
|
|
8
|
+
HEX,
|
|
9
|
+
HSL,
|
|
10
|
+
HSV,
|
|
11
|
+
HWB,
|
|
12
|
+
KEYWORD,
|
|
13
|
+
LAB,
|
|
14
|
+
LCH,
|
|
15
|
+
RGB,
|
|
16
|
+
XYZ,
|
|
17
|
+
} from './conversions';
|
|
18
|
+
|
|
19
|
+
declare namespace route {
|
|
20
|
+
interface rgb {
|
|
21
|
+
hsl(from: RGB): HSL;
|
|
22
|
+
hsl(...from: RGB): HSL;
|
|
23
|
+
hsl(from: RGB): HSL;
|
|
24
|
+
hsl(...from: RGB): HSL;
|
|
25
|
+
hsv(from: RGB): HSV;
|
|
26
|
+
hsv(...from: RGB): HSV;
|
|
27
|
+
hwb(from: RGB): HWB;
|
|
28
|
+
hwb(...from: RGB): HWB;
|
|
29
|
+
cmyk(from: RGB): CMYK;
|
|
30
|
+
cmyk(...from: RGB): CMYK;
|
|
31
|
+
xyz(from: RGB): XYZ;
|
|
32
|
+
xyz(...from: RGB): XYZ;
|
|
33
|
+
lab(from: RGB): LAB;
|
|
34
|
+
lab(...from: RGB): LAB;
|
|
35
|
+
lch(from: RGB): LCH;
|
|
36
|
+
lch(...from: RGB): LCH;
|
|
37
|
+
hex(from: RGB): HEX;
|
|
38
|
+
hex(...from: RGB): HEX;
|
|
39
|
+
keyword(from: RGB): KEYWORD;
|
|
40
|
+
keyword(...from: RGB): KEYWORD;
|
|
41
|
+
ansi16(from: RGB): ANSI16;
|
|
42
|
+
ansi16(...from: RGB): ANSI16;
|
|
43
|
+
ansi256(from: RGB): ANSI256;
|
|
44
|
+
ansi256(...from: RGB): ANSI256;
|
|
45
|
+
hcg(from: RGB): HCG;
|
|
46
|
+
hcg(...from: RGB): HCG;
|
|
47
|
+
apple(from: RGB): APPLE;
|
|
48
|
+
apple(...from: RGB): APPLE;
|
|
49
|
+
gray(from: RGB): GRAY;
|
|
50
|
+
gray(...from: RGB): GRAY;
|
|
51
|
+
}
|
|
52
|
+
interface hsl {
|
|
53
|
+
rgb(from: HSL): RGB;
|
|
54
|
+
hsv(from: HSL): HSV;
|
|
55
|
+
hwb(from: HSL): HWB;
|
|
56
|
+
cmyk(from: HSL): CMYK;
|
|
57
|
+
xyz(from: HSL): XYZ;
|
|
58
|
+
lab(from: HSL): LAB;
|
|
59
|
+
lch(from: HSL): LCH;
|
|
60
|
+
hex(from: HSL): HEX;
|
|
61
|
+
keyword(from: HSL): KEYWORD;
|
|
62
|
+
ansi16(from: HSL): ANSI16;
|
|
63
|
+
ansi256(from: HSL): ANSI256;
|
|
64
|
+
hcg(from: HSL): HCG;
|
|
65
|
+
apple(from: HSL): APPLE;
|
|
66
|
+
gray(from: HSL): GRAY;
|
|
67
|
+
}
|
|
68
|
+
interface hsv {
|
|
69
|
+
rgb(from: HSV): RGB;
|
|
70
|
+
hsl(from: HSV): HSL;
|
|
71
|
+
hwb(from: HSV): HWB;
|
|
72
|
+
cmyk(from: HSV): CMYK;
|
|
73
|
+
xyz(from: HSV): XYZ;
|
|
74
|
+
lab(from: HSV): LAB;
|
|
75
|
+
lch(from: HSV): LCH;
|
|
76
|
+
hex(from: HSV): HEX;
|
|
77
|
+
keyword(from: HSV): KEYWORD;
|
|
78
|
+
ansi16(from: HSV): ANSI16;
|
|
79
|
+
ansi256(from: HSV): ANSI256;
|
|
80
|
+
hcg(from: HSV): HCG;
|
|
81
|
+
apple(from: HSV): APPLE;
|
|
82
|
+
gray(from: HSV): GRAY;
|
|
83
|
+
}
|
|
84
|
+
interface hwb {
|
|
85
|
+
rgb(from: HWB): RGB;
|
|
86
|
+
hsl(from: HWB): HSL;
|
|
87
|
+
hsv(from: HWB): HSV;
|
|
88
|
+
cmyk(from: HWB): CMYK;
|
|
89
|
+
xyz(from: HWB): XYZ;
|
|
90
|
+
lab(from: HWB): LAB;
|
|
91
|
+
lch(from: HWB): LCH;
|
|
92
|
+
hex(from: HWB): HEX;
|
|
93
|
+
keyword(from: HWB): KEYWORD;
|
|
94
|
+
ansi16(from: HWB): ANSI16;
|
|
95
|
+
ansi256(from: HWB): ANSI256;
|
|
96
|
+
hcg(from: HWB): HCG;
|
|
97
|
+
apple(from: HWB): APPLE;
|
|
98
|
+
gray(from: HWB): GRAY;
|
|
99
|
+
}
|
|
100
|
+
interface cmyk {
|
|
101
|
+
rgb(from: CMYK): RGB;
|
|
102
|
+
hsl(from: CMYK): HSL;
|
|
103
|
+
hsv(from: CMYK): HSV;
|
|
104
|
+
hwb(from: CMYK): HWB;
|
|
105
|
+
xyz(from: CMYK): XYZ;
|
|
106
|
+
lab(from: CMYK): LAB;
|
|
107
|
+
lch(from: CMYK): LCH;
|
|
108
|
+
hex(from: CMYK): HEX;
|
|
109
|
+
keyword(from: CMYK): KEYWORD;
|
|
110
|
+
ansi16(from: CMYK): ANSI16;
|
|
111
|
+
ansi256(from: CMYK): ANSI256;
|
|
112
|
+
hcg(from: CMYK): HCG;
|
|
113
|
+
apple(from: CMYK): APPLE;
|
|
114
|
+
gray(from: CMYK): GRAY;
|
|
115
|
+
}
|
|
116
|
+
interface xyz {
|
|
117
|
+
rgb(from: XYZ): RGB;
|
|
118
|
+
hsl(from: XYZ): HSL;
|
|
119
|
+
hsv(from: XYZ): HSV;
|
|
120
|
+
hwb(from: XYZ): HWB;
|
|
121
|
+
cmyk(from: XYZ): CMYK;
|
|
122
|
+
lab(from: XYZ): LAB;
|
|
123
|
+
lch(from: XYZ): LCH;
|
|
124
|
+
hex(from: XYZ): HEX;
|
|
125
|
+
keyword(from: XYZ): KEYWORD;
|
|
126
|
+
ansi16(from: XYZ): ANSI16;
|
|
127
|
+
ansi256(from: XYZ): ANSI256;
|
|
128
|
+
hcg(from: XYZ): HCG;
|
|
129
|
+
apple(from: XYZ): APPLE;
|
|
130
|
+
gray(from: XYZ): GRAY;
|
|
131
|
+
}
|
|
132
|
+
interface lab {
|
|
133
|
+
rgb(from: LAB): RGB;
|
|
134
|
+
hsl(from: LAB): HSL;
|
|
135
|
+
hsv(from: LAB): HSV;
|
|
136
|
+
hwb(from: LAB): HWB;
|
|
137
|
+
cmyk(from: LAB): CMYK;
|
|
138
|
+
xyz(from: LAB): XYZ;
|
|
139
|
+
lch(from: LAB): LCH;
|
|
140
|
+
hex(from: LAB): HEX;
|
|
141
|
+
keyword(from: LAB): KEYWORD;
|
|
142
|
+
ansi16(from: LAB): ANSI16;
|
|
143
|
+
ansi256(from: LAB): ANSI256;
|
|
144
|
+
hcg(from: LAB): HCG;
|
|
145
|
+
apple(from: LAB): APPLE;
|
|
146
|
+
gray(from: LAB): GRAY;
|
|
147
|
+
}
|
|
148
|
+
interface lch {
|
|
149
|
+
rgb(from: LCH): RGB;
|
|
150
|
+
hsl(from: LCH): HSL;
|
|
151
|
+
hsv(from: LCH): HSV;
|
|
152
|
+
hwb(from: LCH): HWB;
|
|
153
|
+
cmyk(from: LCH): CMYK;
|
|
154
|
+
xyz(from: LCH): XYZ;
|
|
155
|
+
lab(from: LCH): LAB;
|
|
156
|
+
hex(from: LCH): HEX;
|
|
157
|
+
keyword(from: LCH): KEYWORD;
|
|
158
|
+
ansi16(from: LCH): ANSI16;
|
|
159
|
+
ansi256(from: LCH): ANSI256;
|
|
160
|
+
hcg(from: LCH): HCG;
|
|
161
|
+
apple(from: LCH): APPLE;
|
|
162
|
+
gray(from: LCH): GRAY;
|
|
163
|
+
}
|
|
164
|
+
interface hex {
|
|
165
|
+
rgb(from: HEX): RGB;
|
|
166
|
+
hsl(from: HEX): HSL;
|
|
167
|
+
hsv(from: HEX): HSV;
|
|
168
|
+
hwb(from: HEX): HWB;
|
|
169
|
+
cmyk(from: HEX): CMYK;
|
|
170
|
+
xyz(from: HEX): XYZ;
|
|
171
|
+
lab(from: HEX): LAB;
|
|
172
|
+
lch(from: HEX): LCH;
|
|
173
|
+
keyword(from: HEX): KEYWORD;
|
|
174
|
+
ansi16(from: HEX): ANSI16;
|
|
175
|
+
ansi256(from: HEX): ANSI256;
|
|
176
|
+
hcg(from: HEX): HCG;
|
|
177
|
+
apple(from: HEX): APPLE;
|
|
178
|
+
gray(from: HEX): GRAY;
|
|
179
|
+
}
|
|
180
|
+
interface keyword {
|
|
181
|
+
rgb(from: KEYWORD): RGB;
|
|
182
|
+
hsl(from: KEYWORD): HSL;
|
|
183
|
+
hsv(from: KEYWORD): HSV;
|
|
184
|
+
hwb(from: KEYWORD): HWB;
|
|
185
|
+
cmyk(from: KEYWORD): CMYK;
|
|
186
|
+
xyz(from: KEYWORD): XYZ;
|
|
187
|
+
lab(from: KEYWORD): LAB;
|
|
188
|
+
lch(from: KEYWORD): LCH;
|
|
189
|
+
hex(from: KEYWORD): HEX;
|
|
190
|
+
ansi16(from: KEYWORD): ANSI16;
|
|
191
|
+
ansi256(from: KEYWORD): ANSI256;
|
|
192
|
+
hcg(from: KEYWORD): HCG;
|
|
193
|
+
apple(from: KEYWORD): APPLE;
|
|
194
|
+
gray(from: KEYWORD): GRAY;
|
|
195
|
+
}
|
|
196
|
+
interface ansi16 {
|
|
197
|
+
rgb(from: ANSI16): RGB;
|
|
198
|
+
hsl(from: ANSI16): HSL;
|
|
199
|
+
hsv(from: ANSI16): HSV;
|
|
200
|
+
hwb(from: ANSI16): HWB;
|
|
201
|
+
cmyk(from: ANSI16): CMYK;
|
|
202
|
+
xyz(from: ANSI16): XYZ;
|
|
203
|
+
lab(from: ANSI16): LAB;
|
|
204
|
+
lch(from: ANSI16): LCH;
|
|
205
|
+
hex(from: ANSI16): HEX;
|
|
206
|
+
keyword(from: ANSI16): KEYWORD;
|
|
207
|
+
ansi256(from: ANSI16): ANSI256;
|
|
208
|
+
hcg(from: ANSI16): HCG;
|
|
209
|
+
apple(from: ANSI16): APPLE;
|
|
210
|
+
gray(from: ANSI16): GRAY;
|
|
211
|
+
}
|
|
212
|
+
interface ansi256 {
|
|
213
|
+
rgb(from: ANSI256): RGB;
|
|
214
|
+
hsl(from: ANSI256): HSL;
|
|
215
|
+
hsv(from: ANSI256): HSV;
|
|
216
|
+
hwb(from: ANSI256): HWB;
|
|
217
|
+
cmyk(from: ANSI256): CMYK;
|
|
218
|
+
xyz(from: ANSI256): XYZ;
|
|
219
|
+
lab(from: ANSI256): LAB;
|
|
220
|
+
lch(from: ANSI256): LCH;
|
|
221
|
+
hex(from: ANSI256): HEX;
|
|
222
|
+
keyword(from: ANSI256): KEYWORD;
|
|
223
|
+
ansi16(from: ANSI256): ANSI16;
|
|
224
|
+
hcg(from: ANSI256): HCG;
|
|
225
|
+
apple(from: ANSI256): APPLE;
|
|
226
|
+
gray(from: ANSI256): GRAY;
|
|
227
|
+
}
|
|
228
|
+
interface hcg {
|
|
229
|
+
rgb(from: HCG): RGB;
|
|
230
|
+
hsl(from: HCG): HSL;
|
|
231
|
+
hsv(from: HCG): HSV;
|
|
232
|
+
hwb(from: HCG): HWB;
|
|
233
|
+
cmyk(from: HCG): CMYK;
|
|
234
|
+
xyz(from: HCG): XYZ;
|
|
235
|
+
lab(from: HCG): LAB;
|
|
236
|
+
lch(from: HCG): LCH;
|
|
237
|
+
hex(from: HCG): HEX;
|
|
238
|
+
keyword(from: HCG): KEYWORD;
|
|
239
|
+
ansi16(from: HCG): ANSI16;
|
|
240
|
+
ansi256(from: HCG): ANSI256;
|
|
241
|
+
apple(from: HCG): APPLE;
|
|
242
|
+
gray(from: HCG): GRAY;
|
|
243
|
+
}
|
|
244
|
+
interface apple {
|
|
245
|
+
rgb(from: APPLE): RGB;
|
|
246
|
+
hsl(from: APPLE): HSL;
|
|
247
|
+
hsv(from: APPLE): HSV;
|
|
248
|
+
hwb(from: APPLE): HWB;
|
|
249
|
+
cmyk(from: APPLE): CMYK;
|
|
250
|
+
xyz(from: APPLE): XYZ;
|
|
251
|
+
lab(from: APPLE): LAB;
|
|
252
|
+
lch(from: APPLE): LCH;
|
|
253
|
+
hex(from: APPLE): HEX;
|
|
254
|
+
keyword(from: APPLE): KEYWORD;
|
|
255
|
+
ansi16(from: APPLE): ANSI16;
|
|
256
|
+
ansi256(from: APPLE): ANSI256;
|
|
257
|
+
hcg(from: APPLE): HCG;
|
|
258
|
+
gray(from: APPLE): GRAY;
|
|
259
|
+
}
|
|
260
|
+
interface gray {
|
|
261
|
+
rgb(from: GRAY): RGB;
|
|
262
|
+
hsl(from: GRAY): HSL;
|
|
263
|
+
hsv(from: GRAY): HSV;
|
|
264
|
+
hwb(from: GRAY): HWB;
|
|
265
|
+
cmyk(from: GRAY): CMYK;
|
|
266
|
+
xyz(from: GRAY): XYZ;
|
|
267
|
+
lab(from: GRAY): LAB;
|
|
268
|
+
lch(from: GRAY): LCH;
|
|
269
|
+
hex(from: GRAY): HEX;
|
|
270
|
+
keyword(from: GRAY): KEYWORD;
|
|
271
|
+
ansi16(from: GRAY): ANSI16;
|
|
272
|
+
ansi256(from: GRAY): ANSI256;
|
|
273
|
+
hcg(from: GRAY): HCG;
|
|
274
|
+
apple(from: GRAY): APPLE;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
declare function route(fromModel: 'rgb'): route.rgb;
|
|
279
|
+
declare function route(fromModel: 'hsl'): route.hsl;
|
|
280
|
+
declare function route(fromModel: 'hsv'): route.hsv;
|
|
281
|
+
declare function route(fromModel: 'hwb'): route.hwb;
|
|
282
|
+
declare function route(fromModel: 'cmyk'): route.cmyk;
|
|
283
|
+
declare function route(fromModel: 'xyz'): route.xyz;
|
|
284
|
+
declare function route(fromModel: 'lab'): route.lab;
|
|
285
|
+
declare function route(fromModel: 'lch'): route.lch;
|
|
286
|
+
declare function route(fromModel: 'hex'): route.hex;
|
|
287
|
+
declare function route(fromModel: 'keyword'): route.keyword;
|
|
288
|
+
declare function route(fromModel: 'ansi16'): route.ansi16;
|
|
289
|
+
declare function route(fromModel: 'ansi256'): route.ansi256;
|
|
290
|
+
declare function route(fromModel: 'hcg'): route.hcg;
|
|
291
|
+
declare function route(fromModel: 'apple'): route.apple;
|
|
292
|
+
declare function route(fromModel: 'gray'): route.gray;
|
|
293
|
+
|
|
294
|
+
export = route;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Type definitions for color-name 1.1
|
|
2
|
+
// Project: https://github.com/colorjs/color-name
|
|
3
|
+
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
|
|
4
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Tuple of Red, Green, and Blue
|
|
8
|
+
* @example
|
|
9
|
+
* // Red = 55, Green = 70, Blue = 0
|
|
10
|
+
* const rgb: RGB = [55, 70, 0];
|
|
11
|
+
*/
|
|
12
|
+
export type RGB = [number, number, number];
|
|
13
|
+
|
|
14
|
+
export const aliceblue: RGB;
|
|
15
|
+
export const antiquewhite: RGB;
|
|
16
|
+
export const aqua: RGB;
|
|
17
|
+
export const aquamarine: RGB;
|
|
18
|
+
export const azure: RGB;
|
|
19
|
+
export const beige: RGB;
|
|
20
|
+
export const bisque: RGB;
|
|
21
|
+
export const black: RGB;
|
|
22
|
+
export const blanchedalmond: RGB;
|
|
23
|
+
export const blue: RGB;
|
|
24
|
+
export const blueviolet: RGB;
|
|
25
|
+
export const brown: RGB;
|
|
26
|
+
export const burlywood: RGB;
|
|
27
|
+
export const cadetblue: RGB;
|
|
28
|
+
export const chartreuse: RGB;
|
|
29
|
+
export const chocolate: RGB;
|
|
30
|
+
export const coral: RGB;
|
|
31
|
+
export const cornflowerblue: RGB;
|
|
32
|
+
export const cornsilk: RGB;
|
|
33
|
+
export const crimson: RGB;
|
|
34
|
+
export const cyan: RGB;
|
|
35
|
+
export const darkblue: RGB;
|
|
36
|
+
export const darkcyan: RGB;
|
|
37
|
+
export const darkgoldenrod: RGB;
|
|
38
|
+
export const darkgray: RGB;
|
|
39
|
+
export const darkgreen: RGB;
|
|
40
|
+
export const darkgrey: RGB;
|
|
41
|
+
export const darkkhaki: RGB;
|
|
42
|
+
export const darkmagenta: RGB;
|
|
43
|
+
export const darkolivegreen: RGB;
|
|
44
|
+
export const darkorange: RGB;
|
|
45
|
+
export const darkorchid: RGB;
|
|
46
|
+
export const darkred: RGB;
|
|
47
|
+
export const darksalmon: RGB;
|
|
48
|
+
export const darkseagreen: RGB;
|
|
49
|
+
export const darkslateblue: RGB;
|
|
50
|
+
export const darkslategray: RGB;
|
|
51
|
+
export const darkslategrey: RGB;
|
|
52
|
+
export const darkturquoise: RGB;
|
|
53
|
+
export const darkviolet: RGB;
|
|
54
|
+
export const deeppink: RGB;
|
|
55
|
+
export const deepskyblue: RGB;
|
|
56
|
+
export const dimgray: RGB;
|
|
57
|
+
export const dimgrey: RGB;
|
|
58
|
+
export const dodgerblue: RGB;
|
|
59
|
+
export const firebrick: RGB;
|
|
60
|
+
export const floralwhite: RGB;
|
|
61
|
+
export const forestgreen: RGB;
|
|
62
|
+
export const fuchsia: RGB;
|
|
63
|
+
export const gainsboro: RGB;
|
|
64
|
+
export const ghostwhite: RGB;
|
|
65
|
+
export const gold: RGB;
|
|
66
|
+
export const goldenrod: RGB;
|
|
67
|
+
export const gray: RGB;
|
|
68
|
+
export const green: RGB;
|
|
69
|
+
export const greenyellow: RGB;
|
|
70
|
+
export const grey: RGB;
|
|
71
|
+
export const honeydew: RGB;
|
|
72
|
+
export const hotpink: RGB;
|
|
73
|
+
export const indianred: RGB;
|
|
74
|
+
export const indigo: RGB;
|
|
75
|
+
export const ivory: RGB;
|
|
76
|
+
export const khaki: RGB;
|
|
77
|
+
export const lavender: RGB;
|
|
78
|
+
export const lavenderblush: RGB;
|
|
79
|
+
export const lawngreen: RGB;
|
|
80
|
+
export const lemonchiffon: RGB;
|
|
81
|
+
export const lightblue: RGB;
|
|
82
|
+
export const lightcoral: RGB;
|
|
83
|
+
export const lightcyan: RGB;
|
|
84
|
+
export const lightgoldenrodyellow: RGB;
|
|
85
|
+
export const lightgray: RGB;
|
|
86
|
+
export const lightgreen: RGB;
|
|
87
|
+
export const lightgrey: RGB;
|
|
88
|
+
export const lightpink: RGB;
|
|
89
|
+
export const lightsalmon: RGB;
|
|
90
|
+
export const lightseagreen: RGB;
|
|
91
|
+
export const lightskyblue: RGB;
|
|
92
|
+
export const lightslategray: RGB;
|
|
93
|
+
export const lightslategrey: RGB;
|
|
94
|
+
export const lightsteelblue: RGB;
|
|
95
|
+
export const lightyellow: RGB;
|
|
96
|
+
export const lime: RGB;
|
|
97
|
+
export const limegreen: RGB;
|
|
98
|
+
export const linen: RGB;
|
|
99
|
+
export const magenta: RGB;
|
|
100
|
+
export const maroon: RGB;
|
|
101
|
+
export const mediumaquamarine: RGB;
|
|
102
|
+
export const mediumblue: RGB;
|
|
103
|
+
export const mediumorchid: RGB;
|
|
104
|
+
export const mediumpurple: RGB;
|
|
105
|
+
export const mediumseagreen: RGB;
|
|
106
|
+
export const mediumslateblue: RGB;
|
|
107
|
+
export const mediumspringgreen: RGB;
|
|
108
|
+
export const mediumturquoise: RGB;
|
|
109
|
+
export const mediumvioletred: RGB;
|
|
110
|
+
export const midnightblue: RGB;
|
|
111
|
+
export const mintcream: RGB;
|
|
112
|
+
export const mistyrose: RGB;
|
|
113
|
+
export const moccasin: RGB;
|
|
114
|
+
export const navajowhite: RGB;
|
|
115
|
+
export const navy: RGB;
|
|
116
|
+
export const oldlace: RGB;
|
|
117
|
+
export const olive: RGB;
|
|
118
|
+
export const olivedrab: RGB;
|
|
119
|
+
export const orange: RGB;
|
|
120
|
+
export const orangered: RGB;
|
|
121
|
+
export const orchid: RGB;
|
|
122
|
+
export const palegoldenrod: RGB;
|
|
123
|
+
export const palegreen: RGB;
|
|
124
|
+
export const paleturquoise: RGB;
|
|
125
|
+
export const palevioletred: RGB;
|
|
126
|
+
export const papayawhip: RGB;
|
|
127
|
+
export const peachpuff: RGB;
|
|
128
|
+
export const peru: RGB;
|
|
129
|
+
export const pink: RGB;
|
|
130
|
+
export const plum: RGB;
|
|
131
|
+
export const powderblue: RGB;
|
|
132
|
+
export const purple: RGB;
|
|
133
|
+
export const rebeccapurple: RGB;
|
|
134
|
+
export const red: RGB;
|
|
135
|
+
export const rosybrown: RGB;
|
|
136
|
+
export const royalblue: RGB;
|
|
137
|
+
export const saddlebrown: RGB;
|
|
138
|
+
export const salmon: RGB;
|
|
139
|
+
export const sandybrown: RGB;
|
|
140
|
+
export const seagreen: RGB;
|
|
141
|
+
export const seashell: RGB;
|
|
142
|
+
export const sienna: RGB;
|
|
143
|
+
export const silver: RGB;
|
|
144
|
+
export const skyblue: RGB;
|
|
145
|
+
export const slateblue: RGB;
|
|
146
|
+
export const slategray: RGB;
|
|
147
|
+
export const slategrey: RGB;
|
|
148
|
+
export const snow: RGB;
|
|
149
|
+
export const springgreen: RGB;
|
|
150
|
+
export const steelblue: RGB;
|
|
151
|
+
export const tan: RGB;
|
|
152
|
+
export const teal: RGB;
|
|
153
|
+
export const thistle: RGB;
|
|
154
|
+
export const tomato: RGB;
|
|
155
|
+
export const turquoise: RGB;
|
|
156
|
+
export const violet: RGB;
|
|
157
|
+
export const wheat: RGB;
|
|
158
|
+
export const white: RGB;
|
|
159
|
+
export const whitesmoke: RGB;
|
|
160
|
+
export const yellow: RGB;
|
|
161
|
+
export const yellowgreen: RGB;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Type definitions for color 3.0
|
|
2
|
+
// Project: https://github.com/qix-/color#readme
|
|
3
|
+
// Definitions by: Junyoung Clare Jang <https://github.com/Airlun>
|
|
4
|
+
// James W. Lane <https://github.com/jameswlane>
|
|
5
|
+
// Adam Haglund <https://github.com/BeeeQueue>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
// TypeScript Version: 3.7
|
|
8
|
+
|
|
9
|
+
import convert = require('./color-convert');
|
|
10
|
+
|
|
11
|
+
type ColorParam =
|
|
12
|
+
| Color
|
|
13
|
+
| string
|
|
14
|
+
| ArrayLike<number>
|
|
15
|
+
| number
|
|
16
|
+
| { [key: string]: any };
|
|
17
|
+
|
|
18
|
+
interface Color<T extends ColorParam = ColorParam> {
|
|
19
|
+
toString(): string;
|
|
20
|
+
toJSON(): Color<T>;
|
|
21
|
+
string(places?: number): string;
|
|
22
|
+
percentString(places?: number): string;
|
|
23
|
+
array(): number[];
|
|
24
|
+
object(): { alpha?: number | undefined } & { [key: string]: number };
|
|
25
|
+
unitArray(): number[];
|
|
26
|
+
unitObject(): { r: number; g: number; b: number; alpha?: number | undefined };
|
|
27
|
+
round(places?: number): Color;
|
|
28
|
+
alpha(): number;
|
|
29
|
+
alpha(val: number): Color;
|
|
30
|
+
red(): number;
|
|
31
|
+
red(val: number): Color;
|
|
32
|
+
green(): number;
|
|
33
|
+
green(val: number): Color;
|
|
34
|
+
blue(): number;
|
|
35
|
+
blue(val: number): Color;
|
|
36
|
+
hue(): number;
|
|
37
|
+
hue(val: number): Color;
|
|
38
|
+
saturationl(): number;
|
|
39
|
+
saturationl(val: number): Color;
|
|
40
|
+
lightness(): number;
|
|
41
|
+
lightness(val: number): Color;
|
|
42
|
+
saturationv(): number;
|
|
43
|
+
saturationv(val: number): Color;
|
|
44
|
+
value(): number;
|
|
45
|
+
value(val: number): Color;
|
|
46
|
+
chroma(): number;
|
|
47
|
+
chroma(val: number): Color;
|
|
48
|
+
gray(): number;
|
|
49
|
+
gray(val: number): Color;
|
|
50
|
+
white(): number;
|
|
51
|
+
white(val: number): Color;
|
|
52
|
+
wblack(): number;
|
|
53
|
+
wblack(val: number): Color;
|
|
54
|
+
cyan(): number;
|
|
55
|
+
cyan(val: number): Color;
|
|
56
|
+
magenta(): number;
|
|
57
|
+
magenta(val: number): Color;
|
|
58
|
+
yellow(): number;
|
|
59
|
+
yellow(val: number): Color;
|
|
60
|
+
black(): number;
|
|
61
|
+
black(val: number): Color;
|
|
62
|
+
x(): number;
|
|
63
|
+
x(val: number): Color;
|
|
64
|
+
y(): number;
|
|
65
|
+
y(val: number): Color;
|
|
66
|
+
z(): number;
|
|
67
|
+
z(val: number): Color;
|
|
68
|
+
l(): number;
|
|
69
|
+
l(val: number): Color;
|
|
70
|
+
a(): number;
|
|
71
|
+
a(val: number): Color;
|
|
72
|
+
b(): number;
|
|
73
|
+
b(val: number): Color;
|
|
74
|
+
keyword(): string;
|
|
75
|
+
keyword<V extends string>(val: V): Color<V>;
|
|
76
|
+
hex(): string;
|
|
77
|
+
hex<V extends string>(val: V): Color<V>;
|
|
78
|
+
rgbNumber(): number;
|
|
79
|
+
luminosity(): number;
|
|
80
|
+
contrast(color2: Color): number;
|
|
81
|
+
level(color2: Color): 'AAA' | 'AA' | '';
|
|
82
|
+
isDark(): boolean;
|
|
83
|
+
isLight(): boolean;
|
|
84
|
+
negate(): Color;
|
|
85
|
+
lighten(ratio: number): Color;
|
|
86
|
+
darken(ratio: number): Color;
|
|
87
|
+
saturate(ratio: number): Color;
|
|
88
|
+
desaturate(ratio: number): Color;
|
|
89
|
+
whiten(ratio: number): Color;
|
|
90
|
+
blacken(ratio: number): Color;
|
|
91
|
+
grayscale(): Color;
|
|
92
|
+
fade(ratio: number): Color;
|
|
93
|
+
opaquer(ratio: number): Color;
|
|
94
|
+
rotate(degrees: number): Color;
|
|
95
|
+
mix(mixinColor: Color, weight?: number): Color;
|
|
96
|
+
|
|
97
|
+
rgb(...args: number[]): Color;
|
|
98
|
+
hsl(...args: number[]): Color;
|
|
99
|
+
hsv(...args: number[]): Color;
|
|
100
|
+
hwb(...args: number[]): Color;
|
|
101
|
+
cmyk(...args: number[]): Color;
|
|
102
|
+
xyz(...args: number[]): Color;
|
|
103
|
+
lab(...args: number[]): Color;
|
|
104
|
+
lch(...args: number[]): Color;
|
|
105
|
+
ansi16(...args: number[]): Color;
|
|
106
|
+
ansi256(...args: number[]): Color;
|
|
107
|
+
hcg(...args: number[]): Color;
|
|
108
|
+
apple(...args: number[]): Color;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface ColorConstructor {
|
|
112
|
+
<T extends ColorParam>(obj?: T, model?: keyof typeof convert): Color<T>;
|
|
113
|
+
new <T extends ColorParam>(obj?: T, model?: keyof typeof convert): Color<T>;
|
|
114
|
+
rgb(...val: number[]): Color;
|
|
115
|
+
rgb(color: ColorParam): Color;
|
|
116
|
+
hsl(...val: number[]): Color;
|
|
117
|
+
hsl(color: ColorParam): Color;
|
|
118
|
+
hsv(...val: number[]): Color;
|
|
119
|
+
hsv(color: ColorParam): Color;
|
|
120
|
+
hwb(...val: number[]): Color;
|
|
121
|
+
hwb(color: ColorParam): Color;
|
|
122
|
+
cmyk(...val: number[]): Color;
|
|
123
|
+
cmyk(color: ColorParam): Color;
|
|
124
|
+
xyz(...val: number[]): Color;
|
|
125
|
+
xyz(color: ColorParam): Color;
|
|
126
|
+
lab(...val: number[]): Color;
|
|
127
|
+
lab(color: ColorParam): Color;
|
|
128
|
+
lch(...val: number[]): Color;
|
|
129
|
+
lch(color: ColorParam): Color;
|
|
130
|
+
ansi16(...val: number[]): Color;
|
|
131
|
+
ansi16(color: ColorParam): Color;
|
|
132
|
+
ansi256(...val: number[]): Color;
|
|
133
|
+
ansi256(color: ColorParam): Color;
|
|
134
|
+
hcg(...val: number[]): Color;
|
|
135
|
+
hcg(color: ColorParam): Color;
|
|
136
|
+
apple(...val: number[]): Color;
|
|
137
|
+
apple(color: ColorParam): Color;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare const Color: ColorConstructor;
|
|
141
|
+
|
|
142
|
+
export = Color;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){var t={348:function(t,n,e){const r=e(702);const o={};for(const t of Object.keys(r)){o[r[t]]=t}const s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=s;for(const t of Object.keys(s)){if(!("channels"in s[t])){throw new Error("missing channels property: "+t)}if(!("labels"in s[t])){throw new Error("missing channel labels property: "+t)}if(s[t].labels.length!==s[t].channels){throw new Error("channel and label counts mismatch: "+t)}const{channels:n,labels:e}=s[t];delete s[t].channels;delete s[t].labels;Object.defineProperty(s[t],"channels",{value:n});Object.defineProperty(s[t],"labels",{value:e})}s.rgb.hsl=function(t){const n=t[0]/255;const e=t[1]/255;const r=t[2]/255;const o=Math.min(n,e,r);const s=Math.max(n,e,r);const a=s-o;let l;let c;if(s===o){l=0}else if(n===s){l=(e-r)/a}else if(e===s){l=2+(r-n)/a}else if(r===s){l=4+(n-e)/a}l=Math.min(l*60,360);if(l<0){l+=360}const i=(o+s)/2;if(s===o){c=0}else if(i<=.5){c=a/(s+o)}else{c=a/(2-s-o)}return[l,c*100,i*100]};s.rgb.hsv=function(t){let n;let e;let r;let o;let s;const a=t[0]/255;const l=t[1]/255;const c=t[2]/255;const i=Math.max(a,l,c);const h=i-Math.min(a,l,c);const diffc=function(t){return(i-t)/6/h+1/2};if(h===0){o=0;s=0}else{s=h/i;n=diffc(a);e=diffc(l);r=diffc(c);if(a===i){o=r-e}else if(l===i){o=1/3+n-r}else if(c===i){o=2/3+e-n}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,s*100,i*100]};s.rgb.hwb=function(t){const n=t[0];const e=t[1];let r=t[2];const o=s.rgb.hsl(t)[0];const a=1/255*Math.min(n,Math.min(e,r));r=1-1/255*Math.max(n,Math.max(e,r));return[o,a*100,r*100]};s.rgb.cmyk=function(t){const n=t[0]/255;const e=t[1]/255;const r=t[2]/255;const o=Math.min(1-n,1-e,1-r);const s=(1-n-o)/(1-o)||0;const a=(1-e-o)/(1-o)||0;const l=(1-r-o)/(1-o)||0;return[s*100,a*100,l*100,o*100]};function comparativeDistance(t,n){return(t[0]-n[0])**2+(t[1]-n[1])**2+(t[2]-n[2])**2}s.rgb.keyword=function(t){const n=o[t];if(n){return n}let e=Infinity;let s;for(const n of Object.keys(r)){const o=r[n];const a=comparativeDistance(t,o);if(a<e){e=a;s=n}}return s};s.keyword.rgb=function(t){return r[t]};s.rgb.xyz=function(t){let n=t[0]/255;let e=t[1]/255;let r=t[2]/255;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=n*.4124+e*.3576+r*.1805;const s=n*.2126+e*.7152+r*.0722;const a=n*.0193+e*.1192+r*.9505;return[o*100,s*100,a*100]};s.rgb.lab=function(t){const n=s.rgb.xyz(t);let e=n[0];let r=n[1];let o=n[2];e/=95.047;r/=100;o/=108.883;e=e>.008856?e**(1/3):7.787*e+16/116;r=r>.008856?r**(1/3):7.787*r+16/116;o=o>.008856?o**(1/3):7.787*o+16/116;const a=116*r-16;const l=500*(e-r);const c=200*(r-o);return[a,l,c]};s.hsl.rgb=function(t){const n=t[0]/360;const e=t[1]/100;const r=t[2]/100;let o;let s;let a;if(e===0){a=r*255;return[a,a,a]}if(r<.5){o=r*(1+e)}else{o=r+e-r*e}const l=2*r-o;const c=[0,0,0];for(let t=0;t<3;t++){s=n+1/3*-(t-1);if(s<0){s++}if(s>1){s--}if(6*s<1){a=l+(o-l)*6*s}else if(2*s<1){a=o}else if(3*s<2){a=l+(o-l)*(2/3-s)*6}else{a=l}c[t]=a*255}return c};s.hsl.hsv=function(t){const n=t[0];let e=t[1]/100;let r=t[2]/100;let o=e;const s=Math.max(r,.01);r*=2;e*=r<=1?r:2-r;o*=s<=1?s:2-s;const a=(r+e)/2;const l=r===0?2*o/(s+o):2*e/(r+e);return[n,l*100,a*100]};s.hsv.rgb=function(t){const n=t[0]/60;const e=t[1]/100;let r=t[2]/100;const o=Math.floor(n)%6;const s=n-Math.floor(n);const a=255*r*(1-e);const l=255*r*(1-e*s);const c=255*r*(1-e*(1-s));r*=255;switch(o){case 0:return[r,c,a];case 1:return[l,r,a];case 2:return[a,r,c];case 3:return[a,l,r];case 4:return[c,a,r];case 5:return[r,a,l]}};s.hsv.hsl=function(t){const n=t[0];const e=t[1]/100;const r=t[2]/100;const o=Math.max(r,.01);let s;let a;a=(2-e)*r;const l=(2-e)*o;s=e*o;s/=l<=1?l:2-l;s=s||0;a/=2;return[n,s*100,a*100]};s.hwb.rgb=function(t){const n=t[0]/360;let e=t[1]/100;let r=t[2]/100;const o=e+r;let s;if(o>1){e/=o;r/=o}const a=Math.floor(6*n);const l=1-r;s=6*n-a;if((a&1)!==0){s=1-s}const c=e+s*(l-e);let i;let h;let u;switch(a){default:case 6:case 0:i=l;h=c;u=e;break;case 1:i=c;h=l;u=e;break;case 2:i=e;h=l;u=c;break;case 3:i=e;h=c;u=l;break;case 4:i=c;h=e;u=l;break;case 5:i=l;h=e;u=c;break}return[i*255,h*255,u*255]};s.cmyk.rgb=function(t){const n=t[0]/100;const e=t[1]/100;const r=t[2]/100;const o=t[3]/100;const s=1-Math.min(1,n*(1-o)+o);const a=1-Math.min(1,e*(1-o)+o);const l=1-Math.min(1,r*(1-o)+o);return[s*255,a*255,l*255]};s.xyz.rgb=function(t){const n=t[0]/100;const e=t[1]/100;const r=t[2]/100;let o;let s;let a;o=n*3.2406+e*-1.5372+r*-.4986;s=n*-.9689+e*1.8758+r*.0415;a=n*.0557+e*-.204+r*1.057;o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92;s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92;a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92;o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);a=Math.min(Math.max(0,a),1);return[o*255,s*255,a*255]};s.xyz.lab=function(t){let n=t[0];let e=t[1];let r=t[2];n/=95.047;e/=100;r/=108.883;n=n>.008856?n**(1/3):7.787*n+16/116;e=e>.008856?e**(1/3):7.787*e+16/116;r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*e-16;const s=500*(n-e);const a=200*(e-r);return[o,s,a]};s.lab.xyz=function(t){const n=t[0];const e=t[1];const r=t[2];let o;let s;let a;s=(n+16)/116;o=e/500+s;a=s-r/200;const l=s**3;const c=o**3;const i=a**3;s=l>.008856?l:(s-16/116)/7.787;o=c>.008856?c:(o-16/116)/7.787;a=i>.008856?i:(a-16/116)/7.787;o*=95.047;s*=100;a*=108.883;return[o,s,a]};s.lab.lch=function(t){const n=t[0];const e=t[1];const r=t[2];let o;const s=Math.atan2(r,e);o=s*360/2/Math.PI;if(o<0){o+=360}const a=Math.sqrt(e*e+r*r);return[n,a,o]};s.lch.lab=function(t){const n=t[0];const e=t[1];const r=t[2];const o=r/360*2*Math.PI;const s=e*Math.cos(o);const a=e*Math.sin(o);return[n,s,a]};s.rgb.ansi16=function(t,n=null){const[e,r,o]=t;let a=n===null?s.rgb.hsv(t)[2]:n;a=Math.round(a/50);if(a===0){return 30}let l=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(e/255));if(a===2){l+=60}return l};s.hsv.ansi16=function(t){return s.rgb.ansi16(s.hsv.rgb(t),t[2])};s.rgb.ansi256=function(t){const n=t[0];const e=t[1];const r=t[2];if(n===e&&e===r){if(n<8){return 16}if(n>248){return 231}return Math.round((n-8)/247*24)+232}const o=16+36*Math.round(n/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5);return o};s.ansi16.rgb=function(t){let n=t%10;if(n===0||n===7){if(t>50){n+=3.5}n=n/10.5*255;return[n,n,n]}const e=(~~(t>50)+1)*.5;const r=(n&1)*e*255;const o=(n>>1&1)*e*255;const s=(n>>2&1)*e*255;return[r,o,s]};s.ansi256.rgb=function(t){if(t>=232){const n=(t-232)*10+8;return[n,n,n]}t-=16;let n;const e=Math.floor(t/36)/5*255;const r=Math.floor((n=t%36)/6)/5*255;const o=n%6/5*255;return[e,r,o]};s.rgb.hex=function(t){const n=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255);const e=n.toString(16).toUpperCase();return"000000".substring(e.length)+e};s.hex.rgb=function(t){const n=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n){return[0,0,0]}let e=n[0];if(n[0].length===3){e=e.split("").map((t=>t+t)).join("")}const r=parseInt(e,16);const o=r>>16&255;const s=r>>8&255;const a=r&255;return[o,s,a]};s.rgb.hcg=function(t){const n=t[0]/255;const e=t[1]/255;const r=t[2]/255;const o=Math.max(Math.max(n,e),r);const s=Math.min(Math.min(n,e),r);const a=o-s;let l;let c;if(a<1){l=s/(1-a)}else{l=0}if(a<=0){c=0}else if(o===n){c=(e-r)/a%6}else if(o===e){c=2+(r-n)/a}else{c=4+(n-e)/a}c/=6;c%=1;return[c*360,a*100,l*100]};s.hsl.hcg=function(t){const n=t[1]/100;const e=t[2]/100;const r=e<.5?2*n*e:2*n*(1-e);let o=0;if(r<1){o=(e-.5*r)/(1-r)}return[t[0],r*100,o*100]};s.hsv.hcg=function(t){const n=t[1]/100;const e=t[2]/100;const r=n*e;let o=0;if(r<1){o=(e-r)/(1-r)}return[t[0],r*100,o*100]};s.hcg.rgb=function(t){const n=t[0]/360;const e=t[1]/100;const r=t[2]/100;if(e===0){return[r*255,r*255,r*255]}const o=[0,0,0];const s=n%1*6;const a=s%1;const l=1-a;let c=0;switch(Math.floor(s)){case 0:o[0]=1;o[1]=a;o[2]=0;break;case 1:o[0]=l;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=a;break;case 3:o[0]=0;o[1]=l;o[2]=1;break;case 4:o[0]=a;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=l}c=(1-e)*r;return[(e*o[0]+c)*255,(e*o[1]+c)*255,(e*o[2]+c)*255]};s.hcg.hsv=function(t){const n=t[1]/100;const e=t[2]/100;const r=n+e*(1-n);let o=0;if(r>0){o=n/r}return[t[0],o*100,r*100]};s.hcg.hsl=function(t){const n=t[1]/100;const e=t[2]/100;const r=e*(1-n)+.5*n;let o=0;if(r>0&&r<.5){o=n/(2*r)}else if(r>=.5&&r<1){o=n/(2*(1-r))}return[t[0],o*100,r*100]};s.hcg.hwb=function(t){const n=t[1]/100;const e=t[2]/100;const r=n+e*(1-n);return[t[0],(r-n)*100,(1-r)*100]};s.hwb.hcg=function(t){const n=t[1]/100;const e=t[2]/100;const r=1-e;const o=r-n;let s=0;if(o<1){s=(r-o)/(1-o)}return[t[0],o*100,s*100]};s.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};s.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};s.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};s.gray.hsl=function(t){return[0,0,t[0]]};s.gray.hsv=s.gray.hsl;s.gray.hwb=function(t){return[0,100,t[0]]};s.gray.cmyk=function(t){return[0,0,0,t[0]]};s.gray.lab=function(t){return[t[0],0,0]};s.gray.hex=function(t){const n=Math.round(t[0]/100*255)&255;const e=(n<<16)+(n<<8)+n;const r=e.toString(16).toUpperCase();return"000000".substring(r.length)+r};s.rgb.gray=function(t){const n=(t[0]+t[1]+t[2])/3;return[n/255*100]}},808:function(t,n,e){const r=e(348);const o=e(682);const s={};const a=Object.keys(r);function wrapRaw(t){const wrappedFn=function(...n){const e=n[0];if(e===undefined||e===null){return e}if(e.length>1){n=e}return t(n)};if("conversion"in t){wrappedFn.conversion=t.conversion}return wrappedFn}function wrapRounded(t){const wrappedFn=function(...n){const e=n[0];if(e===undefined||e===null){return e}if(e.length>1){n=e}const r=t(n);if(typeof r==="object"){for(let t=r.length,n=0;n<t;n++){r[n]=Math.round(r[n])}}return r};if("conversion"in t){wrappedFn.conversion=t.conversion}return wrappedFn}a.forEach((t=>{s[t]={};Object.defineProperty(s[t],"channels",{value:r[t].channels});Object.defineProperty(s[t],"labels",{value:r[t].labels});const n=o(t);const e=Object.keys(n);e.forEach((e=>{const r=n[e];s[t][e]=wrapRounded(r);s[t][e].raw=wrapRaw(r)}))}));t.exports=s},682:function(t,n,e){const r=e(348);function buildGraph(){const t={};const n=Object.keys(r);for(let e=n.length,r=0;r<e;r++){t[n[r]]={distance:-1,parent:null}}return t}function deriveBFS(t){const n=buildGraph();const e=[t];n[t].distance=0;while(e.length){const t=e.pop();const o=Object.keys(r[t]);for(let r=o.length,s=0;s<r;s++){const r=o[s];const a=n[r];if(a.distance===-1){a.distance=n[t].distance+1;a.parent=t;e.unshift(r)}}}return n}function link(t,n){return function(e){return n(t(e))}}function wrapConversion(t,n){const e=[n[t].parent,t];let o=r[n[t].parent][t];let s=n[t].parent;while(n[s].parent){e.unshift(n[s].parent);o=link(r[n[s].parent][s],o);s=n[s].parent}o.conversion=e;return o}t.exports=function(t){const n=deriveBFS(t);const e={};const r=Object.keys(n);for(let t=r.length,o=0;o<t;o++){const t=r[o];const s=n[t];if(s.parent===null){continue}e[t]=wrapConversion(t,n)}return e}},702:function(t){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},49:function(t,n,e){var r=e(702);var o=e(534);var s={};for(var a in r){if(r.hasOwnProperty(a)){s[r[a]]=a}}var l=t.exports={to:{},get:{}};l.get=function(t){var n=t.substring(0,3).toLowerCase();var e;var r;switch(n){case"hsl":e=l.get.hsl(t);r="hsl";break;case"hwb":e=l.get.hwb(t);r="hwb";break;default:e=l.get.rgb(t);r="rgb";break}if(!e){return null}return{model:r,value:e}};l.get.rgb=function(t){if(!t){return null}var n=/^#([a-f0-9]{3,4})$/i;var e=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i;var o=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;var s=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;var a=/(\D+)/;var l=[0,0,0,1];var c;var i;var h;if(c=t.match(e)){h=c[2];c=c[1];for(i=0;i<3;i++){var u=i*2;l[i]=parseInt(c.slice(u,u+2),16)}if(h){l[3]=parseInt(h,16)/255}}else if(c=t.match(n)){c=c[1];h=c[3];for(i=0;i<3;i++){l[i]=parseInt(c[i]+c[i],16)}if(h){l[3]=parseInt(h+h,16)/255}}else if(c=t.match(o)){for(i=0;i<3;i++){l[i]=parseInt(c[i+1],0)}if(c[4]){l[3]=parseFloat(c[4])}}else if(c=t.match(s)){for(i=0;i<3;i++){l[i]=Math.round(parseFloat(c[i+1])*2.55)}if(c[4]){l[3]=parseFloat(c[4])}}else if(c=t.match(a)){if(c[1]==="transparent"){return[0,0,0,0]}l=r[c[1]];if(!l){return null}l[3]=1;return l}else{return null}for(i=0;i<3;i++){l[i]=clamp(l[i],0,255)}l[3]=clamp(l[3],0,1);return l};l.get.hsl=function(t){if(!t){return null}var n=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?[\d\.]+)\s*)?\)$/;var e=t.match(n);if(e){var r=parseFloat(e[4]);var o=(parseFloat(e[1])+360)%360;var s=clamp(parseFloat(e[2]),0,100);var a=clamp(parseFloat(e[3]),0,100);var l=clamp(isNaN(r)?1:r,0,1);return[o,s,a,l]}return null};l.get.hwb=function(t){if(!t){return null}var n=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;var e=t.match(n);if(e){var r=parseFloat(e[4]);var o=(parseFloat(e[1])%360+360)%360;var s=clamp(parseFloat(e[2]),0,100);var a=clamp(parseFloat(e[3]),0,100);var l=clamp(isNaN(r)?1:r,0,1);return[o,s,a,l]}return null};l.to.hex=function(){var t=o(arguments);return"#"+hexDouble(t[0])+hexDouble(t[1])+hexDouble(t[2])+(t[3]<1?hexDouble(Math.round(t[3]*255)):"")};l.to.rgb=function(){var t=o(arguments);return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"};l.to.rgb.percent=function(){var t=o(arguments);var n=Math.round(t[0]/255*100);var e=Math.round(t[1]/255*100);var r=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+n+"%, "+e+"%, "+r+"%)":"rgba("+n+"%, "+e+"%, "+r+"%, "+t[3]+")"};l.to.hsl=function(){var t=o(arguments);return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};l.to.hwb=function(){var t=o(arguments);var n="";if(t.length>=4&&t[3]!==1){n=", "+t[3]}return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+n+")"};l.to.keyword=function(t){return s[t.slice(0,3)]};function clamp(t,n,e){return Math.min(Math.max(n,t),e)}function hexDouble(t){var n=t.toString(16).toUpperCase();return n.length<2?"0"+n:n}},990:function(t,n,e){const r=e(49);const o=e(808);const s=[].slice;const a=["keyword","gray","hex"];const l={};for(const t of Object.keys(o)){l[s.call(o[t].labels).sort().join("")]=t}const c={};function Color(t,n){if(!(this instanceof Color)){return new Color(t,n)}if(n&&n in a){n=null}if(n&&!(n in o)){throw new Error("Unknown model: "+n)}let e;let i;if(t==null){this.model="rgb";this.color=[0,0,0];this.valpha=1}else if(t instanceof Color){this.model=t.model;this.color=t.color.slice();this.valpha=t.valpha}else if(typeof t==="string"){const n=r.get(t);if(n===null){throw new Error("Unable to parse color from string: "+t)}this.model=n.model;i=o[this.model].channels;this.color=n.value.slice(0,i);this.valpha=typeof n.value[i]==="number"?n.value[i]:1}else if(t.length>0){this.model=n||"rgb";i=o[this.model].channels;const e=s.call(t,0,i);this.color=zeroArray(e,i);this.valpha=typeof t[i]==="number"?t[i]:1}else if(typeof t==="number"){this.model="rgb";this.color=[t>>16&255,t>>8&255,t&255];this.valpha=1}else{this.valpha=1;const n=Object.keys(t);if("alpha"in t){n.splice(n.indexOf("alpha"),1);this.valpha=typeof t.alpha==="number"?t.alpha:0}const r=n.sort().join("");if(!(r in l)){throw new Error("Unable to parse color from object: "+JSON.stringify(t))}this.model=l[r];const s=o[this.model].labels;const a=[];for(e=0;e<s.length;e++){a.push(t[s[e]])}this.color=zeroArray(a)}if(c[this.model]){i=o[this.model].channels;for(e=0;e<i;e++){const t=c[this.model][e];if(t){this.color[e]=t(this.color[e])}}}this.valpha=Math.max(0,Math.min(1,this.valpha));if(Object.freeze){Object.freeze(this)}}Color.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(t){let n=this.model in r.to?this:this.rgb();n=n.round(typeof t==="number"?t:1);const e=n.valpha===1?n.color:n.color.concat(this.valpha);return r.to[n.model](e)},percentString(t){const n=this.rgb().round(typeof t==="number"?t:1);const e=n.valpha===1?n.color:n.color.concat(this.valpha);return r.to.rgb.percent(e)},array(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object(){const t={};const n=o[this.model].channels;const e=o[this.model].labels;for(let r=0;r<n;r++){t[e[r]]=this.color[r]}if(this.valpha!==1){t.alpha=this.valpha}return t},unitArray(){const t=this.rgb().color;t[0]/=255;t[1]/=255;t[2]/=255;if(this.valpha!==1){t.push(this.valpha)}return t},unitObject(){const t=this.rgb().object();t.r/=255;t.g/=255;t.b/=255;if(this.valpha!==1){t.alpha=this.valpha}return t},round(t){t=Math.max(t||0,0);return new Color(this.color.map(roundToPlace(t)).concat(this.valpha),this.model)},alpha(t){if(arguments.length>0){return new Color(this.color.concat(Math.max(0,Math.min(1,t))),this.model)}return this.valpha},red:getset("rgb",0,maxfn(255)),green:getset("rgb",1,maxfn(255)),blue:getset("rgb",2,maxfn(255)),hue:getset(["hsl","hsv","hsl","hwb","hcg"],0,(t=>(t%360+360)%360)),saturationl:getset("hsl",1,maxfn(100)),lightness:getset("hsl",2,maxfn(100)),saturationv:getset("hsv",1,maxfn(100)),value:getset("hsv",2,maxfn(100)),chroma:getset("hcg",1,maxfn(100)),gray:getset("hcg",2,maxfn(100)),white:getset("hwb",1,maxfn(100)),wblack:getset("hwb",2,maxfn(100)),cyan:getset("cmyk",0,maxfn(100)),magenta:getset("cmyk",1,maxfn(100)),yellow:getset("cmyk",2,maxfn(100)),black:getset("cmyk",3,maxfn(100)),x:getset("xyz",0,maxfn(100)),y:getset("xyz",1,maxfn(100)),z:getset("xyz",2,maxfn(100)),l:getset("lab",0,maxfn(100)),a:getset("lab",1),b:getset("lab",2),keyword(t){if(arguments.length>0){return new Color(t)}return o[this.model].keyword(this.color)},hex(t){if(arguments.length>0){return new Color(t)}return r.to.hex(this.rgb().round().color)},rgbNumber(){const t=this.rgb().color;return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255},luminosity(){const t=this.rgb().color;const n=[];for(const[e,r]of t.entries()){const t=r/255;n[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}return.2126*n[0]+.7152*n[1]+.0722*n[2]},contrast(t){const n=this.luminosity();const e=t.luminosity();if(n>e){return(n+.05)/(e+.05)}return(e+.05)/(n+.05)},level(t){const n=this.contrast(t);if(n>=7.1){return"AAA"}return n>=4.5?"AA":""},isDark(){const t=this.rgb().color;const n=(t[0]*299+t[1]*587+t[2]*114)/1e3;return n<128},isLight(){return!this.isDark()},negate(){const t=this.rgb();for(let n=0;n<3;n++){t.color[n]=255-t.color[n]}return t},lighten(t){const n=this.hsl();n.color[2]+=n.color[2]*t;return n},darken(t){const n=this.hsl();n.color[2]-=n.color[2]*t;return n},saturate(t){const n=this.hsl();n.color[1]+=n.color[1]*t;return n},desaturate(t){const n=this.hsl();n.color[1]-=n.color[1]*t;return n},whiten(t){const n=this.hwb();n.color[1]+=n.color[1]*t;return n},blacken(t){const n=this.hwb();n.color[2]+=n.color[2]*t;return n},grayscale(){const t=this.rgb().color;const n=t[0]*.3+t[1]*.59+t[2]*.11;return Color.rgb(n,n,n)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){const n=this.hsl();let e=n.color[0];e=(e+t)%360;e=e<0?360+e:e;n.color[0]=e;return n},mix(t,n){if(!t||!t.rgb){throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t)}const e=t.rgb();const r=this.rgb();const o=n===undefined?.5:n;const s=2*o-1;const a=e.alpha()-r.alpha();const l=((s*a===-1?s:(s+a)/(1+s*a))+1)/2;const c=1-l;return Color.rgb(l*e.red()+c*r.red(),l*e.green()+c*r.green(),l*e.blue()+c*r.blue(),e.alpha()*o+r.alpha()*(1-o))}};for(const t of Object.keys(o)){if(a.includes(t)){continue}const n=o[t].channels;Color.prototype[t]=function(){if(this.model===t){return new Color(this)}if(arguments.length>0){return new Color(arguments,t)}const e=typeof arguments[n]==="number"?n:this.valpha;return new Color(assertArray(o[this.model][t].raw(this.color)).concat(e),t)};Color[t]=function(e){if(typeof e==="number"){e=zeroArray(s.call(arguments),n)}return new Color(e,t)}}function roundTo(t,n){return Number(t.toFixed(n))}function roundToPlace(t){return function(n){return roundTo(n,t)}}function getset(t,n,e){t=Array.isArray(t)?t:[t];for(const r of t){(c[r]||(c[r]=[]))[n]=e}t=t[0];return function(r){let o;if(arguments.length>0){if(e){r=e(r)}o=this[t]();o.color[n]=r;return o}o=this[t]().color[n];if(e){o=e(o)}return o}}function maxfn(t){return function(n){return Math.max(0,Math.min(t,n))}}function assertArray(t){return Array.isArray(t)?t:[t]}function zeroArray(t,n){for(let e=0;e<n;e++){if(typeof t[e]!=="number"){t[e]=0}}return t}t.exports=Color},503:function(t){t.exports=function isArrayish(t){if(!t||typeof t==="string"){return false}return t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")}},534:function(t,n,e){"use strict";var r=e(503);var o=Array.prototype.concat;var s=Array.prototype.slice;var a=t.exports=function swizzle(t){var n=[];for(var e=0,a=t.length;e<a;e++){var l=t[e];if(r(l)){n=o.call(n,s.call(l))}else{n.push(l)}}return n};a.wrap=function(t){return function(){return t(a(arguments))}}}};var n={};function __nccwpck_require__(e){var r=n[e];if(r!==undefined){return r.exports}var o=n[e]={exports:{}};var s=true;try{t[e](o,o.exports,__nccwpck_require__);s=false}finally{if(s)delete n[e]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var e=__nccwpck_require__(990);module.exports=e})();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|