@pixerate/editor 0.164.0 → 0.166.0
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/agent/index.cjs +54 -39
- package/dist/agent/index.js +24 -9
- package/dist/animation/index.cjs +6 -5
- package/dist/animation/index.js +5 -4
- package/dist/animation-editor/index.cjs +65 -64
- package/dist/animation-editor/index.js +8 -7
- package/dist/bridge/cli.cjs +3 -3
- package/dist/bridge/cli.js +2 -2
- package/dist/bridge/index.cjs +3 -3
- package/dist/bridge/index.js +2 -2
- package/dist/canvas/index.cjs +89 -87
- package/dist/canvas/index.js +11 -9
- package/dist/chart/controller.d.cts +60 -2
- package/dist/chart/controller.d.ts +60 -2
- package/dist/chart/index.cjs +657 -163
- package/dist/chart/index.d.cts +3 -0
- package/dist/chart/index.d.ts +3 -0
- package/dist/chart/index.js +512 -18
- package/dist/chart/layout-families.d.cts +14 -0
- package/dist/chart/layout-families.d.ts +14 -0
- package/dist/chart/layout-shared.d.cts +5 -0
- package/dist/chart/layout-shared.d.ts +5 -0
- package/dist/chart/links.d.cts +34 -0
- package/dist/chart/links.d.ts +34 -0
- package/dist/chart/mermaid.d.cts +9 -6
- package/dist/chart/mermaid.d.ts +9 -6
- package/dist/chart/race.d.cts +26 -0
- package/dist/chart/race.d.ts +26 -0
- package/dist/chart/schemas.d.cts +5 -0
- package/dist/chart/schemas.d.ts +5 -0
- package/dist/chart/spec.d.cts +3 -2
- package/dist/chart/spec.d.ts +3 -2
- package/dist/chart/style.d.cts +33 -0
- package/dist/chart/style.d.ts +33 -0
- package/dist/chart/types.d.cts +28 -2
- package/dist/chart/types.d.ts +28 -2
- package/dist/{chunk-ZVNAMTFO.cjs → chunk-3FSUJIXN.cjs} +18 -174
- package/dist/{chunk-RQCMSEM5.cjs → chunk-4QUUHTGJ.cjs} +2 -2
- package/dist/{chunk-CIPIESX4.cjs → chunk-4ZC5QJE2.cjs} +3 -3
- package/dist/{chunk-S6X2QRVU.cjs → chunk-5UEFBM2M.cjs} +1 -138
- package/dist/{chunk-5FNGLV2D.js → chunk-5UNQDC3Q.js} +18 -3
- package/dist/{chunk-YSAGBIRW.cjs → chunk-6FYIFGBW.cjs} +16 -16
- package/dist/{chunk-QYZGBVNC.js → chunk-7272D3K2.js} +10 -8
- package/dist/{chunk-462WGGXX.cjs → chunk-AMX23CSN.cjs} +27 -16
- package/dist/{chunk-3VLOOO3G.js → chunk-BDIM6NVW.js} +1 -1
- package/dist/{chunk-R3P2M7HU.cjs → chunk-BPX4Z3N3.cjs} +355 -207
- package/dist/{chunk-D54JHQK2.cjs → chunk-CHLV7UFP.cjs} +51 -51
- package/dist/{chunk-OXERWBKE.js → chunk-DFCAR7AW.js} +3 -3
- package/dist/{chunk-GZ2FM3ZB.js → chunk-DKNEQX7T.js} +6 -162
- package/dist/{chunk-JCXMJUQO.cjs → chunk-EGZM52EO.cjs} +3 -3
- package/dist/{chunk-ES3UEVUT.cjs → chunk-EUIDTZNQ.cjs} +112 -110
- package/dist/{chunk-H3OEM3Q2.js → chunk-F6R67I3A.js} +1 -1
- package/dist/{chunk-3NEZJCBY.js → chunk-FR432ROA.js} +349 -201
- package/dist/chunk-HIDFL5LQ.js +484 -0
- package/dist/{chunk-22KLZZGH.cjs → chunk-HXOBOHH2.cjs} +8 -8
- package/dist/{chunk-MKTDELCD.js → chunk-I5MRJW7B.js} +1 -1
- package/dist/{chunk-SDHZG5TF.js → chunk-ILP77UD6.js} +160 -2
- package/dist/{chunk-Z4P2RBMJ.js → chunk-ITANXMZD.js} +177 -3
- package/dist/chunk-KGRZMHZB.js +204 -0
- package/dist/{chunk-SET6KJOP.js → chunk-LPIKXPBM.js} +1 -1
- package/dist/{chunk-BQWGN5WH.js → chunk-M2TPMYJE.js} +1 -1
- package/dist/{chunk-GTELFJRE.cjs → chunk-M5GLQQWG.cjs} +2 -2
- package/dist/{chunk-4VU4CP7R.js → chunk-MHLU6GRJ.js} +1 -138
- package/dist/{chunk-NZD2MZJC.cjs → chunk-MZFZSVUJ.cjs} +38 -23
- package/dist/{chunk-DAPQGA55.js → chunk-NQQDGGXY.js} +2 -2
- package/dist/chunk-O6OGNDND.js +164 -0
- package/dist/{chunk-PA3IMPPS.cjs → chunk-OVYQAYGH.cjs} +81 -81
- package/dist/{chunk-YXOW456B.js → chunk-PPEDZ5WR.js} +1 -1
- package/dist/{chunk-24M7VD6M.cjs → chunk-S4EIAIEW.cjs} +7 -7
- package/dist/{chunk-M4MIZPQI.cjs → chunk-SJ2CPTQC.cjs} +189 -15
- package/dist/{chunk-YGG7WDWT.cjs → chunk-SZWVMB3B.cjs} +24 -18
- package/dist/chunk-TFF2GTGN.cjs +153 -0
- package/dist/chunk-TTCJPX4U.cjs +204 -0
- package/dist/{chunk-SBQVEBSU.cjs → chunk-UUUTEVX6.cjs} +242 -68
- package/dist/{chunk-WI7QJA7A.cjs → chunk-UXETV2NC.cjs} +161 -3
- package/dist/{chunk-GKNEJ6EN.cjs → chunk-V5L2G22R.cjs} +321 -107
- package/dist/{chunk-TALQONZ5.js → chunk-VB2CY6EG.js} +3 -3
- package/dist/{chunk-QY4KUDMY.js → chunk-VRXXAXUT.js} +2 -2
- package/dist/chunk-VU6WQSMB.cjs +164 -0
- package/dist/{chunk-NHLYK3AX.js → chunk-XBQX76CT.js} +182 -8
- package/dist/{chunk-5AARIS3R.cjs → chunk-XCDGM7TD.cjs} +37 -37
- package/dist/{chunk-POR54B55.js → chunk-XNU45TYA.js} +7 -1
- package/dist/{chunk-EVXQNQND.js → chunk-XZB3TJ6K.js} +16 -5
- package/dist/chunk-YBAPT7NL.js +153 -0
- package/dist/{chunk-SZA42R4N.js → chunk-YUFTVNLX.js} +230 -16
- package/dist/chunk-Z2UQYMPS.cjs +484 -0
- package/dist/color/index.cjs +5 -3
- package/dist/color/index.js +12 -10
- package/dist/diagram/index.cjs +55 -243
- package/dist/diagram/index.js +12 -200
- package/dist/export/index.cjs +7 -6
- package/dist/export/index.js +6 -5
- package/dist/extensions/index.cjs +12 -9
- package/dist/extensions/index.js +11 -8
- package/dist/gradient/index.cjs +29 -27
- package/dist/gradient/index.js +6 -4
- package/dist/image-editor/index.cjs +644 -643
- package/dist/image-editor/index.js +7 -6
- package/dist/index.cjs +21 -18
- package/dist/index.js +14 -11
- package/dist/paint-editor/index.cjs +19 -18
- package/dist/paint-editor/index.js +7 -6
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.js +1 -1
- package/dist/persistence/assetWrites.d.cts +22 -0
- package/dist/persistence/assetWrites.d.ts +22 -0
- package/dist/persistence/assets.d.cts +71 -0
- package/dist/persistence/assets.d.ts +71 -0
- package/dist/persistence/documentStore.d.cts +17 -1
- package/dist/persistence/documentStore.d.ts +17 -1
- package/dist/persistence/documentTools.d.cts +5 -1
- package/dist/persistence/documentTools.d.ts +5 -1
- package/dist/persistence/editorAutosave.d.cts +7 -0
- package/dist/persistence/editorAutosave.d.ts +7 -0
- package/dist/persistence/index.cjs +141 -21
- package/dist/persistence/index.js +130 -10
- package/dist/persistence/storage.d.cts +13 -1
- package/dist/persistence/storage.d.ts +13 -1
- package/dist/spreadsheet/index.cjs +3 -3
- package/dist/spreadsheet/index.js +2 -2
- package/dist/tokens/index.cjs +11 -3
- package/dist/tokens/index.d.cts +1 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +10 -2
- package/dist/tokens/style.d.cts +36 -0
- package/dist/tokens/style.d.ts +36 -0
- package/dist/tools/index.cjs +15 -3
- package/dist/tools/index.d.cts +2 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +14 -2
- package/dist/tools/style-tools.d.cts +19 -0
- package/dist/tools/style-tools.d.ts +19 -0
- package/dist/tools/style.d.cts +212 -0
- package/dist/tools/style.d.ts +212 -0
- package/dist/tools/view.d.cts +6 -0
- package/dist/tools/view.d.ts +6 -0
- package/dist/typography/index.cjs +8 -6
- package/dist/typography/index.js +5 -3
- package/dist/vector/index.cjs +953 -952
- package/dist/vector/index.js +7 -6
- package/dist/video-editor/index.cjs +8 -7
- package/dist/video-editor/index.js +6 -5
- package/package.json +1 -1
- package/skills/pixerate-chart/SKILL.md +20 -2
- package/dist/chunk-ERAGQL2N.cjs +0 -68
- package/dist/chunk-KMU6QJB7.js +0 -68
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
var _chunkTFF2GTGNcjs = require('./chunk-TFF2GTGN.cjs');
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
|
|
@@ -20,7 +21,8 @@
|
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
|
|
25
|
+
var _chunk5UEFBM2Mcjs = require('./chunk-5UEFBM2M.cjs');
|
|
24
26
|
|
|
25
27
|
// src/color/vision.ts
|
|
26
28
|
var CVD = {
|
|
@@ -43,13 +45,13 @@ var CVD = {
|
|
|
43
45
|
var clamp01 = (v) => Math.max(0, Math.min(1, v));
|
|
44
46
|
function simulateColorVision(c, vision) {
|
|
45
47
|
if (vision === "normal") return c;
|
|
46
|
-
const lr =
|
|
47
|
-
const lg =
|
|
48
|
-
const lb =
|
|
48
|
+
const lr = _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c.r);
|
|
49
|
+
const lg = _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c.g);
|
|
50
|
+
const lb = _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c.b);
|
|
49
51
|
const m = CVD[vision];
|
|
50
|
-
const r =
|
|
51
|
-
const g =
|
|
52
|
-
const b =
|
|
52
|
+
const r = _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, clamp01(m[0][0] * lr + m[0][1] * lg + m[0][2] * lb));
|
|
53
|
+
const g = _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, clamp01(m[1][0] * lr + m[1][1] * lg + m[1][2] * lb));
|
|
54
|
+
const b = _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, clamp01(m[2][0] * lr + m[2][1] * lg + m[2][2] * lb));
|
|
53
55
|
return { r, g, b, a: c.a };
|
|
54
56
|
}
|
|
55
57
|
function checkPaletteColors(colors, options = {}) {
|
|
@@ -57,8 +59,8 @@ function checkPaletteColors(colors, options = {}) {
|
|
|
57
59
|
const minDistance = _nullishCoalesce(options.minDistance, () => ( 0.08));
|
|
58
60
|
const minContrast = _nullishCoalesce(options.minContrast, () => ( 1.5));
|
|
59
61
|
const visions = _nullishCoalesce(options.visions, () => ( ["normal", "protanopia", "deuteranopia", "tritanopia"]));
|
|
60
|
-
const parsed = colors.map((c) =>
|
|
61
|
-
const surfaceParsed =
|
|
62
|
+
const parsed = colors.map((c) => _chunk5UEFBM2Mcjs.parseColor.call(void 0, c));
|
|
63
|
+
const surfaceParsed = _chunk5UEFBM2Mcjs.parseColor.call(void 0, surfaceStr);
|
|
62
64
|
const skipped = colors.filter((_, i) => !parsed[i]);
|
|
63
65
|
const issues = [];
|
|
64
66
|
const closest = {};
|
|
@@ -68,7 +70,7 @@ function checkPaletteColors(colors, options = {}) {
|
|
|
68
70
|
for (let a = 0; a < seen.length; a++) {
|
|
69
71
|
for (let b = a + 1; b < seen.length; b++) {
|
|
70
72
|
if (!seen[a] || !seen[b]) continue;
|
|
71
|
-
const distance =
|
|
73
|
+
const distance = _chunkTFF2GTGNcjs.deltaEOK.call(void 0, seen[a], seen[b]);
|
|
72
74
|
if (!best || distance < best.distance) {
|
|
73
75
|
best = {
|
|
74
76
|
a,
|
|
@@ -92,7 +94,7 @@ function checkPaletteColors(colors, options = {}) {
|
|
|
92
94
|
const contrast = colors.map((_, i) => {
|
|
93
95
|
const c = parsed[i];
|
|
94
96
|
if (!c || !surfaceParsed) return null;
|
|
95
|
-
const ratio =
|
|
97
|
+
const ratio = _chunk5UEFBM2Mcjs.contrastRatio.call(void 0, c, surfaceParsed);
|
|
96
98
|
return Math.round(ratio * 100) / 100;
|
|
97
99
|
});
|
|
98
100
|
contrast.forEach((ratio, i) => {
|
|
@@ -153,11 +155,11 @@ function hueToWheel(hue, wheel) {
|
|
|
153
155
|
function colorHarmony(base, kind, options = {}) {
|
|
154
156
|
const wheel = _nullishCoalesce(options.wheel, () => ( "ryb"));
|
|
155
157
|
const rgb = parseHex(base, "base");
|
|
156
|
-
const hsv =
|
|
158
|
+
const hsv = _chunk5UEFBM2Mcjs.rgbToHsv.call(void 0, rgb);
|
|
157
159
|
const start = hueToWheel(hsv.h, wheel);
|
|
158
160
|
const at = (angle) => {
|
|
159
161
|
const a = (angle % 360 + 360) % 360;
|
|
160
|
-
return { color: toHex(
|
|
162
|
+
return { color: toHex(_chunk5UEFBM2Mcjs.hsvToRgb.call(void 0, { ...hsv, h: wheelToHue(a, wheel) })), angle: Math.round(a * 10) / 10 };
|
|
161
163
|
};
|
|
162
164
|
const spread = _nullishCoalesce(options.spread, () => ( 30));
|
|
163
165
|
const offsets = {
|
|
@@ -169,10 +171,10 @@ function colorHarmony(base, kind, options = {}) {
|
|
|
169
171
|
square: [0, 90, 180, 270]
|
|
170
172
|
};
|
|
171
173
|
if (kind === "monochromatic") {
|
|
172
|
-
const hsl =
|
|
174
|
+
const hsl = _chunk5UEFBM2Mcjs.rgbToHsl.call(void 0, rgb);
|
|
173
175
|
const steps = [0, -0.3, -0.15, 0.15, 0.3];
|
|
174
176
|
return steps.map((d) => {
|
|
175
|
-
const c = d === 0 ? rgb :
|
|
177
|
+
const c = d === 0 ? rgb : _chunk5UEFBM2Mcjs.hslToRgb.call(void 0, { ...hsl, l: Math.min(0.97, Math.max(0.03, hsl.l + d)) });
|
|
176
178
|
return { color: toHex(c), angle: Math.round(start * 10) / 10 };
|
|
177
179
|
});
|
|
178
180
|
}
|
|
@@ -183,17 +185,17 @@ function colorHarmony(base, kind, options = {}) {
|
|
|
183
185
|
|
|
184
186
|
// src/color/mix.ts
|
|
185
187
|
function mixColors(from, to, t, options = {}) {
|
|
186
|
-
const c1 =
|
|
187
|
-
const c2 =
|
|
188
|
+
const c1 = _chunk5UEFBM2Mcjs.parseColor.call(void 0, from);
|
|
189
|
+
const c2 = _chunk5UEFBM2Mcjs.parseColor.call(void 0, to);
|
|
188
190
|
if (!c1 || !c2) return null;
|
|
189
191
|
const space = _nullishCoalesce(options.space, () => ( "oklab"));
|
|
190
192
|
const alpha = c1.a + (c2.a - c1.a) * t;
|
|
191
193
|
if (space === "oklab") {
|
|
192
|
-
const lab1 =
|
|
193
|
-
const lab2 =
|
|
194
|
+
const lab1 = _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, c1);
|
|
195
|
+
const lab2 = _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, c2);
|
|
194
196
|
if (alpha <= 1e-9) {
|
|
195
197
|
const lab3 = { l: lab1.l + (lab2.l - lab1.l) * t, a: 0, b: 0, alpha: 0 };
|
|
196
|
-
return
|
|
198
|
+
return _chunkTFF2GTGNcjs.formatHex.call(void 0, _chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, lab3));
|
|
197
199
|
}
|
|
198
200
|
const premul = (k) => lab1[k] * lab1.alpha + (lab2[k] * lab2.alpha - lab1[k] * lab1.alpha) * t;
|
|
199
201
|
const lab = {
|
|
@@ -202,11 +204,11 @@ function mixColors(from, to, t, options = {}) {
|
|
|
202
204
|
b: premul("b") / alpha,
|
|
203
205
|
alpha
|
|
204
206
|
};
|
|
205
|
-
return
|
|
207
|
+
return _chunkTFF2GTGNcjs.formatHex.call(void 0, _chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, lab));
|
|
206
208
|
}
|
|
207
209
|
if (space === "oklch") {
|
|
208
|
-
const lch1 =
|
|
209
|
-
const lch2 =
|
|
210
|
+
const lch1 = _chunk5UEFBM2Mcjs.oklabToOklch.call(void 0, _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, c1));
|
|
211
|
+
const lch2 = _chunk5UEFBM2Mcjs.oklabToOklch.call(void 0, _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, c2));
|
|
210
212
|
let h1 = lch1.h;
|
|
211
213
|
let h2 = lch2.h;
|
|
212
214
|
const diff = h2 - h1;
|
|
@@ -215,41 +217,41 @@ function mixColors(from, to, t, options = {}) {
|
|
|
215
217
|
const h = ((h1 + (h2 - h1) * t) % 360 + 360) % 360;
|
|
216
218
|
if (alpha <= 1e-9) {
|
|
217
219
|
const l2 = lch1.l + (lch2.l - lch1.l) * t;
|
|
218
|
-
return
|
|
220
|
+
return _chunkTFF2GTGNcjs.formatHex.call(void 0, _chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, _chunk5UEFBM2Mcjs.oklchToOklab.call(void 0, { l: l2, c: 0, h: 0, alpha: 0 })));
|
|
219
221
|
}
|
|
220
222
|
const lPremul = lch1.l * lch1.alpha + (lch2.l * lch2.alpha - lch1.l * lch1.alpha) * t;
|
|
221
223
|
const cPremul = lch1.c * lch1.alpha + (lch2.c * lch2.alpha - lch1.c * lch1.alpha) * t;
|
|
222
224
|
const l = lPremul / alpha;
|
|
223
225
|
const c = cPremul / alpha;
|
|
224
|
-
return
|
|
226
|
+
return _chunkTFF2GTGNcjs.formatHex.call(void 0, _chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, _chunk5UEFBM2Mcjs.oklchToOklab.call(void 0, { l, c, h, alpha })));
|
|
225
227
|
}
|
|
226
228
|
if (space === "srgb-linear") {
|
|
227
|
-
const lr1 =
|
|
228
|
-
const lg1 =
|
|
229
|
-
const lb1 =
|
|
230
|
-
const lr2 =
|
|
231
|
-
const lg2 =
|
|
232
|
-
const lb2 =
|
|
229
|
+
const lr1 = _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c1.r);
|
|
230
|
+
const lg1 = _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c1.g);
|
|
231
|
+
const lb1 = _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c1.b);
|
|
232
|
+
const lr2 = _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c2.r);
|
|
233
|
+
const lg2 = _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c2.g);
|
|
234
|
+
const lb2 = _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c2.b);
|
|
233
235
|
if (alpha <= 1e-9) {
|
|
234
|
-
return
|
|
235
|
-
r:
|
|
236
|
-
g:
|
|
237
|
-
b:
|
|
236
|
+
return _chunkTFF2GTGNcjs.formatHex.call(void 0, {
|
|
237
|
+
r: _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, lr1 + (lr2 - lr1) * t),
|
|
238
|
+
g: _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, lg1 + (lg2 - lg1) * t),
|
|
239
|
+
b: _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, lb1 + (lb2 - lb1) * t),
|
|
238
240
|
a: 0
|
|
239
241
|
});
|
|
240
242
|
}
|
|
241
243
|
const premulR2 = lr1 * c1.a + (lr2 * c2.a - lr1 * c1.a) * t;
|
|
242
244
|
const premulG2 = lg1 * c1.a + (lg2 * c2.a - lg1 * c1.a) * t;
|
|
243
245
|
const premulB2 = lb1 * c1.a + (lb2 * c2.a - lb1 * c1.a) * t;
|
|
244
|
-
return
|
|
245
|
-
r:
|
|
246
|
-
g:
|
|
247
|
-
b:
|
|
246
|
+
return _chunkTFF2GTGNcjs.formatHex.call(void 0, {
|
|
247
|
+
r: _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, premulR2 / alpha),
|
|
248
|
+
g: _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, premulG2 / alpha),
|
|
249
|
+
b: _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, premulB2 / alpha),
|
|
248
250
|
a: alpha
|
|
249
251
|
});
|
|
250
252
|
}
|
|
251
253
|
if (alpha <= 1e-9) {
|
|
252
|
-
return
|
|
254
|
+
return _chunkTFF2GTGNcjs.formatHex.call(void 0, {
|
|
253
255
|
r: c1.r + (c2.r - c1.r) * t,
|
|
254
256
|
g: c1.g + (c2.g - c1.g) * t,
|
|
255
257
|
b: c1.b + (c2.b - c1.b) * t,
|
|
@@ -259,7 +261,7 @@ function mixColors(from, to, t, options = {}) {
|
|
|
259
261
|
const premulR = c1.r * c1.a + (c2.r * c2.a - c1.r * c1.a) * t;
|
|
260
262
|
const premulG = c1.g * c1.a + (c2.g * c2.a - c1.g * c1.a) * t;
|
|
261
263
|
const premulB = c1.b * c1.a + (c2.b * c2.a - c1.b * c1.a) * t;
|
|
262
|
-
return
|
|
264
|
+
return _chunkTFF2GTGNcjs.formatHex.call(void 0, {
|
|
263
265
|
r: premulR / alpha,
|
|
264
266
|
g: premulG / alpha,
|
|
265
267
|
b: premulB / alpha,
|
|
@@ -269,9 +271,9 @@ function mixColors(from, to, t, options = {}) {
|
|
|
269
271
|
|
|
270
272
|
// src/color/recent.ts
|
|
271
273
|
function pushRecentColor(list, color, max = 12) {
|
|
272
|
-
const normal =
|
|
274
|
+
const normal = _chunkTFF2GTGNcjs.normalizeColor.call(void 0, color);
|
|
273
275
|
if (!normal) return list.slice();
|
|
274
|
-
const next = [normal, ...list.filter((c) =>
|
|
276
|
+
const next = [normal, ...list.filter((c) => _chunkTFF2GTGNcjs.normalizeColor.call(void 0, c) !== normal)];
|
|
275
277
|
return next.slice(0, max);
|
|
276
278
|
}
|
|
277
279
|
|
|
@@ -287,7 +289,7 @@ function isDualColor(value) {
|
|
|
287
289
|
function parseDualColor(input) {
|
|
288
290
|
if (input === null || input === void 0) return null;
|
|
289
291
|
if (isDualColor(input)) {
|
|
290
|
-
if (
|
|
292
|
+
if (_chunk5UEFBM2Mcjs.parseColor.call(void 0, input.light) === null || _chunk5UEFBM2Mcjs.parseColor.call(void 0, input.dark) === null) {
|
|
291
293
|
return null;
|
|
292
294
|
}
|
|
293
295
|
return { light: input.light, dark: input.dark };
|
|
@@ -321,12 +323,12 @@ function parseDualColor(input) {
|
|
|
321
323
|
const lightPart = inner.slice(0, commaIndex).trim();
|
|
322
324
|
const darkPart = inner.slice(commaIndex + 1).trim();
|
|
323
325
|
if (!lightPart || !darkPart) return null;
|
|
324
|
-
if (
|
|
326
|
+
if (_chunk5UEFBM2Mcjs.parseColor.call(void 0, lightPart) === null || _chunk5UEFBM2Mcjs.parseColor.call(void 0, darkPart) === null) {
|
|
325
327
|
return null;
|
|
326
328
|
}
|
|
327
329
|
return { light: lightPart, dark: darkPart };
|
|
328
330
|
}
|
|
329
|
-
if (
|
|
331
|
+
if (_chunk5UEFBM2Mcjs.parseColor.call(void 0, trimmed) !== null) {
|
|
330
332
|
return { light: trimmed, dark: trimmed };
|
|
331
333
|
}
|
|
332
334
|
}
|
|
@@ -335,8 +337,8 @@ function parseDualColor(input) {
|
|
|
335
337
|
function normalizeDualColor(input) {
|
|
336
338
|
const parsed = parseDualColor(input);
|
|
337
339
|
if (!parsed) return null;
|
|
338
|
-
const light =
|
|
339
|
-
const dark =
|
|
340
|
+
const light = _chunkTFF2GTGNcjs.normalizeColor.call(void 0, parsed.light);
|
|
341
|
+
const dark = _chunkTFF2GTGNcjs.normalizeColor.call(void 0, parsed.dark);
|
|
340
342
|
if (!light || !dark) return null;
|
|
341
343
|
return { light, dark };
|
|
342
344
|
}
|
|
@@ -346,22 +348,22 @@ function resolveColor(value, scheme) {
|
|
|
346
348
|
return scheme === "dark" ? normalized.dark : normalized.light;
|
|
347
349
|
}
|
|
348
350
|
function formatDualColor(value) {
|
|
349
|
-
const light = _nullishCoalesce(
|
|
350
|
-
const dark = _nullishCoalesce(
|
|
351
|
+
const light = _nullishCoalesce(_chunkTFF2GTGNcjs.normalizeColor.call(void 0, value.light), () => ( value.light));
|
|
352
|
+
const dark = _nullishCoalesce(_chunkTFF2GTGNcjs.normalizeColor.call(void 0, value.dark), () => ( value.dark));
|
|
351
353
|
if (light === dark) {
|
|
352
354
|
return light;
|
|
353
355
|
}
|
|
354
356
|
return `light-dark(${light}, ${dark})`;
|
|
355
357
|
}
|
|
356
358
|
function isSameInBothSchemes(value) {
|
|
357
|
-
const light =
|
|
358
|
-
const dark =
|
|
359
|
+
const light = _chunkTFF2GTGNcjs.normalizeColor.call(void 0, value.light);
|
|
360
|
+
const dark = _chunkTFF2GTGNcjs.normalizeColor.call(void 0, value.dark);
|
|
359
361
|
if (!light || !dark) return value.light === value.dark;
|
|
360
362
|
return light === dark;
|
|
361
363
|
}
|
|
362
364
|
function setDualColorSide(value, scheme, color) {
|
|
363
365
|
const base = _nullishCoalesce(normalizeDualColor(value), () => ( { light: "#000000", dark: "#000000" }));
|
|
364
|
-
const normColor = _nullishCoalesce(
|
|
366
|
+
const normColor = _nullishCoalesce(_chunkTFF2GTGNcjs.normalizeColor.call(void 0, color), () => ( color));
|
|
365
367
|
return {
|
|
366
368
|
light: scheme === "light" ? normColor : base.light,
|
|
367
369
|
dark: scheme === "dark" ? normColor : base.dark
|
|
@@ -369,35 +371,35 @@ function setDualColorSide(value, scheme, color) {
|
|
|
369
371
|
}
|
|
370
372
|
function deriveDualColor(color, options) {
|
|
371
373
|
const fromScheme = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _2 => _2.from]), () => ( "light"));
|
|
372
|
-
const baseRgba =
|
|
374
|
+
const baseRgba = _chunk5UEFBM2Mcjs.parseColor.call(void 0, color);
|
|
373
375
|
if (!baseRgba) {
|
|
374
376
|
throw new Error(`"${String(color)}" is not a colour; pass hex, rgb(), hsl(), oklch() or a CSS colour name.`);
|
|
375
377
|
}
|
|
376
378
|
if (_optionalChain([options, 'optionalAccess', _3 => _3.surfaces]) && !normalizeDualColor(options.surfaces)) {
|
|
377
379
|
throw new Error('The surfaces need a readable light and dark colour, e.g. { light: "#ffffff", dark: "#0b0b0f" }.');
|
|
378
380
|
}
|
|
379
|
-
const baseHex =
|
|
380
|
-
const lab =
|
|
381
|
-
const lch =
|
|
381
|
+
const baseHex = _chunkTFF2GTGNcjs.formatHex.call(void 0, baseRgba);
|
|
382
|
+
const lab = _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, baseRgba);
|
|
383
|
+
const lch = _chunk5UEFBM2Mcjs.oklabToOklch.call(void 0, lab);
|
|
382
384
|
const startL = clamp(1.05 - lch.l, 0.12, 0.95);
|
|
383
385
|
const targetC = lch.c * 0.9;
|
|
384
386
|
const targetH = lch.h;
|
|
385
387
|
let derivedHex;
|
|
386
388
|
if (_optionalChain([options, 'optionalAccess', _4 => _4.surfaces])) {
|
|
387
389
|
const surfaces = options.surfaces;
|
|
388
|
-
const fromSurfaceRgba =
|
|
390
|
+
const fromSurfaceRgba = _chunk5UEFBM2Mcjs.parseColor.call(void 0, surfaces[fromScheme]);
|
|
389
391
|
const targetScheme = fromScheme === "light" ? "dark" : "light";
|
|
390
|
-
const targetSurfaceRgba =
|
|
391
|
-
const targetRatio =
|
|
392
|
-
const targetSurfaceL =
|
|
392
|
+
const targetSurfaceRgba = _chunk5UEFBM2Mcjs.parseColor.call(void 0, surfaces[targetScheme]);
|
|
393
|
+
const targetRatio = _chunk5UEFBM2Mcjs.contrastRatio.call(void 0, baseRgba, fromSurfaceRgba);
|
|
394
|
+
const targetSurfaceL = _chunk5UEFBM2Mcjs.oklabToOklch.call(void 0, _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, targetSurfaceRgba)).l;
|
|
393
395
|
const preferHigherL = targetSurfaceL < 0.5;
|
|
394
396
|
let bestDiff = Infinity;
|
|
395
397
|
let bestL = startL;
|
|
396
398
|
for (let candL = 0.05; candL <= 0.98; candL += 5e-3) {
|
|
397
|
-
const candRgb =
|
|
398
|
-
|
|
399
|
+
const candRgb = _chunkTFF2GTGNcjs.toSrgbGamut.call(void 0,
|
|
400
|
+
_chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, _chunk5UEFBM2Mcjs.oklchToOklab.call(void 0, { l: candL, c: targetC, h: targetH, alpha: baseRgba.a }))
|
|
399
401
|
);
|
|
400
|
-
const ratio =
|
|
402
|
+
const ratio = _chunk5UEFBM2Mcjs.contrastRatio.call(void 0, candRgb, targetSurfaceRgba);
|
|
401
403
|
const diff = Math.abs(ratio - targetRatio);
|
|
402
404
|
const isBetter = diff < bestDiff - 1e-4 || Math.abs(diff - bestDiff) <= 1e-4 && (preferHigherL ? candL > bestL : candL < bestL);
|
|
403
405
|
if (isBetter) {
|
|
@@ -405,15 +407,15 @@ function deriveDualColor(color, options) {
|
|
|
405
407
|
bestL = candL;
|
|
406
408
|
}
|
|
407
409
|
}
|
|
408
|
-
const finalRgba =
|
|
409
|
-
|
|
410
|
+
const finalRgba = _chunkTFF2GTGNcjs.toSrgbGamut.call(void 0,
|
|
411
|
+
_chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, _chunk5UEFBM2Mcjs.oklchToOklab.call(void 0, { l: bestL, c: targetC, h: targetH, alpha: baseRgba.a }))
|
|
410
412
|
);
|
|
411
|
-
derivedHex =
|
|
413
|
+
derivedHex = _chunkTFF2GTGNcjs.formatHex.call(void 0, finalRgba);
|
|
412
414
|
} else {
|
|
413
|
-
const finalRgba =
|
|
414
|
-
|
|
415
|
+
const finalRgba = _chunkTFF2GTGNcjs.toSrgbGamut.call(void 0,
|
|
416
|
+
_chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, _chunk5UEFBM2Mcjs.oklchToOklab.call(void 0, { l: startL, c: targetC, h: targetH, alpha: baseRgba.a }))
|
|
415
417
|
);
|
|
416
|
-
derivedHex =
|
|
418
|
+
derivedHex = _chunkTFF2GTGNcjs.formatHex.call(void 0, finalRgba);
|
|
417
419
|
}
|
|
418
420
|
return fromScheme === "light" ? { light: baseHex, dark: derivedHex } : { light: derivedHex, dark: baseHex };
|
|
419
421
|
}
|
|
@@ -428,14 +430,14 @@ function checkDualColorContrast(foreground, background, options) {
|
|
|
428
430
|
const lightBgHex = bg.light;
|
|
429
431
|
const darkFgHex = fg.dark;
|
|
430
432
|
const darkBgHex = bg.dark;
|
|
431
|
-
const lightFg =
|
|
432
|
-
const lightBg =
|
|
433
|
-
const darkFg =
|
|
434
|
-
const darkBg =
|
|
435
|
-
const lightRatio = Math.round(
|
|
436
|
-
const darkRatio = Math.round(
|
|
437
|
-
const lightLevel =
|
|
438
|
-
const darkLevel =
|
|
433
|
+
const lightFg = _chunk5UEFBM2Mcjs.parseColor.call(void 0, lightFgHex);
|
|
434
|
+
const lightBg = _chunk5UEFBM2Mcjs.parseColor.call(void 0, lightBgHex);
|
|
435
|
+
const darkFg = _chunk5UEFBM2Mcjs.parseColor.call(void 0, darkFgHex);
|
|
436
|
+
const darkBg = _chunk5UEFBM2Mcjs.parseColor.call(void 0, darkBgHex);
|
|
437
|
+
const lightRatio = Math.round(_chunk5UEFBM2Mcjs.contrastRatio.call(void 0, lightFg, lightBg) * 100) / 100;
|
|
438
|
+
const darkRatio = Math.round(_chunk5UEFBM2Mcjs.contrastRatio.call(void 0, darkFg, darkBg) * 100) / 100;
|
|
439
|
+
const lightLevel = _chunk5UEFBM2Mcjs.contrastLevel.call(void 0, lightRatio, { large });
|
|
440
|
+
const darkLevel = _chunk5UEFBM2Mcjs.contrastLevel.call(void 0, darkRatio, { large });
|
|
439
441
|
const issues = [];
|
|
440
442
|
if (lightLevel === "fail") {
|
|
441
443
|
issues.push(
|
|
@@ -552,7 +554,7 @@ function requireColor(input, name) {
|
|
|
552
554
|
if (typeof input !== "string" || !input.trim()) {
|
|
553
555
|
fail(`"${String(input)}" is not a colour I can read; use hex (#2a4b8d), rgb(), hsl(), oklch() or a CSS colour name.`);
|
|
554
556
|
}
|
|
555
|
-
const parsed =
|
|
557
|
+
const parsed = _chunk5UEFBM2Mcjs.parseColor.call(void 0, input);
|
|
556
558
|
if (!parsed) {
|
|
557
559
|
fail(`"${input}" is not a colour I can read; use hex (#2a4b8d), rgb(), hsl(), oklch() or a CSS colour name.`);
|
|
558
560
|
}
|
|
@@ -565,7 +567,7 @@ function requireDualColor(input, name) {
|
|
|
565
567
|
}
|
|
566
568
|
return parsed;
|
|
567
569
|
}
|
|
568
|
-
var findAccessibleLightness = (fg, bg, large) =>
|
|
570
|
+
var findAccessibleLightness = (fg, bg, large) => _chunkTFF2GTGNcjs.suggestAccessibleForeground.call(void 0, fg, bg, { large });
|
|
569
571
|
function createColorToolProvider(options = {}) {
|
|
570
572
|
const id = _nullishCoalesce(options.id, () => ( "color"));
|
|
571
573
|
const namespace = _nullishCoalesce(options.namespace, () => ( "color"));
|
|
@@ -585,18 +587,18 @@ function createColorToolProvider(options = {}) {
|
|
|
585
587
|
handler: (args) => {
|
|
586
588
|
const { color } = args;
|
|
587
589
|
const rgba = requireColor(color, "color");
|
|
588
|
-
const inGamut =
|
|
589
|
-
const mappedRgba = inGamut ? rgba :
|
|
590
|
-
const hsl =
|
|
591
|
-
const oklab =
|
|
592
|
-
const oklch =
|
|
590
|
+
const inGamut = _chunkTFF2GTGNcjs.inSrgbGamut.call(void 0, rgba);
|
|
591
|
+
const mappedRgba = inGamut ? rgba : _chunkTFF2GTGNcjs.toSrgbGamut.call(void 0, rgba);
|
|
592
|
+
const hsl = _chunk5UEFBM2Mcjs.rgbToHsl.call(void 0, mappedRgba);
|
|
593
|
+
const oklab = _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, rgba);
|
|
594
|
+
const oklch = _chunk5UEFBM2Mcjs.oklabToOklch.call(void 0, oklab);
|
|
593
595
|
const formats = ["hex", "rgb", "hsl", "oklab", "oklch"];
|
|
594
596
|
const css = {};
|
|
595
597
|
for (const f of formats) {
|
|
596
|
-
css[f] =
|
|
598
|
+
css[f] = _chunkTFF2GTGNcjs.formatColor.call(void 0, rgba, f);
|
|
597
599
|
}
|
|
598
600
|
return {
|
|
599
|
-
hex:
|
|
601
|
+
hex: _chunkTFF2GTGNcjs.formatHex.call(void 0, mappedRgba),
|
|
600
602
|
alpha: Math.round(rgba.a * 1e3) / 1e3,
|
|
601
603
|
rgb: {
|
|
602
604
|
r: Math.round(Math.min(1, Math.max(0, mappedRgba.r)) * 255),
|
|
@@ -615,8 +617,8 @@ function createColorToolProvider(options = {}) {
|
|
|
615
617
|
},
|
|
616
618
|
css,
|
|
617
619
|
inSrgbGamut: inGamut,
|
|
618
|
-
...inGamut ? {} : { gamutMappedHex:
|
|
619
|
-
relativeLuminance: Math.round(
|
|
620
|
+
...inGamut ? {} : { gamutMappedHex: _chunkTFF2GTGNcjs.formatHex.call(void 0, mappedRgba) },
|
|
621
|
+
relativeLuminance: Math.round(_chunk5UEFBM2Mcjs.relativeLuminance.call(void 0, mappedRgba) * 1e4) / 1e4
|
|
620
622
|
};
|
|
621
623
|
}
|
|
622
624
|
};
|
|
@@ -639,11 +641,11 @@ function createColorToolProvider(options = {}) {
|
|
|
639
641
|
const { foreground, background, large = false } = args;
|
|
640
642
|
const fg = requireColor(foreground, "foreground");
|
|
641
643
|
const bg = requireColor(background, "background");
|
|
642
|
-
const ratio = Math.round(
|
|
643
|
-
const level =
|
|
644
|
+
const ratio = Math.round(_chunk5UEFBM2Mcjs.contrastRatio.call(void 0, fg, bg) * 100) / 100;
|
|
645
|
+
const level = _chunk5UEFBM2Mcjs.contrastLevel.call(void 0, ratio, { large });
|
|
644
646
|
const passesAA = level === "AA" || level === "AAA";
|
|
645
647
|
const passesAAA = level === "AAA";
|
|
646
|
-
const suggestion = passesAA ? void 0 :
|
|
648
|
+
const suggestion = passesAA ? void 0 : _chunkTFF2GTGNcjs.suggestAccessibleForeground.call(void 0, fg, bg, { large });
|
|
647
649
|
return {
|
|
648
650
|
ratio,
|
|
649
651
|
level,
|
|
@@ -725,7 +727,7 @@ function createColorToolProvider(options = {}) {
|
|
|
725
727
|
handler: (args) => {
|
|
726
728
|
const { base, kind, wheel = "rgb", spread } = args;
|
|
727
729
|
const rgba = requireColor(base, "base");
|
|
728
|
-
const hex =
|
|
730
|
+
const hex = _chunkTFF2GTGNcjs.formatHex.call(void 0, _chunkTFF2GTGNcjs.toSrgbGamut.call(void 0, rgba));
|
|
729
731
|
if (!HARMONY_KINDS.includes(kind)) {
|
|
730
732
|
fail(`Unknown harmony kind "${kind}"; expected one of ${HARMONY_KINDS.join(", ")}.`);
|
|
731
733
|
}
|
|
@@ -830,10 +832,10 @@ function createColorToolProvider(options = {}) {
|
|
|
830
832
|
from,
|
|
831
833
|
surfaces: keepContrast ? resolvedSurfaces : void 0
|
|
832
834
|
});
|
|
833
|
-
const lightSurfaceRgba =
|
|
834
|
-
const darkSurfaceRgba =
|
|
835
|
-
const lightRatio = Math.round(
|
|
836
|
-
const darkRatio = Math.round(
|
|
835
|
+
const lightSurfaceRgba = _chunk5UEFBM2Mcjs.parseColor.call(void 0, resolvedSurfaces.light);
|
|
836
|
+
const darkSurfaceRgba = _chunk5UEFBM2Mcjs.parseColor.call(void 0, resolvedSurfaces.dark);
|
|
837
|
+
const lightRatio = Math.round(_chunk5UEFBM2Mcjs.contrastRatio.call(void 0, _chunk5UEFBM2Mcjs.parseColor.call(void 0, derived.light), lightSurfaceRgba) * 100) / 100;
|
|
838
|
+
const darkRatio = Math.round(_chunk5UEFBM2Mcjs.contrastRatio.call(void 0, _chunk5UEFBM2Mcjs.parseColor.call(void 0, derived.dark), darkSurfaceRgba) * 100) / 100;
|
|
837
839
|
return {
|
|
838
840
|
light: derived.light,
|
|
839
841
|
dark: derived.dark,
|
|
@@ -876,16 +878,16 @@ function createColorToolProvider(options = {}) {
|
|
|
876
878
|
const res = checkDualColorContrast(fg, bg, { large });
|
|
877
879
|
let suggestion;
|
|
878
880
|
if (res.light.level === "fail") {
|
|
879
|
-
const lightFg =
|
|
880
|
-
const lightBg =
|
|
881
|
+
const lightFg = _chunk5UEFBM2Mcjs.parseColor.call(void 0, fg.light);
|
|
882
|
+
const lightBg = _chunk5UEFBM2Mcjs.parseColor.call(void 0, bg.light);
|
|
881
883
|
const fixed = findAccessibleLightness(lightFg, lightBg, large);
|
|
882
884
|
if (fixed) {
|
|
883
885
|
suggestion = { ..._nullishCoalesce(suggestion, () => ( {})), light: fixed };
|
|
884
886
|
}
|
|
885
887
|
}
|
|
886
888
|
if (res.dark.level === "fail") {
|
|
887
|
-
const darkFg =
|
|
888
|
-
const darkBg =
|
|
889
|
+
const darkFg = _chunk5UEFBM2Mcjs.parseColor.call(void 0, fg.dark);
|
|
890
|
+
const darkBg = _chunk5UEFBM2Mcjs.parseColor.call(void 0, bg.dark);
|
|
889
891
|
const fixed = findAccessibleLightness(darkFg, darkBg, large);
|
|
890
892
|
if (fixed) {
|
|
891
893
|
suggestion = { ..._nullishCoalesce(suggestion, () => ( {})), dark: fixed };
|
|
@@ -969,13 +971,13 @@ function pickerStateFromColor(input, previous) {
|
|
|
969
971
|
if (typeof input === "object" && "r" in input && "g" in input && "b" in input) {
|
|
970
972
|
rgba = input;
|
|
971
973
|
} else if (typeof input === "string") {
|
|
972
|
-
rgba =
|
|
974
|
+
rgba = _chunk5UEFBM2Mcjs.parseColor.call(void 0, input);
|
|
973
975
|
} else {
|
|
974
976
|
return null;
|
|
975
977
|
}
|
|
976
978
|
if (!rgba) return null;
|
|
977
|
-
const clampedRgba =
|
|
978
|
-
const hsva =
|
|
979
|
+
const clampedRgba = _chunkTFF2GTGNcjs.toSrgbGamut.call(void 0, rgba);
|
|
980
|
+
const hsva = _chunk5UEFBM2Mcjs.rgbToHsv.call(void 0, clampedRgba);
|
|
979
981
|
let h = hsva.h;
|
|
980
982
|
let s = hsva.s;
|
|
981
983
|
const v = hsva.v;
|
|
@@ -996,13 +998,13 @@ function pickerStateFromColor(input, previous) {
|
|
|
996
998
|
};
|
|
997
999
|
}
|
|
998
1000
|
function pickerStateToHex(state, forceAlpha = false) {
|
|
999
|
-
const rgba =
|
|
1001
|
+
const rgba = _chunk5UEFBM2Mcjs.hsvToRgb.call(void 0, {
|
|
1000
1002
|
h: state.h,
|
|
1001
1003
|
s: state.s,
|
|
1002
1004
|
v: state.v,
|
|
1003
1005
|
alpha: state.alpha
|
|
1004
1006
|
});
|
|
1005
|
-
const hex =
|
|
1007
|
+
const hex = _chunkTFF2GTGNcjs.formatHex.call(void 0, rgba);
|
|
1006
1008
|
if (forceAlpha && hex.length === 7) {
|
|
1007
1009
|
return hex + "ff";
|
|
1008
1010
|
}
|
|
@@ -1091,13 +1093,13 @@ function pickerKeyStep(state, target, key, shift) {
|
|
|
1091
1093
|
}
|
|
1092
1094
|
}
|
|
1093
1095
|
function pickerAreaBackground(state) {
|
|
1094
|
-
const pureHueRgb =
|
|
1095
|
-
const hueHex =
|
|
1096
|
+
const pureHueRgb = _chunk5UEFBM2Mcjs.hsvToRgb.call(void 0, { h: state.h, s: 1, v: 1, alpha: 1 });
|
|
1097
|
+
const hueHex = _chunkTFF2GTGNcjs.formatHex.call(void 0, pureHueRgb);
|
|
1096
1098
|
return `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${hueHex})`;
|
|
1097
1099
|
}
|
|
1098
1100
|
function pickerAlphaBackground(state) {
|
|
1099
|
-
const opaqueRgb =
|
|
1100
|
-
const hex =
|
|
1101
|
+
const opaqueRgb = _chunk5UEFBM2Mcjs.hsvToRgb.call(void 0, { h: state.h, s: state.s, v: state.v, alpha: 1 });
|
|
1102
|
+
const hex = _chunkTFF2GTGNcjs.formatHex.call(void 0, opaqueRgb);
|
|
1101
1103
|
return `linear-gradient(to right, transparent, ${hex})`;
|
|
1102
1104
|
}
|
|
1103
1105
|
var PICKER_HUE_BACKGROUND = "linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)";
|