storybook 10.2.0-alpha.1 → 10.2.0-alpha.3
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/dist/_browser-chunks/Color-E5XDEOX4.js +484 -0
- package/dist/_browser-chunks/{WithTooltip-IO6J4KBT.js → WithTooltip-65CFNBJE.js} +70 -70
- package/dist/_browser-chunks/{chunk-45UGUKRX.js → chunk-242VQQM5.js} +1 -1
- package/dist/_browser-chunks/chunk-2NDLAB5X.js +363 -0
- package/dist/_browser-chunks/{chunk-JP7NCOJX.js → chunk-3LY4VQVK.js} +1 -1
- package/dist/_browser-chunks/{chunk-XJNX76GA.js → chunk-54PNNATT.js} +3 -20
- package/dist/_browser-chunks/{chunk-VYJQ7RU5.js → chunk-6QKNWBQB.js} +17 -17
- package/dist/_browser-chunks/chunk-CLSHX4VX.js +4140 -0
- package/dist/_browser-chunks/{chunk-2XZMBGTA.js → chunk-DOSERVNW.js} +1 -1
- package/dist/_browser-chunks/chunk-HPYUT3WS.js +199 -0
- package/dist/_browser-chunks/{chunk-BRX2HXH7.js → chunk-IH6QJILI.js} +1 -1
- package/dist/_browser-chunks/{chunk-AS2HQEYC.js → chunk-IWQGIXJS.js} +1 -1
- package/dist/_browser-chunks/{chunk-UD6FQLAF.js → chunk-JK6U3MQW.js} +3 -3
- package/dist/_browser-chunks/{chunk-CHUV5WSW.js → chunk-LE2LTDW3.js} +1 -1
- package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
- package/dist/_browser-chunks/{chunk-RP5RXKFU.js → chunk-Q5RYDXT3.js} +38 -30
- package/dist/_browser-chunks/{chunk-AXG2BOBL.js → chunk-S6TK43XQ.js} +10 -10
- package/dist/_browser-chunks/{chunk-H6XK3RSC.js → chunk-UAYGIC3L.js} +6 -6
- package/dist/_browser-chunks/{chunk-YKE5S47A.js → chunk-V2VKKSMQ.js} +18 -18
- package/dist/_browser-chunks/chunk-VIJ7SQRO.js +568 -0
- package/dist/_browser-chunks/chunk-XCZK5QUJ.js +0 -0
- package/dist/_browser-chunks/{chunk-3OXGAGBE.js → chunk-XLJZ7AOP.js} +14 -14
- package/dist/_browser-chunks/{chunk-SS2NHR7W.js → chunk-Y6HZAT53.js} +10 -12
- package/dist/_browser-chunks/{chunk-P4F4UVXX.js → chunk-YKABRMAI.js} +15 -15
- package/dist/_browser-chunks/{chunk-WJYERY3R.js → chunk-ZCFV7BZB.js} +2 -2
- package/dist/_browser-chunks/{formatter-QJ4M4OGQ.js → formatter-EIJCOSYU.js} +2 -2
- package/dist/_browser-chunks/{syntaxhighlighter-IQDEPFLK.js → syntaxhighlighter-ED5Y7EFY.js} +119 -119
- package/dist/_node-chunks/{builder-manager-LXL5N6M5.js → builder-manager-U6SN6ZED.js} +22 -22
- package/dist/_node-chunks/{camelcase-64II7H4U.js → camelcase-GLXVGCEV.js} +8 -8
- package/dist/_node-chunks/{chunk-KMTK5W6O.js → chunk-2IFACTU4.js} +19 -19
- package/dist/_node-chunks/{chunk-5NWCBUGD.js → chunk-4VZME5CV.js} +6 -6
- package/dist/_node-chunks/{chunk-PGFQADZC.js → chunk-5SCVRD6U.js} +7 -7
- package/dist/_node-chunks/{chunk-VFTNRF5X.js → chunk-5ZGZ22PV.js} +17 -17
- package/dist/_node-chunks/{chunk-LEDV47V2.js → chunk-6RXAFKLM.js} +15 -15
- package/dist/_node-chunks/chunk-6WHPDWFA.js +61 -0
- package/dist/_node-chunks/chunk-B6AJKALV.js +20 -0
- package/dist/_node-chunks/{chunk-5GNBLJKS.js → chunk-C2G5ML5F.js} +8 -8
- package/dist/_node-chunks/chunk-CFCZ5PKC.js +18 -0
- package/dist/_node-chunks/{chunk-ET4VMMZG.js → chunk-DO56XDMZ.js} +10 -10
- package/dist/_node-chunks/{chunk-SR5ZYD7K.js → chunk-E6CKDKNL.js} +8 -8
- package/dist/_node-chunks/{chunk-77APSTTM.js → chunk-H4BZRGVO.js} +8 -8
- package/dist/_node-chunks/{chunk-TX77W2KY.js → chunk-HGYHQF7Z.js} +597 -593
- package/dist/_node-chunks/{chunk-4EZYJUAC.js → chunk-HKTRFCJD.js} +10 -10
- package/dist/_node-chunks/{chunk-KXDU466E.js → chunk-HYH2IT7K.js} +31 -31
- package/dist/_node-chunks/{chunk-R3WYNAT5.js → chunk-IKSK6CEY.js} +6 -6
- package/dist/_node-chunks/{chunk-VR5LMO3F.js → chunk-KP6H4S3L.js} +9 -9
- package/dist/_node-chunks/{chunk-JYMZJCZ7.js → chunk-LHBDNMEP.js} +66 -72
- package/dist/_node-chunks/{chunk-ZI2RAI3I.js → chunk-MUWHX7GN.js} +6 -6
- package/dist/_node-chunks/{chunk-AJUO2ZU3.js → chunk-N3O3HJMU.js} +9 -9
- package/dist/_node-chunks/{chunk-FTR6MHOX.js → chunk-NKUDIVPF.js} +619 -148
- package/dist/_node-chunks/chunk-O5OIO47U.js +23 -0
- package/dist/_node-chunks/{chunk-GYZQMMTN.js → chunk-Q27GKV7Y.js} +9 -9
- package/dist/_node-chunks/{chunk-4BQMSZKI.js → chunk-Q47IIVLL.js} +165 -191
- package/dist/_node-chunks/{chunk-F7377GT2.js → chunk-SM7QXYN4.js} +48 -32
- package/dist/_node-chunks/{chunk-CLNMK7MP.js → chunk-VKFEIIOF.js} +249 -240
- package/dist/_node-chunks/{chunk-TP6ICLTL.js → chunk-XYVZIRZC.js} +6 -6
- package/dist/_node-chunks/{chunk-GOOBGRAV.js → chunk-YPCGEC3N.js} +165 -21
- package/dist/_node-chunks/{dist-HGQ5R6JU.js → dist-GGDI7EVD.js} +10 -10
- package/dist/_node-chunks/{globby-5XJTXKUJ.js → globby-DY2UCDKN.js} +154 -154
- package/dist/_node-chunks/{lib-XNLTS2RI.js → lib-PFKECSVA.js} +16 -16
- package/dist/_node-chunks/{mdx-N42X6CFJ-7WF3QWVO.js → mdx-N42X6CFJ-OPAAI5WZ.js} +11 -11
- package/dist/_node-chunks/{p-limit-RBKYTJKF.js → p-limit-PMYE6ZFC.js} +8 -8
- package/dist/babel/index.js +10 -10
- package/dist/bin/core.js +40 -34
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +14 -11
- package/dist/channels/index.js +3 -3
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.js +18 -18
- package/dist/common/index.d.ts +25 -18
- package/dist/common/index.js +19 -19
- package/dist/components/index.d.ts +9 -2
- package/dist/components/index.js +327 -311
- package/dist/core-server/index.js +127 -127
- package/dist/core-server/presets/common-manager.css +2 -2
- package/dist/core-server/presets/common-manager.js +43 -38
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +4390 -173
- package/dist/csf/index.js +39 -35
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +6 -5
- package/dist/instrumenter/index.js +1 -1
- package/dist/manager/globals-runtime.js +21087 -14648
- package/dist/manager/runtime.js +148 -132
- package/dist/manager-api/index.js +31 -22
- package/dist/mocking-utils/index.js +14 -14
- package/dist/node-logger/index.d.ts +3 -3
- package/dist/node-logger/index.js +9 -9
- package/dist/preview/runtime.js +22291 -15810
- package/dist/preview-api/index.js +12 -11
- package/dist/preview-errors.js +2 -2
- package/dist/router/index.js +12 -13
- package/dist/server-errors.js +11 -11
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +23 -23
- package/dist/test/index.js +3237 -1653
- package/dist/theming/create.js +3 -3
- package/dist/theming/index.js +38 -38
- package/dist/types/index.d.ts +3 -1
- package/package.json +2 -8
- package/dist/_browser-chunks/Color-TNPFN3FC.js +0 -1097
- package/dist/_browser-chunks/chunk-3IAH5M2U.js +0 -171
- package/dist/_browser-chunks/chunk-AIOS4NGK.js +0 -252
- package/dist/_browser-chunks/chunk-EZSQOHRI.js +0 -18
- package/dist/_browser-chunks/chunk-GFLS4VP3.js +0 -64
- package/dist/_browser-chunks/chunk-QKODTO7K.js +0 -7
- package/dist/_node-chunks/chunk-COQ27OZ3.js +0 -61
- package/dist/_node-chunks/chunk-MC2R4DSD.js +0 -20
- package/dist/_node-chunks/chunk-NEENMS4J.js +0 -18
- package/dist/_node-chunks/chunk-XEPVDCRL.js +0 -23
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS
|
|
3
|
+
} from "./chunk-A242L54C.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/color-name/index.js
|
|
6
|
+
var require_color_name = __commonJS({
|
|
7
|
+
"../../node_modules/color-name/index.js"(exports, module) {
|
|
8
|
+
"use strict";
|
|
9
|
+
module.exports = {
|
|
10
|
+
aliceblue: [240, 248, 255],
|
|
11
|
+
antiquewhite: [250, 235, 215],
|
|
12
|
+
aqua: [0, 255, 255],
|
|
13
|
+
aquamarine: [127, 255, 212],
|
|
14
|
+
azure: [240, 255, 255],
|
|
15
|
+
beige: [245, 245, 220],
|
|
16
|
+
bisque: [255, 228, 196],
|
|
17
|
+
black: [0, 0, 0],
|
|
18
|
+
blanchedalmond: [255, 235, 205],
|
|
19
|
+
blue: [0, 0, 255],
|
|
20
|
+
blueviolet: [138, 43, 226],
|
|
21
|
+
brown: [165, 42, 42],
|
|
22
|
+
burlywood: [222, 184, 135],
|
|
23
|
+
cadetblue: [95, 158, 160],
|
|
24
|
+
chartreuse: [127, 255, 0],
|
|
25
|
+
chocolate: [210, 105, 30],
|
|
26
|
+
coral: [255, 127, 80],
|
|
27
|
+
cornflowerblue: [100, 149, 237],
|
|
28
|
+
cornsilk: [255, 248, 220],
|
|
29
|
+
crimson: [220, 20, 60],
|
|
30
|
+
cyan: [0, 255, 255],
|
|
31
|
+
darkblue: [0, 0, 139],
|
|
32
|
+
darkcyan: [0, 139, 139],
|
|
33
|
+
darkgoldenrod: [184, 134, 11],
|
|
34
|
+
darkgray: [169, 169, 169],
|
|
35
|
+
darkgreen: [0, 100, 0],
|
|
36
|
+
darkgrey: [169, 169, 169],
|
|
37
|
+
darkkhaki: [189, 183, 107],
|
|
38
|
+
darkmagenta: [139, 0, 139],
|
|
39
|
+
darkolivegreen: [85, 107, 47],
|
|
40
|
+
darkorange: [255, 140, 0],
|
|
41
|
+
darkorchid: [153, 50, 204],
|
|
42
|
+
darkred: [139, 0, 0],
|
|
43
|
+
darksalmon: [233, 150, 122],
|
|
44
|
+
darkseagreen: [143, 188, 143],
|
|
45
|
+
darkslateblue: [72, 61, 139],
|
|
46
|
+
darkslategray: [47, 79, 79],
|
|
47
|
+
darkslategrey: [47, 79, 79],
|
|
48
|
+
darkturquoise: [0, 206, 209],
|
|
49
|
+
darkviolet: [148, 0, 211],
|
|
50
|
+
deeppink: [255, 20, 147],
|
|
51
|
+
deepskyblue: [0, 191, 255],
|
|
52
|
+
dimgray: [105, 105, 105],
|
|
53
|
+
dimgrey: [105, 105, 105],
|
|
54
|
+
dodgerblue: [30, 144, 255],
|
|
55
|
+
firebrick: [178, 34, 34],
|
|
56
|
+
floralwhite: [255, 250, 240],
|
|
57
|
+
forestgreen: [34, 139, 34],
|
|
58
|
+
fuchsia: [255, 0, 255],
|
|
59
|
+
gainsboro: [220, 220, 220],
|
|
60
|
+
ghostwhite: [248, 248, 255],
|
|
61
|
+
gold: [255, 215, 0],
|
|
62
|
+
goldenrod: [218, 165, 32],
|
|
63
|
+
gray: [128, 128, 128],
|
|
64
|
+
green: [0, 128, 0],
|
|
65
|
+
greenyellow: [173, 255, 47],
|
|
66
|
+
grey: [128, 128, 128],
|
|
67
|
+
honeydew: [240, 255, 240],
|
|
68
|
+
hotpink: [255, 105, 180],
|
|
69
|
+
indianred: [205, 92, 92],
|
|
70
|
+
indigo: [75, 0, 130],
|
|
71
|
+
ivory: [255, 255, 240],
|
|
72
|
+
khaki: [240, 230, 140],
|
|
73
|
+
lavender: [230, 230, 250],
|
|
74
|
+
lavenderblush: [255, 240, 245],
|
|
75
|
+
lawngreen: [124, 252, 0],
|
|
76
|
+
lemonchiffon: [255, 250, 205],
|
|
77
|
+
lightblue: [173, 216, 230],
|
|
78
|
+
lightcoral: [240, 128, 128],
|
|
79
|
+
lightcyan: [224, 255, 255],
|
|
80
|
+
lightgoldenrodyellow: [250, 250, 210],
|
|
81
|
+
lightgray: [211, 211, 211],
|
|
82
|
+
lightgreen: [144, 238, 144],
|
|
83
|
+
lightgrey: [211, 211, 211],
|
|
84
|
+
lightpink: [255, 182, 193],
|
|
85
|
+
lightsalmon: [255, 160, 122],
|
|
86
|
+
lightseagreen: [32, 178, 170],
|
|
87
|
+
lightskyblue: [135, 206, 250],
|
|
88
|
+
lightslategray: [119, 136, 153],
|
|
89
|
+
lightslategrey: [119, 136, 153],
|
|
90
|
+
lightsteelblue: [176, 196, 222],
|
|
91
|
+
lightyellow: [255, 255, 224],
|
|
92
|
+
lime: [0, 255, 0],
|
|
93
|
+
limegreen: [50, 205, 50],
|
|
94
|
+
linen: [250, 240, 230],
|
|
95
|
+
magenta: [255, 0, 255],
|
|
96
|
+
maroon: [128, 0, 0],
|
|
97
|
+
mediumaquamarine: [102, 205, 170],
|
|
98
|
+
mediumblue: [0, 0, 205],
|
|
99
|
+
mediumorchid: [186, 85, 211],
|
|
100
|
+
mediumpurple: [147, 112, 219],
|
|
101
|
+
mediumseagreen: [60, 179, 113],
|
|
102
|
+
mediumslateblue: [123, 104, 238],
|
|
103
|
+
mediumspringgreen: [0, 250, 154],
|
|
104
|
+
mediumturquoise: [72, 209, 204],
|
|
105
|
+
mediumvioletred: [199, 21, 133],
|
|
106
|
+
midnightblue: [25, 25, 112],
|
|
107
|
+
mintcream: [245, 255, 250],
|
|
108
|
+
mistyrose: [255, 228, 225],
|
|
109
|
+
moccasin: [255, 228, 181],
|
|
110
|
+
navajowhite: [255, 222, 173],
|
|
111
|
+
navy: [0, 0, 128],
|
|
112
|
+
oldlace: [253, 245, 230],
|
|
113
|
+
olive: [128, 128, 0],
|
|
114
|
+
olivedrab: [107, 142, 35],
|
|
115
|
+
orange: [255, 165, 0],
|
|
116
|
+
orangered: [255, 69, 0],
|
|
117
|
+
orchid: [218, 112, 214],
|
|
118
|
+
palegoldenrod: [238, 232, 170],
|
|
119
|
+
palegreen: [152, 251, 152],
|
|
120
|
+
paleturquoise: [175, 238, 238],
|
|
121
|
+
palevioletred: [219, 112, 147],
|
|
122
|
+
papayawhip: [255, 239, 213],
|
|
123
|
+
peachpuff: [255, 218, 185],
|
|
124
|
+
peru: [205, 133, 63],
|
|
125
|
+
pink: [255, 192, 203],
|
|
126
|
+
plum: [221, 160, 221],
|
|
127
|
+
powderblue: [176, 224, 230],
|
|
128
|
+
purple: [128, 0, 128],
|
|
129
|
+
rebeccapurple: [102, 51, 153],
|
|
130
|
+
red: [255, 0, 0],
|
|
131
|
+
rosybrown: [188, 143, 143],
|
|
132
|
+
royalblue: [65, 105, 225],
|
|
133
|
+
saddlebrown: [139, 69, 19],
|
|
134
|
+
salmon: [250, 128, 114],
|
|
135
|
+
sandybrown: [244, 164, 96],
|
|
136
|
+
seagreen: [46, 139, 87],
|
|
137
|
+
seashell: [255, 245, 238],
|
|
138
|
+
sienna: [160, 82, 45],
|
|
139
|
+
silver: [192, 192, 192],
|
|
140
|
+
skyblue: [135, 206, 235],
|
|
141
|
+
slateblue: [106, 90, 205],
|
|
142
|
+
slategray: [112, 128, 144],
|
|
143
|
+
slategrey: [112, 128, 144],
|
|
144
|
+
snow: [255, 250, 250],
|
|
145
|
+
springgreen: [0, 255, 127],
|
|
146
|
+
steelblue: [70, 130, 180],
|
|
147
|
+
tan: [210, 180, 140],
|
|
148
|
+
teal: [0, 128, 128],
|
|
149
|
+
thistle: [216, 191, 216],
|
|
150
|
+
tomato: [255, 99, 71],
|
|
151
|
+
turquoise: [64, 224, 208],
|
|
152
|
+
violet: [238, 130, 238],
|
|
153
|
+
wheat: [245, 222, 179],
|
|
154
|
+
white: [255, 255, 255],
|
|
155
|
+
whitesmoke: [245, 245, 245],
|
|
156
|
+
yellow: [255, 255, 0],
|
|
157
|
+
yellowgreen: [154, 205, 50]
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// ../../node_modules/color-convert/conversions.js
|
|
163
|
+
var require_conversions = __commonJS({
|
|
164
|
+
"../../node_modules/color-convert/conversions.js"(exports, module) {
|
|
165
|
+
var cssKeywords = require_color_name(), reverseKeywords = {};
|
|
166
|
+
for (let key of Object.keys(cssKeywords))
|
|
167
|
+
reverseKeywords[cssKeywords[key]] = key;
|
|
168
|
+
var convert = {
|
|
169
|
+
rgb: { channels: 3, labels: "rgb" },
|
|
170
|
+
hsl: { channels: 3, labels: "hsl" },
|
|
171
|
+
hsv: { channels: 3, labels: "hsv" },
|
|
172
|
+
hwb: { channels: 3, labels: "hwb" },
|
|
173
|
+
cmyk: { channels: 4, labels: "cmyk" },
|
|
174
|
+
xyz: { channels: 3, labels: "xyz" },
|
|
175
|
+
lab: { channels: 3, labels: "lab" },
|
|
176
|
+
lch: { channels: 3, labels: "lch" },
|
|
177
|
+
hex: { channels: 1, labels: ["hex"] },
|
|
178
|
+
keyword: { channels: 1, labels: ["keyword"] },
|
|
179
|
+
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
180
|
+
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
181
|
+
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
182
|
+
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
183
|
+
gray: { channels: 1, labels: ["gray"] }
|
|
184
|
+
};
|
|
185
|
+
module.exports = convert;
|
|
186
|
+
for (let model of Object.keys(convert)) {
|
|
187
|
+
if (!("channels" in convert[model]))
|
|
188
|
+
throw new Error("missing channels property: " + model);
|
|
189
|
+
if (!("labels" in convert[model]))
|
|
190
|
+
throw new Error("missing channel labels property: " + model);
|
|
191
|
+
if (convert[model].labels.length !== convert[model].channels)
|
|
192
|
+
throw new Error("channel and label counts mismatch: " + model);
|
|
193
|
+
let { channels, labels } = convert[model];
|
|
194
|
+
delete convert[model].channels, delete convert[model].labels, Object.defineProperty(convert[model], "channels", { value: channels }), Object.defineProperty(convert[model], "labels", { value: labels });
|
|
195
|
+
}
|
|
196
|
+
convert.rgb.hsl = function(rgb) {
|
|
197
|
+
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), delta = max - min, h, s;
|
|
198
|
+
max === min ? h = 0 : r === max ? h = (g - b) / delta : g === max ? h = 2 + (b - r) / delta : b === max && (h = 4 + (r - g) / delta), h = Math.min(h * 60, 360), h < 0 && (h += 360);
|
|
199
|
+
let l = (min + max) / 2;
|
|
200
|
+
return max === min ? s = 0 : l <= 0.5 ? s = delta / (max + min) : s = delta / (2 - max - min), [h, s * 100, l * 100];
|
|
201
|
+
};
|
|
202
|
+
convert.rgb.hsv = function(rgb) {
|
|
203
|
+
let rdif, gdif, bdif, h, s, r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, v = Math.max(r, g, b), diff = v - Math.min(r, g, b), diffc = function(c) {
|
|
204
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
205
|
+
};
|
|
206
|
+
return diff === 0 ? (h = 0, s = 0) : (s = diff / v, rdif = diffc(r), gdif = diffc(g), bdif = diffc(b), r === v ? h = bdif - gdif : g === v ? h = 1 / 3 + rdif - bdif : b === v && (h = 2 / 3 + gdif - rdif), h < 0 ? h += 1 : h > 1 && (h -= 1)), [
|
|
207
|
+
h * 360,
|
|
208
|
+
s * 100,
|
|
209
|
+
v * 100
|
|
210
|
+
];
|
|
211
|
+
};
|
|
212
|
+
convert.rgb.hwb = function(rgb) {
|
|
213
|
+
let r = rgb[0], g = rgb[1], b = rgb[2], h = convert.rgb.hsl(rgb)[0], w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
214
|
+
return b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)), [h, w * 100, b * 100];
|
|
215
|
+
};
|
|
216
|
+
convert.rgb.cmyk = function(rgb) {
|
|
217
|
+
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, k = Math.min(1 - r, 1 - g, 1 - b), c = (1 - r - k) / (1 - k) || 0, m = (1 - g - k) / (1 - k) || 0, y = (1 - b - k) / (1 - k) || 0;
|
|
218
|
+
return [c * 100, m * 100, y * 100, k * 100];
|
|
219
|
+
};
|
|
220
|
+
function comparativeDistance(x, y) {
|
|
221
|
+
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
222
|
+
}
|
|
223
|
+
convert.rgb.keyword = function(rgb) {
|
|
224
|
+
let reversed = reverseKeywords[rgb];
|
|
225
|
+
if (reversed)
|
|
226
|
+
return reversed;
|
|
227
|
+
let currentClosestDistance = 1 / 0, currentClosestKeyword;
|
|
228
|
+
for (let keyword of Object.keys(cssKeywords)) {
|
|
229
|
+
let value = cssKeywords[keyword], distance = comparativeDistance(rgb, value);
|
|
230
|
+
distance < currentClosestDistance && (currentClosestDistance = distance, currentClosestKeyword = keyword);
|
|
231
|
+
}
|
|
232
|
+
return currentClosestKeyword;
|
|
233
|
+
};
|
|
234
|
+
convert.keyword.rgb = function(keyword) {
|
|
235
|
+
return cssKeywords[keyword];
|
|
236
|
+
};
|
|
237
|
+
convert.rgb.xyz = function(rgb) {
|
|
238
|
+
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255;
|
|
239
|
+
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92, g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92, b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
240
|
+
let x = r * 0.4124 + g * 0.3576 + b * 0.1805, y = r * 0.2126 + g * 0.7152 + b * 0.0722, z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
241
|
+
return [x * 100, y * 100, z * 100];
|
|
242
|
+
};
|
|
243
|
+
convert.rgb.lab = function(rgb) {
|
|
244
|
+
let xyz = convert.rgb.xyz(rgb), x = xyz[0], y = xyz[1], z = xyz[2];
|
|
245
|
+
x /= 95.047, y /= 100, z /= 108.883, x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116, y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116, z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
246
|
+
let l = 116 * y - 16, a = 500 * (x - y), b = 200 * (y - z);
|
|
247
|
+
return [l, a, b];
|
|
248
|
+
};
|
|
249
|
+
convert.hsl.rgb = function(hsl) {
|
|
250
|
+
let h = hsl[0] / 360, s = hsl[1] / 100, l = hsl[2] / 100, t2, t3, val;
|
|
251
|
+
if (s === 0)
|
|
252
|
+
return val = l * 255, [val, val, val];
|
|
253
|
+
l < 0.5 ? t2 = l * (1 + s) : t2 = l + s - l * s;
|
|
254
|
+
let t1 = 2 * l - t2, rgb = [0, 0, 0];
|
|
255
|
+
for (let i = 0; i < 3; i++)
|
|
256
|
+
t3 = h + 1 / 3 * -(i - 1), t3 < 0 && t3++, t3 > 1 && t3--, 6 * t3 < 1 ? val = t1 + (t2 - t1) * 6 * t3 : 2 * t3 < 1 ? val = t2 : 3 * t3 < 2 ? val = t1 + (t2 - t1) * (2 / 3 - t3) * 6 : val = t1, rgb[i] = val * 255;
|
|
257
|
+
return rgb;
|
|
258
|
+
};
|
|
259
|
+
convert.hsl.hsv = function(hsl) {
|
|
260
|
+
let h = hsl[0], s = hsl[1] / 100, l = hsl[2] / 100, smin = s, lmin = Math.max(l, 0.01);
|
|
261
|
+
l *= 2, s *= l <= 1 ? l : 2 - l, smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
262
|
+
let v = (l + s) / 2, sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
263
|
+
return [h, sv * 100, v * 100];
|
|
264
|
+
};
|
|
265
|
+
convert.hsv.rgb = function(hsv) {
|
|
266
|
+
let h = hsv[0] / 60, s = hsv[1] / 100, v = hsv[2] / 100, hi = Math.floor(h) % 6, f = h - Math.floor(h), p = 255 * v * (1 - s), q = 255 * v * (1 - s * f), t = 255 * v * (1 - s * (1 - f));
|
|
267
|
+
switch (v *= 255, hi) {
|
|
268
|
+
case 0:
|
|
269
|
+
return [v, t, p];
|
|
270
|
+
case 1:
|
|
271
|
+
return [q, v, p];
|
|
272
|
+
case 2:
|
|
273
|
+
return [p, v, t];
|
|
274
|
+
case 3:
|
|
275
|
+
return [p, q, v];
|
|
276
|
+
case 4:
|
|
277
|
+
return [t, p, v];
|
|
278
|
+
case 5:
|
|
279
|
+
return [v, p, q];
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
convert.hsv.hsl = function(hsv) {
|
|
283
|
+
let h = hsv[0], s = hsv[1] / 100, v = hsv[2] / 100, vmin = Math.max(v, 0.01), sl, l;
|
|
284
|
+
l = (2 - s) * v;
|
|
285
|
+
let lmin = (2 - s) * vmin;
|
|
286
|
+
return sl = s * vmin, sl /= lmin <= 1 ? lmin : 2 - lmin, sl = sl || 0, l /= 2, [h, sl * 100, l * 100];
|
|
287
|
+
};
|
|
288
|
+
convert.hwb.rgb = function(hwb) {
|
|
289
|
+
let h = hwb[0] / 360, wh = hwb[1] / 100, bl = hwb[2] / 100, ratio = wh + bl, f;
|
|
290
|
+
ratio > 1 && (wh /= ratio, bl /= ratio);
|
|
291
|
+
let i = Math.floor(6 * h), v = 1 - bl;
|
|
292
|
+
f = 6 * h - i, (i & 1) !== 0 && (f = 1 - f);
|
|
293
|
+
let n = wh + f * (v - wh), r, g, b;
|
|
294
|
+
switch (i) {
|
|
295
|
+
default:
|
|
296
|
+
case 6:
|
|
297
|
+
case 0:
|
|
298
|
+
r = v, g = n, b = wh;
|
|
299
|
+
break;
|
|
300
|
+
case 1:
|
|
301
|
+
r = n, g = v, b = wh;
|
|
302
|
+
break;
|
|
303
|
+
case 2:
|
|
304
|
+
r = wh, g = v, b = n;
|
|
305
|
+
break;
|
|
306
|
+
case 3:
|
|
307
|
+
r = wh, g = n, b = v;
|
|
308
|
+
break;
|
|
309
|
+
case 4:
|
|
310
|
+
r = n, g = wh, b = v;
|
|
311
|
+
break;
|
|
312
|
+
case 5:
|
|
313
|
+
r = v, g = wh, b = n;
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
return [r * 255, g * 255, b * 255];
|
|
317
|
+
};
|
|
318
|
+
convert.cmyk.rgb = function(cmyk) {
|
|
319
|
+
let c = cmyk[0] / 100, m = cmyk[1] / 100, y = cmyk[2] / 100, k = cmyk[3] / 100, r = 1 - Math.min(1, c * (1 - k) + k), g = 1 - Math.min(1, m * (1 - k) + k), b = 1 - Math.min(1, y * (1 - k) + k);
|
|
320
|
+
return [r * 255, g * 255, b * 255];
|
|
321
|
+
};
|
|
322
|
+
convert.xyz.rgb = function(xyz) {
|
|
323
|
+
let x = xyz[0] / 100, y = xyz[1] / 100, z = xyz[2] / 100, r, g, b;
|
|
324
|
+
return r = x * 3.2406 + y * -1.5372 + z * -0.4986, g = x * -0.9689 + y * 1.8758 + z * 0.0415, b = x * 0.0557 + y * -0.204 + z * 1.057, r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92, g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92, b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92, r = Math.min(Math.max(0, r), 1), g = Math.min(Math.max(0, g), 1), b = Math.min(Math.max(0, b), 1), [r * 255, g * 255, b * 255];
|
|
325
|
+
};
|
|
326
|
+
convert.xyz.lab = function(xyz) {
|
|
327
|
+
let x = xyz[0], y = xyz[1], z = xyz[2];
|
|
328
|
+
x /= 95.047, y /= 100, z /= 108.883, x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116, y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116, z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
329
|
+
let l = 116 * y - 16, a = 500 * (x - y), b = 200 * (y - z);
|
|
330
|
+
return [l, a, b];
|
|
331
|
+
};
|
|
332
|
+
convert.lab.xyz = function(lab) {
|
|
333
|
+
let l = lab[0], a = lab[1], b = lab[2], x, y, z;
|
|
334
|
+
y = (l + 16) / 116, x = a / 500 + y, z = y - b / 200;
|
|
335
|
+
let y2 = y ** 3, x2 = x ** 3, z2 = z ** 3;
|
|
336
|
+
return y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787, x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787, z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787, x *= 95.047, y *= 100, z *= 108.883, [x, y, z];
|
|
337
|
+
};
|
|
338
|
+
convert.lab.lch = function(lab) {
|
|
339
|
+
let l = lab[0], a = lab[1], b = lab[2], h;
|
|
340
|
+
h = Math.atan2(b, a) * 360 / 2 / Math.PI, h < 0 && (h += 360);
|
|
341
|
+
let c = Math.sqrt(a * a + b * b);
|
|
342
|
+
return [l, c, h];
|
|
343
|
+
};
|
|
344
|
+
convert.lch.lab = function(lch) {
|
|
345
|
+
let l = lch[0], c = lch[1], hr = lch[2] / 360 * 2 * Math.PI, a = c * Math.cos(hr), b = c * Math.sin(hr);
|
|
346
|
+
return [l, a, b];
|
|
347
|
+
};
|
|
348
|
+
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
349
|
+
let [r, g, b] = args, value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
350
|
+
if (value = Math.round(value / 50), value === 0)
|
|
351
|
+
return 30;
|
|
352
|
+
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
353
|
+
return value === 2 && (ansi += 60), ansi;
|
|
354
|
+
};
|
|
355
|
+
convert.hsv.ansi16 = function(args) {
|
|
356
|
+
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
357
|
+
};
|
|
358
|
+
convert.rgb.ansi256 = function(args) {
|
|
359
|
+
let r = args[0], g = args[1], b = args[2];
|
|
360
|
+
return r === g && g === b ? r < 8 ? 16 : r > 248 ? 231 : Math.round((r - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
361
|
+
};
|
|
362
|
+
convert.ansi16.rgb = function(args) {
|
|
363
|
+
let color = args % 10;
|
|
364
|
+
if (color === 0 || color === 7)
|
|
365
|
+
return args > 50 && (color += 3.5), color = color / 10.5 * 255, [color, color, color];
|
|
366
|
+
let mult = (~~(args > 50) + 1) * 0.5, r = (color & 1) * mult * 255, g = (color >> 1 & 1) * mult * 255, b = (color >> 2 & 1) * mult * 255;
|
|
367
|
+
return [r, g, b];
|
|
368
|
+
};
|
|
369
|
+
convert.ansi256.rgb = function(args) {
|
|
370
|
+
if (args >= 232) {
|
|
371
|
+
let c = (args - 232) * 10 + 8;
|
|
372
|
+
return [c, c, c];
|
|
373
|
+
}
|
|
374
|
+
args -= 16;
|
|
375
|
+
let rem, r = Math.floor(args / 36) / 5 * 255, g = Math.floor((rem = args % 36) / 6) / 5 * 255, b = rem % 6 / 5 * 255;
|
|
376
|
+
return [r, g, b];
|
|
377
|
+
};
|
|
378
|
+
convert.rgb.hex = function(args) {
|
|
379
|
+
let string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
|
|
380
|
+
return "000000".substring(string.length) + string;
|
|
381
|
+
};
|
|
382
|
+
convert.hex.rgb = function(args) {
|
|
383
|
+
let match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
384
|
+
if (!match)
|
|
385
|
+
return [0, 0, 0];
|
|
386
|
+
let colorString = match[0];
|
|
387
|
+
match[0].length === 3 && (colorString = colorString.split("").map((char) => char + char).join(""));
|
|
388
|
+
let integer = parseInt(colorString, 16), r = integer >> 16 & 255, g = integer >> 8 & 255, b = integer & 255;
|
|
389
|
+
return [r, g, b];
|
|
390
|
+
};
|
|
391
|
+
convert.rgb.hcg = function(rgb) {
|
|
392
|
+
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, max = Math.max(Math.max(r, g), b), min = Math.min(Math.min(r, g), b), chroma = max - min, grayscale, hue;
|
|
393
|
+
return chroma < 1 ? grayscale = min / (1 - chroma) : grayscale = 0, chroma <= 0 ? hue = 0 : max === r ? hue = (g - b) / chroma % 6 : max === g ? hue = 2 + (b - r) / chroma : hue = 4 + (r - g) / chroma, hue /= 6, hue %= 1, [hue * 360, chroma * 100, grayscale * 100];
|
|
394
|
+
};
|
|
395
|
+
convert.hsl.hcg = function(hsl) {
|
|
396
|
+
let s = hsl[1] / 100, l = hsl[2] / 100, c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l), f = 0;
|
|
397
|
+
return c < 1 && (f = (l - 0.5 * c) / (1 - c)), [hsl[0], c * 100, f * 100];
|
|
398
|
+
};
|
|
399
|
+
convert.hsv.hcg = function(hsv) {
|
|
400
|
+
let s = hsv[1] / 100, v = hsv[2] / 100, c = s * v, f = 0;
|
|
401
|
+
return c < 1 && (f = (v - c) / (1 - c)), [hsv[0], c * 100, f * 100];
|
|
402
|
+
};
|
|
403
|
+
convert.hcg.rgb = function(hcg) {
|
|
404
|
+
let h = hcg[0] / 360, c = hcg[1] / 100, g = hcg[2] / 100;
|
|
405
|
+
if (c === 0)
|
|
406
|
+
return [g * 255, g * 255, g * 255];
|
|
407
|
+
let pure = [0, 0, 0], hi = h % 1 * 6, v = hi % 1, w = 1 - v, mg = 0;
|
|
408
|
+
switch (Math.floor(hi)) {
|
|
409
|
+
case 0:
|
|
410
|
+
pure[0] = 1, pure[1] = v, pure[2] = 0;
|
|
411
|
+
break;
|
|
412
|
+
case 1:
|
|
413
|
+
pure[0] = w, pure[1] = 1, pure[2] = 0;
|
|
414
|
+
break;
|
|
415
|
+
case 2:
|
|
416
|
+
pure[0] = 0, pure[1] = 1, pure[2] = v;
|
|
417
|
+
break;
|
|
418
|
+
case 3:
|
|
419
|
+
pure[0] = 0, pure[1] = w, pure[2] = 1;
|
|
420
|
+
break;
|
|
421
|
+
case 4:
|
|
422
|
+
pure[0] = v, pure[1] = 0, pure[2] = 1;
|
|
423
|
+
break;
|
|
424
|
+
default:
|
|
425
|
+
pure[0] = 1, pure[1] = 0, pure[2] = w;
|
|
426
|
+
}
|
|
427
|
+
return mg = (1 - c) * g, [
|
|
428
|
+
(c * pure[0] + mg) * 255,
|
|
429
|
+
(c * pure[1] + mg) * 255,
|
|
430
|
+
(c * pure[2] + mg) * 255
|
|
431
|
+
];
|
|
432
|
+
};
|
|
433
|
+
convert.hcg.hsv = function(hcg) {
|
|
434
|
+
let c = hcg[1] / 100, g = hcg[2] / 100, v = c + g * (1 - c), f = 0;
|
|
435
|
+
return v > 0 && (f = c / v), [hcg[0], f * 100, v * 100];
|
|
436
|
+
};
|
|
437
|
+
convert.hcg.hsl = function(hcg) {
|
|
438
|
+
let c = hcg[1] / 100, l = hcg[2] / 100 * (1 - c) + 0.5 * c, s = 0;
|
|
439
|
+
return l > 0 && l < 0.5 ? s = c / (2 * l) : l >= 0.5 && l < 1 && (s = c / (2 * (1 - l))), [hcg[0], s * 100, l * 100];
|
|
440
|
+
};
|
|
441
|
+
convert.hcg.hwb = function(hcg) {
|
|
442
|
+
let c = hcg[1] / 100, g = hcg[2] / 100, v = c + g * (1 - c);
|
|
443
|
+
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
444
|
+
};
|
|
445
|
+
convert.hwb.hcg = function(hwb) {
|
|
446
|
+
let w = hwb[1] / 100, v = 1 - hwb[2] / 100, c = v - w, g = 0;
|
|
447
|
+
return c < 1 && (g = (v - c) / (1 - c)), [hwb[0], c * 100, g * 100];
|
|
448
|
+
};
|
|
449
|
+
convert.apple.rgb = function(apple) {
|
|
450
|
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
451
|
+
};
|
|
452
|
+
convert.rgb.apple = function(rgb) {
|
|
453
|
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
454
|
+
};
|
|
455
|
+
convert.gray.rgb = function(args) {
|
|
456
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
457
|
+
};
|
|
458
|
+
convert.gray.hsl = function(args) {
|
|
459
|
+
return [0, 0, args[0]];
|
|
460
|
+
};
|
|
461
|
+
convert.gray.hsv = convert.gray.hsl;
|
|
462
|
+
convert.gray.hwb = function(gray) {
|
|
463
|
+
return [0, 100, gray[0]];
|
|
464
|
+
};
|
|
465
|
+
convert.gray.cmyk = function(gray) {
|
|
466
|
+
return [0, 0, 0, gray[0]];
|
|
467
|
+
};
|
|
468
|
+
convert.gray.lab = function(gray) {
|
|
469
|
+
return [gray[0], 0, 0];
|
|
470
|
+
};
|
|
471
|
+
convert.gray.hex = function(gray) {
|
|
472
|
+
let val = Math.round(gray[0] / 100 * 255) & 255, string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
|
473
|
+
return "000000".substring(string.length) + string;
|
|
474
|
+
};
|
|
475
|
+
convert.rgb.gray = function(rgb) {
|
|
476
|
+
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
// ../../node_modules/color-convert/route.js
|
|
482
|
+
var require_route = __commonJS({
|
|
483
|
+
"../../node_modules/color-convert/route.js"(exports, module) {
|
|
484
|
+
var conversions = require_conversions();
|
|
485
|
+
function buildGraph() {
|
|
486
|
+
let graph = {}, models = Object.keys(conversions);
|
|
487
|
+
for (let len = models.length, i = 0; i < len; i++)
|
|
488
|
+
graph[models[i]] = {
|
|
489
|
+
// http://jsperf.com/1-vs-infinity
|
|
490
|
+
// micro-opt, but this is simple.
|
|
491
|
+
distance: -1,
|
|
492
|
+
parent: null
|
|
493
|
+
};
|
|
494
|
+
return graph;
|
|
495
|
+
}
|
|
496
|
+
function deriveBFS(fromModel) {
|
|
497
|
+
let graph = buildGraph(), queue = [fromModel];
|
|
498
|
+
for (graph[fromModel].distance = 0; queue.length; ) {
|
|
499
|
+
let current = queue.pop(), adjacents = Object.keys(conversions[current]);
|
|
500
|
+
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
501
|
+
let adjacent = adjacents[i], node = graph[adjacent];
|
|
502
|
+
node.distance === -1 && (node.distance = graph[current].distance + 1, node.parent = current, queue.unshift(adjacent));
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return graph;
|
|
506
|
+
}
|
|
507
|
+
function link(from, to) {
|
|
508
|
+
return function(args) {
|
|
509
|
+
return to(from(args));
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
function wrapConversion(toModel, graph) {
|
|
513
|
+
let path = [graph[toModel].parent, toModel], fn = conversions[graph[toModel].parent][toModel], cur = graph[toModel].parent;
|
|
514
|
+
for (; graph[cur].parent; )
|
|
515
|
+
path.unshift(graph[cur].parent), fn = link(conversions[graph[cur].parent][cur], fn), cur = graph[cur].parent;
|
|
516
|
+
return fn.conversion = path, fn;
|
|
517
|
+
}
|
|
518
|
+
module.exports = function(fromModel) {
|
|
519
|
+
let graph = deriveBFS(fromModel), conversion = {}, models = Object.keys(graph);
|
|
520
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
521
|
+
let toModel = models[i];
|
|
522
|
+
graph[toModel].parent !== null && (conversion[toModel] = wrapConversion(toModel, graph));
|
|
523
|
+
}
|
|
524
|
+
return conversion;
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
// ../../node_modules/color-convert/index.js
|
|
530
|
+
var require_color_convert = __commonJS({
|
|
531
|
+
"../../node_modules/color-convert/index.js"(exports, module) {
|
|
532
|
+
var conversions = require_conversions(), route = require_route(), convert = {}, models = Object.keys(conversions);
|
|
533
|
+
function wrapRaw(fn) {
|
|
534
|
+
let wrappedFn = function(...args) {
|
|
535
|
+
let arg0 = args[0];
|
|
536
|
+
return arg0 == null ? arg0 : (arg0.length > 1 && (args = arg0), fn(args));
|
|
537
|
+
};
|
|
538
|
+
return "conversion" in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
|
|
539
|
+
}
|
|
540
|
+
function wrapRounded(fn) {
|
|
541
|
+
let wrappedFn = function(...args) {
|
|
542
|
+
let arg0 = args[0];
|
|
543
|
+
if (arg0 == null)
|
|
544
|
+
return arg0;
|
|
545
|
+
arg0.length > 1 && (args = arg0);
|
|
546
|
+
let result = fn(args);
|
|
547
|
+
if (typeof result == "object")
|
|
548
|
+
for (let len = result.length, i = 0; i < len; i++)
|
|
549
|
+
result[i] = Math.round(result[i]);
|
|
550
|
+
return result;
|
|
551
|
+
};
|
|
552
|
+
return "conversion" in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
|
|
553
|
+
}
|
|
554
|
+
models.forEach((fromModel) => {
|
|
555
|
+
convert[fromModel] = {}, Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }), Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
556
|
+
let routes = route(fromModel);
|
|
557
|
+
Object.keys(routes).forEach((toModel) => {
|
|
558
|
+
let fn = routes[toModel];
|
|
559
|
+
convert[fromModel][toModel] = wrapRounded(fn), convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
560
|
+
});
|
|
561
|
+
});
|
|
562
|
+
module.exports = convert;
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
export {
|
|
567
|
+
require_color_convert
|
|
568
|
+
};
|
|
File without changes
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
__commonJS
|
|
3
3
|
} from "./chunk-A242L54C.js";
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// ../../node_modules/picoquery/lib/string-util.js
|
|
6
6
|
var require_string_util = __commonJS({
|
|
7
|
-
"
|
|
7
|
+
"../../node_modules/picoquery/lib/string-util.js"(exports) {
|
|
8
8
|
"use strict";
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
10
10
|
exports.encodeString = encodeString;
|
|
@@ -168,9 +168,9 @@ var require_string_util = __commonJS({
|
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
|
|
171
|
-
//
|
|
171
|
+
// ../../node_modules/picoquery/lib/shared.js
|
|
172
172
|
var require_shared = __commonJS({
|
|
173
|
-
"
|
|
173
|
+
"../../node_modules/picoquery/lib/shared.js"(exports) {
|
|
174
174
|
"use strict";
|
|
175
175
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
176
176
|
exports.defaultOptions = exports.defaultShouldSerializeObject = exports.defaultValueSerializer = void 0;
|
|
@@ -206,9 +206,9 @@ var require_shared = __commonJS({
|
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
|
|
209
|
-
//
|
|
209
|
+
// ../../node_modules/picoquery/lib/object-util.js
|
|
210
210
|
var require_object_util = __commonJS({
|
|
211
|
-
"
|
|
211
|
+
"../../node_modules/picoquery/lib/object-util.js"(exports) {
|
|
212
212
|
"use strict";
|
|
213
213
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
214
214
|
exports.getDeepObject = getDeepObject;
|
|
@@ -241,9 +241,9 @@ var require_object_util = __commonJS({
|
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
243
|
|
|
244
|
-
//
|
|
244
|
+
// ../../node_modules/picoquery/lib/decode-uri-component.js
|
|
245
245
|
var require_decode_uri_component = __commonJS({
|
|
246
|
-
"
|
|
246
|
+
"../../node_modules/picoquery/lib/decode-uri-component.js"(exports) {
|
|
247
247
|
"use strict";
|
|
248
248
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
249
249
|
exports.decodeURIComponent = decodeURIComponent;
|
|
@@ -680,9 +680,9 @@ var require_decode_uri_component = __commonJS({
|
|
|
680
680
|
}
|
|
681
681
|
});
|
|
682
682
|
|
|
683
|
-
//
|
|
683
|
+
// ../../node_modules/picoquery/lib/parse.js
|
|
684
684
|
var require_parse = __commonJS({
|
|
685
|
-
"
|
|
685
|
+
"../../node_modules/picoquery/lib/parse.js"(exports) {
|
|
686
686
|
"use strict";
|
|
687
687
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
688
688
|
exports.numberValueDeserializer = exports.numberKeyDeserializer = void 0;
|
|
@@ -729,9 +729,9 @@ var require_parse = __commonJS({
|
|
|
729
729
|
}
|
|
730
730
|
});
|
|
731
731
|
|
|
732
|
-
//
|
|
732
|
+
// ../../node_modules/picoquery/lib/stringify.js
|
|
733
733
|
var require_stringify = __commonJS({
|
|
734
|
-
"
|
|
734
|
+
"../../node_modules/picoquery/lib/stringify.js"(exports) {
|
|
735
735
|
"use strict";
|
|
736
736
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
737
737
|
exports.stringify = stringify;
|
|
@@ -745,9 +745,9 @@ var require_stringify = __commonJS({
|
|
|
745
745
|
}
|
|
746
746
|
});
|
|
747
747
|
|
|
748
|
-
//
|
|
748
|
+
// ../../node_modules/picoquery/lib/main.js
|
|
749
749
|
var require_main = __commonJS({
|
|
750
|
-
"
|
|
750
|
+
"../../node_modules/picoquery/lib/main.js"(exports) {
|
|
751
751
|
"use strict";
|
|
752
752
|
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
753
753
|
k2 === void 0 && (k2 = k);
|