@a_ng_d/utils-ui-color-palette 1.4.0 → 1.4.1
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/formats/makeCssCustomProps.d.ts.map +1 -1
- package/dist/formats/makeCsv.d.ts +2 -2
- package/dist/formats/makeCsv.d.ts.map +1 -1
- package/dist/formats/makeDtcgTokens.d.ts.map +1 -1
- package/dist/formats/makeLessVariables.d.ts.map +1 -1
- package/dist/formats/makeScssVariables.d.ts.map +1 -1
- package/dist/modules/data/data.d.ts +1 -0
- package/dist/modules/data/data.d.ts.map +1 -1
- package/dist/modules/data/data.js +189 -163
- package/dist/modules/data/data.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var M = Object.defineProperty;
|
|
2
2
|
var E = (c, r, s) => r in c ? M(c, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : c[r] = s;
|
|
3
|
-
var
|
|
4
|
-
import { C as
|
|
3
|
+
var u = (c, r, s) => E(c, typeof r != "symbol" ? r + "" : r, s);
|
|
4
|
+
import { C as d, H as C } from "../../color-1CXTuV84.js";
|
|
5
5
|
import { c as p } from "../../index-Beb8qoyd.js";
|
|
6
6
|
const S = (c) => {
|
|
7
7
|
const r = c.themes.filter((o) => o.type === "custom theme").length === 0 ? c.themes.filter((o) => o.type === "default theme") : c.themes.filter((o) => o.type === "custom theme"), s = {}, a = (o) => ({
|
|
@@ -250,6 +250,7 @@ public extension Color {
|
|
|
250
250
|
}, A = (c, r) => {
|
|
251
251
|
const s = c.themes.filter((e) => e.type === "custom theme").length === 0 ? c.themes.filter((e) => e.type === "default theme") : c.themes.filter((e) => e.type === "custom theme"), a = [], h = (e) => {
|
|
252
252
|
var l;
|
|
253
|
+
e.hsl[0] === null && (e.hsl[0] = 0), e.lch[2] === null && (e.lch[2] = 0);
|
|
253
254
|
const t = {
|
|
254
255
|
RGB: () => `rgb(${Math.floor(e.rgb[0])}, ${Math.floor(
|
|
255
256
|
e.rgb[1]
|
|
@@ -267,45 +268,45 @@ public extension Color {
|
|
|
267
268
|
};
|
|
268
269
|
return (l = t[r ?? "RGB"]) == null ? void 0 : l.call(t);
|
|
269
270
|
}, o = (e, t) => {
|
|
270
|
-
var
|
|
271
|
+
var i;
|
|
271
272
|
const l = {
|
|
272
273
|
RGB: () => {
|
|
273
|
-
var
|
|
274
|
+
var n;
|
|
274
275
|
return `rgba(${Math.floor(t.rgb[0])}, ${Math.floor(
|
|
275
276
|
t.rgb[1]
|
|
276
|
-
)}, ${Math.floor(t.rgb[2])}, ${((
|
|
277
|
+
)}, ${Math.floor(t.rgb[2])}, ${((n = e.alpha) == null ? void 0 : n.toFixed(2)) ?? 1})`;
|
|
277
278
|
},
|
|
278
279
|
HEX: () => p(t.hex).alpha(e.alpha ?? 1).hex(),
|
|
279
280
|
HSL: () => {
|
|
280
|
-
var
|
|
281
|
+
var n;
|
|
281
282
|
return `hsla(${Math.floor(t.hsl[0])}, ${Math.floor(
|
|
282
283
|
t.hsl[1] * 100
|
|
283
|
-
)}%, ${Math.floor(t.hsl[2] * 100)}%, ${((
|
|
284
|
+
)}%, ${Math.floor(t.hsl[2] * 100)}%, ${((n = e.alpha) == null ? void 0 : n.toFixed(2)) ?? 1})`;
|
|
284
285
|
},
|
|
285
286
|
LCH: () => {
|
|
286
|
-
var
|
|
287
|
+
var n;
|
|
287
288
|
return `lch(${Math.floor(t.lch[0])}% ${Math.floor(
|
|
288
289
|
t.lch[1]
|
|
289
|
-
)} ${Math.floor(t.lch[2])} / ${((
|
|
290
|
+
)} ${Math.floor(t.lch[2])} / ${((n = e.alpha) == null ? void 0 : n.toFixed(2)) ?? 1})`;
|
|
290
291
|
},
|
|
291
292
|
P3: () => {
|
|
292
|
-
var
|
|
293
|
+
var n;
|
|
293
294
|
return `color(display-p3 ${t.gl[0].toFixed(3)}, ${t.gl[1].toFixed(
|
|
294
295
|
3
|
|
295
|
-
)}, ${t.gl[2].toFixed(3)}, ${((
|
|
296
|
+
)}, ${t.gl[2].toFixed(3)}, ${((n = e.alpha) == null ? void 0 : n.toFixed(2)) ?? 1})`;
|
|
296
297
|
}
|
|
297
298
|
};
|
|
298
|
-
return (
|
|
299
|
+
return (i = l[r ?? "RGB"]) == null ? void 0 : i.call(l);
|
|
299
300
|
};
|
|
300
301
|
return s.forEach((e) => {
|
|
301
302
|
const t = [];
|
|
302
303
|
e.type === "custom theme" && (t.push(`// ${e.name} mode`), t.push(`@mixin ${new f(e.name).doCamelCase()}-mode {`)), e.colors.forEach((l) => {
|
|
303
|
-
t.push(`// ${l.name}`), l.shades.reverse().forEach((
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
` ${m}: ${
|
|
304
|
+
t.push(`// ${l.name}`), l.shades.reverse().forEach((i) => {
|
|
305
|
+
const n = l.shades.find((b) => b.type === "source color"), m = `$${new f(l.name).doKebabCase()}-${i.name}`;
|
|
306
|
+
n && (e.type === "custom theme" ? t.push(
|
|
307
|
+
` ${m}: ${i.isTransparent ? o(i, n) : h(i)};`
|
|
307
308
|
) : t.push(
|
|
308
|
-
`${m}: ${
|
|
309
|
+
`${m}: ${i.isTransparent ? o(i, n) : h(i)};`
|
|
309
310
|
));
|
|
310
311
|
}), t.push("");
|
|
311
312
|
}), e.type === "custom theme" && t.push("}"), a.push(t.join(`
|
|
@@ -313,9 +314,9 @@ public extension Color {
|
|
|
313
314
|
}), a.push(`
|
|
314
315
|
// Color modes map
|
|
315
316
|
$modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
316
|
-
const
|
|
317
|
+
const i = new f(e.name).doKebabCase();
|
|
317
318
|
a.push(
|
|
318
|
-
` '${
|
|
319
|
+
` '${i}': ${new f(e.name).doCamelCase()}-mode${t < l.length - 1 ? "," : ""}`
|
|
319
320
|
);
|
|
320
321
|
}), a.push(`);
|
|
321
322
|
|
|
@@ -394,7 +395,8 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
394
395
|
}), JSON.stringify(s, null, " ");
|
|
395
396
|
}, K = (c, r) => {
|
|
396
397
|
const s = c.themes.filter((t) => t.type === "custom theme").length === 0 ? c.themes.filter((t) => t.type === "default theme") : c.themes.filter((t) => t.type === "custom theme"), a = [], h = (t) => {
|
|
397
|
-
var
|
|
398
|
+
var i;
|
|
399
|
+
t.hsl[0] === null && (t.hsl[0] = 0), t.lch[2] === null && (t.lch[2] = 0);
|
|
398
400
|
const l = {
|
|
399
401
|
RGB: () => `rgb(${Math.floor(t.rgb[0])}, ${Math.floor(
|
|
400
402
|
t.rgb[1]
|
|
@@ -410,10 +412,10 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
410
412
|
3
|
|
411
413
|
)}, ${t.gl[2].toFixed(3)})`
|
|
412
414
|
};
|
|
413
|
-
return (
|
|
415
|
+
return (i = l[r ?? "RGB"]) == null ? void 0 : i.call(l);
|
|
414
416
|
}, o = (t, l) => {
|
|
415
|
-
var
|
|
416
|
-
const
|
|
417
|
+
var n;
|
|
418
|
+
const i = {
|
|
417
419
|
RGB: () => {
|
|
418
420
|
var m;
|
|
419
421
|
return `rgba(${Math.floor(l.rgb[0])}, ${Math.floor(
|
|
@@ -440,17 +442,17 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
440
442
|
)}, ${l.gl[2].toFixed(3)}, ${((m = t.alpha) == null ? void 0 : m.toFixed(2)) ?? 1})`;
|
|
441
443
|
}
|
|
442
444
|
};
|
|
443
|
-
return (
|
|
445
|
+
return (n = i[r ?? "RGB"]) == null ? void 0 : n.call(i);
|
|
444
446
|
}, e = s.find(
|
|
445
447
|
(t) => t.type === "default theme"
|
|
446
448
|
);
|
|
447
449
|
if (e) {
|
|
448
450
|
const t = [];
|
|
449
451
|
e.colors.forEach((l) => {
|
|
450
|
-
t.push(`// ${l.name}`), l.shades.reverse().forEach((
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
`${m}: ${
|
|
452
|
+
t.push(`// ${l.name}`), l.shades.reverse().forEach((i) => {
|
|
453
|
+
const n = l.shades.find((b) => b.type === "source color"), m = `@${new f(l.name).doKebabCase()}-${i.name}`;
|
|
454
|
+
n && t.push(
|
|
455
|
+
`${m}: ${i.isTransparent ? o(i, n) : h(i)};`
|
|
454
456
|
);
|
|
455
457
|
}), t.push("");
|
|
456
458
|
}), a.push(t.join(`
|
|
@@ -462,15 +464,15 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
462
464
|
// ${t.name} mode
|
|
463
465
|
#${l} {
|
|
464
466
|
.mode() {`);
|
|
465
|
-
const
|
|
466
|
-
t.colors.forEach((
|
|
467
|
-
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
` ${x}: ${m.isTransparent ? o(m,
|
|
467
|
+
const i = [];
|
|
468
|
+
t.colors.forEach((n) => {
|
|
469
|
+
i.push(` // ${n.name}`), n.shades.reverse().forEach((m) => {
|
|
470
|
+
const b = n.shades.find(($) => $.type === "source color"), x = `@${new f(n.name).doKebabCase()}-${m.name}`;
|
|
471
|
+
b && i.push(
|
|
472
|
+
` ${x}: ${m.isTransparent ? o(m, b) : h(m)};`
|
|
471
473
|
);
|
|
472
|
-
}),
|
|
473
|
-
}),
|
|
474
|
+
}), i.push("");
|
|
475
|
+
}), i.length > 0 && i.pop(), a.push(i.join(`
|
|
474
476
|
`)), a.push(` }
|
|
475
477
|
}`);
|
|
476
478
|
}), a.push(`
|
|
@@ -504,9 +506,10 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
504
506
|
}`), a.join(`
|
|
505
507
|
|
|
506
508
|
`);
|
|
507
|
-
},
|
|
509
|
+
}, j = (c, r) => {
|
|
508
510
|
const s = c.themes.filter((e) => e.type === "custom theme").length === 0 ? c.themes.filter((e) => e.type === "default theme") : c.themes.filter((e) => e.type === "custom theme"), a = {}, h = (e) => {
|
|
509
511
|
var l;
|
|
512
|
+
e.oklch[2] === null && (e.oklch[2] = 0);
|
|
510
513
|
const t = {
|
|
511
514
|
RGB: () => ({
|
|
512
515
|
colorSpace: "srgb",
|
|
@@ -529,7 +532,7 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
529
532
|
};
|
|
530
533
|
return (l = t[r ?? "RGB"]) == null ? void 0 : l.call(t);
|
|
531
534
|
}, o = (e, t) => {
|
|
532
|
-
var
|
|
535
|
+
var i;
|
|
533
536
|
const l = {
|
|
534
537
|
RGB: () => ({
|
|
535
538
|
colorSpace: "srgb",
|
|
@@ -552,43 +555,62 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
552
555
|
alpha: t.alpha
|
|
553
556
|
})
|
|
554
557
|
};
|
|
555
|
-
return (
|
|
558
|
+
return (i = l[r ?? "RGB"]) == null ? void 0 : i.call(l);
|
|
556
559
|
};
|
|
557
560
|
return s[0].type === "custom theme" ? s.forEach((e) => {
|
|
558
561
|
e.colors.forEach((t) => {
|
|
559
562
|
const l = t.shades.find(
|
|
560
|
-
(
|
|
563
|
+
(i) => i.type === "source color"
|
|
561
564
|
);
|
|
562
565
|
a[t.name] || (a[t.name] = {
|
|
563
566
|
$type: "color"
|
|
564
|
-
}), t.shades.forEach((
|
|
565
|
-
!a[t.name][
|
|
567
|
+
}), t.shades.forEach((i) => {
|
|
568
|
+
!a[t.name][i.name] && l && (a[t.name][i.name] = {
|
|
566
569
|
$type: "color",
|
|
567
|
-
$value:
|
|
568
|
-
$description: t.description !== "" ? t.description + " - " +
|
|
570
|
+
$value: i.isTransparent ? o(l, i) : h(i),
|
|
571
|
+
$description: t.description !== "" ? t.description + " - " + i.description : i.description,
|
|
569
572
|
$extensions: {
|
|
570
573
|
mode: {}
|
|
571
574
|
}
|
|
572
|
-
}), l && (a[t.name][
|
|
575
|
+
}), l && (a[t.name][i.name].$extensions.mode[e.name] = i.isTransparent ? o(l, i) : h(i));
|
|
573
576
|
});
|
|
574
577
|
});
|
|
575
578
|
}) : s.forEach((e) => {
|
|
576
579
|
e.colors.forEach((t) => {
|
|
577
580
|
const l = t.shades.find(
|
|
578
|
-
(
|
|
581
|
+
(i) => i.type === "source color"
|
|
579
582
|
);
|
|
580
|
-
a[t.name] = {}, t.shades.forEach((
|
|
581
|
-
|
|
583
|
+
a[t.name] = {}, t.shades.forEach((i) => {
|
|
584
|
+
i && l && (a[t.name][i.name] = {
|
|
582
585
|
$type: "color",
|
|
583
|
-
$value:
|
|
584
|
-
$description: t.description !== "" ? t.description + " - " +
|
|
586
|
+
$value: i.isTransparent ? o(l, i) : h(i),
|
|
587
|
+
$description: t.description !== "" ? t.description + " - " + i.description : i.description
|
|
585
588
|
});
|
|
586
589
|
});
|
|
587
590
|
});
|
|
588
591
|
}), JSON.stringify(a, null, " ");
|
|
589
|
-
},
|
|
592
|
+
}, N = (c) => {
|
|
593
|
+
const r = c.themes.filter((l) => l.type === "custom theme").length === 0 ? c.themes.filter((l) => l.type === "default theme") : c.themes.filter((l) => l.type === "custom theme"), s = [], a = [], h = [], o = [], e = [], t = [];
|
|
594
|
+
return r.forEach((l) => {
|
|
595
|
+
l.colors.forEach((i) => {
|
|
596
|
+
i.shades.forEach((n) => {
|
|
597
|
+
h.push(n.name), o.push(Math.floor(n.lch[0])), e.push(Math.floor(n.lch[1])), t.push(Math.floor(n.lch[2]));
|
|
598
|
+
}), s.push({
|
|
599
|
+
name: i.name,
|
|
600
|
+
csv: `${i.name},Lightness,Chroma,Hue
|
|
601
|
+
${h.map((n, m) => `${n},${o[m]},${e[m]},${t[m]}`).join(`
|
|
602
|
+
`)}`
|
|
603
|
+
}), h.splice(0, h.length), o.splice(0, o.length), e.splice(0, e.length), t.splice(0, t.length);
|
|
604
|
+
}), a.push({
|
|
605
|
+
name: l.name,
|
|
606
|
+
colors: s.map((i) => i),
|
|
607
|
+
type: l.type
|
|
608
|
+
}), s.splice(0, s.length);
|
|
609
|
+
}), a;
|
|
610
|
+
}, G = (c, r) => {
|
|
590
611
|
const s = c.themes.filter((e) => e.type === "custom theme").length === 0 ? c.themes.filter((e) => e.type === "default theme") : c.themes.filter((e) => e.type === "custom theme"), a = [], h = (e) => {
|
|
591
612
|
var l;
|
|
613
|
+
e.hsl[0] === null && (e.hsl[0] = 0), e.lch[2] === null && (e.lch[2] = 0);
|
|
592
614
|
const t = {
|
|
593
615
|
RGB: () => `rgb(${Math.floor(e.rgb[0])}, ${Math.floor(
|
|
594
616
|
e.rgb[1]
|
|
@@ -606,43 +628,43 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
606
628
|
};
|
|
607
629
|
return (l = t[r ?? "RGB"]) == null ? void 0 : l.call(t);
|
|
608
630
|
}, o = (e, t) => {
|
|
609
|
-
var
|
|
631
|
+
var i;
|
|
610
632
|
const l = {
|
|
611
633
|
RGB: () => {
|
|
612
|
-
var
|
|
634
|
+
var n;
|
|
613
635
|
return `rgb(${Math.floor(t.rgb[0])}, ${Math.floor(
|
|
614
636
|
t.rgb[1]
|
|
615
|
-
)}, ${Math.floor(t.rgb[2])} / ${((
|
|
637
|
+
)}, ${Math.floor(t.rgb[2])} / ${((n = e.alpha) == null ? void 0 : n.toFixed(2)) ?? 1})`;
|
|
616
638
|
},
|
|
617
639
|
HEX: () => p(t.hex).alpha(e.alpha ?? 1).hex(),
|
|
618
640
|
HSL: () => {
|
|
619
|
-
var
|
|
641
|
+
var n;
|
|
620
642
|
return `hsl(${Math.floor(t.hsl[0])} ${Math.floor(
|
|
621
643
|
t.hsl[1] * 100
|
|
622
|
-
)}% ${Math.floor(t.hsl[2] * 100)}% / ${((
|
|
644
|
+
)}% ${Math.floor(t.hsl[2] * 100)}% / ${((n = e.alpha) == null ? void 0 : n.toFixed(2)) ?? 1})`;
|
|
623
645
|
},
|
|
624
646
|
LCH: () => {
|
|
625
|
-
var
|
|
647
|
+
var n;
|
|
626
648
|
return `lch(${Math.floor(t.lch[0])}% ${Math.floor(
|
|
627
649
|
t.lch[1]
|
|
628
|
-
)} ${Math.floor(t.lch[2])} / ${((
|
|
650
|
+
)} ${Math.floor(t.lch[2])} / ${((n = e.alpha) == null ? void 0 : n.toFixed(2)) ?? 1})`;
|
|
629
651
|
},
|
|
630
652
|
P3: () => {
|
|
631
|
-
var
|
|
653
|
+
var n;
|
|
632
654
|
return `color(display-p3 ${t.gl[0].toFixed(3)} ${t.gl[1].toFixed(
|
|
633
655
|
3
|
|
634
|
-
)} ${t.gl[2].toFixed(3)} / ${((
|
|
656
|
+
)} ${t.gl[2].toFixed(3)} / ${((n = e.alpha) == null ? void 0 : n.toFixed(2)) ?? 1})`;
|
|
635
657
|
}
|
|
636
658
|
};
|
|
637
|
-
return (
|
|
659
|
+
return (i = l[r ?? "RGB"]) == null ? void 0 : i.call(l);
|
|
638
660
|
};
|
|
639
661
|
return s.forEach((e) => {
|
|
640
662
|
const t = [];
|
|
641
663
|
e.colors.forEach((l) => {
|
|
642
|
-
t.push(`/* ${l.name} */`), l.shades.reverse().forEach((
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
`--${new f(l.name).doKebabCase()}-${
|
|
664
|
+
t.push(`/* ${l.name} */`), l.shades.reverse().forEach((i) => {
|
|
665
|
+
const n = l.shades.find((m) => m.type === "source color");
|
|
666
|
+
n && t.push(
|
|
667
|
+
`--${new f(l.name).doKebabCase()}-${i.name}: ${i.isTransparent ? o(i, n) : h(i)};`
|
|
646
668
|
);
|
|
647
669
|
}), t.push("");
|
|
648
670
|
}), t.pop(), a.push(
|
|
@@ -654,7 +676,7 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
654
676
|
}), a.join(`
|
|
655
677
|
|
|
656
678
|
`);
|
|
657
|
-
},
|
|
679
|
+
}, _ = (c) => {
|
|
658
680
|
const r = c.themes.filter((a) => a.type === "custom theme").length === 0 ? c.themes.filter((a) => a.type === "default theme") : c.themes.filter((a) => a.type === "custom theme"), s = [];
|
|
659
681
|
return r.forEach((a) => {
|
|
660
682
|
a.colors.forEach((h) => {
|
|
@@ -672,18 +694,18 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
|
|
|
672
694
|
${s.join(`
|
|
673
695
|
`)}`;
|
|
674
696
|
};
|
|
675
|
-
class
|
|
697
|
+
class O {
|
|
676
698
|
constructor({
|
|
677
699
|
base: r,
|
|
678
700
|
themes: s,
|
|
679
701
|
meta: a
|
|
680
702
|
}) {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
703
|
+
u(this, "base");
|
|
704
|
+
u(this, "themes");
|
|
705
|
+
u(this, "meta");
|
|
706
|
+
u(this, "paletteData");
|
|
707
|
+
u(this, "currentScale");
|
|
708
|
+
u(this, "makePaletteData", () => (this.themes.forEach((r) => {
|
|
687
709
|
const s = {
|
|
688
710
|
id: r.id,
|
|
689
711
|
name: r.name,
|
|
@@ -692,21 +714,21 @@ class D {
|
|
|
692
714
|
type: r.type
|
|
693
715
|
};
|
|
694
716
|
this.base.colors.forEach((a) => {
|
|
695
|
-
const h = Object.entries(r.scale).reverse().map((
|
|
717
|
+
const h = Object.entries(r.scale).reverse().map((n) => {
|
|
696
718
|
if (a.alpha.isEnabled) {
|
|
697
|
-
const m = new
|
|
719
|
+
const m = new d({
|
|
698
720
|
render: "RGB",
|
|
699
721
|
sourceColor: [
|
|
700
722
|
a.rgb.r * 255,
|
|
701
723
|
a.rgb.g * 255,
|
|
702
724
|
a.rgb.b * 255
|
|
703
725
|
],
|
|
704
|
-
alpha: parseFloat((
|
|
726
|
+
alpha: parseFloat((n[1] / 100).toFixed(2)),
|
|
705
727
|
hueShifting: a.hue.shift !== void 0 ? a.hue.shift : 0,
|
|
706
728
|
chromaShifting: a.chroma.shift !== void 0 ? a.chroma.shift : 100,
|
|
707
729
|
algorithmVersion: this.base.algorithmVersion,
|
|
708
730
|
visionSimulationMode: r.visionSimulationMode
|
|
709
|
-
}),
|
|
731
|
+
}), b = new d({
|
|
710
732
|
render: "RGB",
|
|
711
733
|
sourceColor: p(a.alpha.backgroundColor).rgb(),
|
|
712
734
|
algorithmVersion: this.base.algorithmVersion,
|
|
@@ -715,76 +737,76 @@ class D {
|
|
|
715
737
|
switch (this.base.colorSpace) {
|
|
716
738
|
case "LCH":
|
|
717
739
|
return this.base.areSourceColorsLocked ? [
|
|
718
|
-
|
|
740
|
+
n,
|
|
719
741
|
m.setColorWithAlpha(),
|
|
720
|
-
|
|
742
|
+
b.setColorWithAlpha()
|
|
721
743
|
] : [
|
|
722
|
-
|
|
744
|
+
n,
|
|
723
745
|
m.lcha(),
|
|
724
|
-
|
|
746
|
+
b.lcha()
|
|
725
747
|
];
|
|
726
748
|
case "OKLCH":
|
|
727
749
|
return this.base.areSourceColorsLocked ? [
|
|
728
|
-
|
|
750
|
+
n,
|
|
729
751
|
m.setColorWithAlpha(),
|
|
730
|
-
|
|
752
|
+
b.setColorWithAlpha()
|
|
731
753
|
] : [
|
|
732
|
-
|
|
754
|
+
n,
|
|
733
755
|
m.oklcha(),
|
|
734
|
-
|
|
756
|
+
b.oklcha()
|
|
735
757
|
];
|
|
736
758
|
case "LAB":
|
|
737
759
|
return this.base.areSourceColorsLocked ? [
|
|
738
|
-
|
|
760
|
+
n,
|
|
739
761
|
m.setColorWithAlpha(),
|
|
740
|
-
|
|
762
|
+
b.setColorWithAlpha()
|
|
741
763
|
] : [
|
|
742
|
-
|
|
764
|
+
n,
|
|
743
765
|
m.laba(),
|
|
744
|
-
|
|
766
|
+
b.laba()
|
|
745
767
|
];
|
|
746
768
|
case "OKLAB":
|
|
747
769
|
return this.base.areSourceColorsLocked ? [
|
|
748
|
-
|
|
770
|
+
n,
|
|
749
771
|
m.setColorWithAlpha(),
|
|
750
|
-
|
|
772
|
+
b.setColorWithAlpha()
|
|
751
773
|
] : [
|
|
752
|
-
|
|
774
|
+
n,
|
|
753
775
|
m.oklaba(),
|
|
754
|
-
|
|
776
|
+
b.oklaba()
|
|
755
777
|
];
|
|
756
778
|
case "HSL":
|
|
757
779
|
return this.base.areSourceColorsLocked ? [
|
|
758
|
-
|
|
780
|
+
n,
|
|
759
781
|
m.setColorWithAlpha(),
|
|
760
|
-
|
|
782
|
+
b.setColorWithAlpha()
|
|
761
783
|
] : [
|
|
762
|
-
|
|
784
|
+
n,
|
|
763
785
|
m.hsla(),
|
|
764
|
-
|
|
786
|
+
b.hsla()
|
|
765
787
|
];
|
|
766
788
|
case "HSLUV":
|
|
767
789
|
return this.base.areSourceColorsLocked ? [
|
|
768
|
-
|
|
790
|
+
n,
|
|
769
791
|
m.setColorWithAlpha(),
|
|
770
|
-
|
|
792
|
+
b.setColorWithAlpha()
|
|
771
793
|
] : [
|
|
772
|
-
|
|
794
|
+
n,
|
|
773
795
|
m.hsluva(),
|
|
774
|
-
|
|
796
|
+
b.hsluva()
|
|
775
797
|
];
|
|
776
798
|
default:
|
|
777
|
-
return [
|
|
799
|
+
return [n, [0, 0, 0], [255, 255, 255]];
|
|
778
800
|
}
|
|
779
801
|
} else {
|
|
780
|
-
const m = new
|
|
802
|
+
const m = new d({
|
|
781
803
|
render: "RGB",
|
|
782
804
|
sourceColor: [
|
|
783
805
|
a.rgb.r * 255,
|
|
784
806
|
a.rgb.g * 255,
|
|
785
807
|
a.rgb.b * 255
|
|
786
808
|
],
|
|
787
|
-
lightness:
|
|
809
|
+
lightness: n[1],
|
|
788
810
|
hueShifting: a.hue.shift !== void 0 ? a.hue.shift : 0,
|
|
789
811
|
chromaShifting: a.chroma.shift !== void 0 ? a.chroma.shift : 100,
|
|
790
812
|
algorithmVersion: this.base.algorithmVersion,
|
|
@@ -792,19 +814,19 @@ class D {
|
|
|
792
814
|
});
|
|
793
815
|
switch (this.base.colorSpace) {
|
|
794
816
|
case "LCH":
|
|
795
|
-
return [
|
|
817
|
+
return [n, m.lch()];
|
|
796
818
|
case "OKLCH":
|
|
797
|
-
return [
|
|
819
|
+
return [n, m.oklch()];
|
|
798
820
|
case "LAB":
|
|
799
|
-
return [
|
|
821
|
+
return [n, m.lab()];
|
|
800
822
|
case "OKLAB":
|
|
801
|
-
return [
|
|
823
|
+
return [n, m.oklab()];
|
|
802
824
|
case "HSL":
|
|
803
|
-
return [
|
|
825
|
+
return [n, m.hsl()];
|
|
804
826
|
case "HSLUV":
|
|
805
|
-
return [
|
|
827
|
+
return [n, m.hsluv()];
|
|
806
828
|
default:
|
|
807
|
-
return [
|
|
829
|
+
return [n, [0, 0, 0]];
|
|
808
830
|
}
|
|
809
831
|
}
|
|
810
832
|
}), o = {
|
|
@@ -837,68 +859,68 @@ class D {
|
|
|
837
859
|
type: "source color"
|
|
838
860
|
});
|
|
839
861
|
const l = h.map(
|
|
840
|
-
(
|
|
862
|
+
(n) => p.distance(
|
|
841
863
|
p(e).hex(),
|
|
842
|
-
p(
|
|
864
|
+
p(n[1]).hex(),
|
|
843
865
|
"rgb"
|
|
844
866
|
)
|
|
845
|
-
),
|
|
846
|
-
h.forEach((
|
|
847
|
-
const
|
|
867
|
+
), i = l.indexOf(Math.min(...l));
|
|
868
|
+
h.forEach((n, m) => {
|
|
869
|
+
const b = p.distance(
|
|
848
870
|
p(e).hex(),
|
|
849
|
-
p(
|
|
871
|
+
p(n[1]).hex(),
|
|
850
872
|
"rgb"
|
|
851
873
|
), x = Object.keys(this.currentScale).find(
|
|
852
|
-
(F) => F ===
|
|
853
|
-
) ?? "0",
|
|
874
|
+
(F) => F === n[0][0]
|
|
875
|
+
) ?? "0", $ = new C(), y = new d({
|
|
854
876
|
render: "RGB",
|
|
855
877
|
sourceColor: p(e).rgb(),
|
|
856
878
|
visionSimulationMode: r.visionSimulationMode
|
|
857
|
-
}).setColor(),
|
|
879
|
+
}).setColor(), g = new d({
|
|
858
880
|
render: "HEX",
|
|
859
881
|
sourceColor: p(e).rgb(),
|
|
860
882
|
visionSimulationMode: r.visionSimulationMode
|
|
861
883
|
}).setColor();
|
|
862
|
-
m ===
|
|
884
|
+
m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? ($.rgb_r = Number(y[0]) / 255, $.rgb_g = Number(y[1]) / 255, $.rgb_b = Number(y[2]) / 255) : ($.rgb_r = Number(n[1][0]) / 255, $.rgb_g = Number(n[1][1]) / 255, $.rgb_b = Number(n[1][2]) / 255), $.rgbToHsluv(), o.shades.push({
|
|
863
885
|
name: x,
|
|
864
|
-
description: `Shade/Tint color with ${typeof
|
|
865
|
-
hex: m ===
|
|
866
|
-
rgb: m ===
|
|
867
|
-
gl: m ===
|
|
868
|
-
lch: m ===
|
|
869
|
-
oklch: m ===
|
|
870
|
-
lab: m ===
|
|
871
|
-
oklab: m ===
|
|
872
|
-
hsl: m ===
|
|
873
|
-
hsluv: [
|
|
874
|
-
alpha: a.alpha.isEnabled ? parseFloat((
|
|
875
|
-
backgroundColor: a.alpha.isEnabled && a.alpha.backgroundColor ? p(
|
|
876
|
-
mixedColor: a.alpha.isEnabled && a.alpha.backgroundColor ? new
|
|
886
|
+
description: `Shade/Tint color with ${typeof n[0][1] == "number" ? n[0][1].toFixed(1) : n[0][1]}% of ${a.alpha.isEnabled ? "opacity" : "lightness"}`,
|
|
887
|
+
hex: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).hex() : p(n[1]).hex(),
|
|
888
|
+
rgb: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).rgb() : p(n[1]).rgb(),
|
|
889
|
+
gl: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).gl() : p(n[1]).gl(),
|
|
890
|
+
lch: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).lch() : p(n[1]).lch(),
|
|
891
|
+
oklch: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).oklch() : p(n[1]).oklch(),
|
|
892
|
+
lab: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).lab() : p(n[1]).lab(),
|
|
893
|
+
oklab: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).oklab() : p(n[1]).oklab(),
|
|
894
|
+
hsl: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).hsl() : p(n[1]).hsl(),
|
|
895
|
+
hsluv: [$.hsluv_h, $.hsluv_s, $.hsluv_l],
|
|
896
|
+
alpha: a.alpha.isEnabled ? parseFloat((n[0][1] / 100).toFixed(2)) : void 0,
|
|
897
|
+
backgroundColor: a.alpha.isEnabled && a.alpha.backgroundColor ? p(n[2]).rgb() : void 0,
|
|
898
|
+
mixedColor: a.alpha.isEnabled && a.alpha.backgroundColor ? new d({
|
|
877
899
|
visionSimulationMode: r.visionSimulationMode
|
|
878
900
|
}).mixColorsRgb(
|
|
879
901
|
[
|
|
880
|
-
...
|
|
902
|
+
...n[1],
|
|
881
903
|
parseFloat(
|
|
882
|
-
(
|
|
904
|
+
(n[0][1] / 100).toFixed(2)
|
|
883
905
|
)
|
|
884
906
|
],
|
|
885
|
-
[...
|
|
907
|
+
[...n[2], 1]
|
|
886
908
|
) : void 0,
|
|
887
|
-
isClosestToRef:
|
|
888
|
-
isSourceColorLocked: m ===
|
|
909
|
+
isClosestToRef: b < 4 && !this.base.areSourceColorsLocked,
|
|
910
|
+
isSourceColorLocked: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled,
|
|
889
911
|
isTransparent: a.alpha.isEnabled,
|
|
890
912
|
type: "color shade/tint"
|
|
891
913
|
});
|
|
892
914
|
}), s.colors.push(o);
|
|
893
915
|
}), this.paletteData.themes.push(s);
|
|
894
916
|
}), this.paletteData));
|
|
895
|
-
|
|
917
|
+
u(this, "makeLibraryData", (r, s) => {
|
|
896
918
|
const a = this.makePaletteData();
|
|
897
919
|
return a.themes.flatMap(
|
|
898
920
|
(o) => o.colors.flatMap(
|
|
899
921
|
(e) => e.shades.flatMap((t) => {
|
|
900
|
-
const l = `${o.id}:${e.id}:${t.name}`,
|
|
901
|
-
(
|
|
922
|
+
const l = `${o.id}:${e.id}:${t.name}`, i = s == null ? void 0 : s.find(
|
|
923
|
+
(n) => n.id === l
|
|
902
924
|
);
|
|
903
925
|
return {
|
|
904
926
|
id: l,
|
|
@@ -913,71 +935,75 @@ class D {
|
|
|
913
935
|
description: e.description
|
|
914
936
|
},
|
|
915
937
|
...(r == null ? void 0 : r.includes("collection_id")) && {
|
|
916
|
-
collectionId:
|
|
938
|
+
collectionId: i == null ? void 0 : i.collectionId
|
|
917
939
|
},
|
|
918
940
|
...(r == null ? void 0 : r.includes("mode_id")) && {
|
|
919
|
-
modeId:
|
|
941
|
+
modeId: i == null ? void 0 : i.modeId
|
|
920
942
|
},
|
|
921
943
|
...(r == null ? void 0 : r.includes("variable_id")) && {
|
|
922
|
-
variableId:
|
|
944
|
+
variableId: i == null ? void 0 : i.variableId
|
|
923
945
|
},
|
|
924
946
|
...(r == null ? void 0 : r.includes("style_id")) && {
|
|
925
|
-
styleId:
|
|
947
|
+
styleId: i == null ? void 0 : i.styleId
|
|
926
948
|
}
|
|
927
949
|
};
|
|
928
950
|
})
|
|
929
951
|
)
|
|
930
952
|
);
|
|
931
953
|
});
|
|
932
|
-
|
|
954
|
+
u(this, "makeNativeTokens", () => {
|
|
933
955
|
const r = this.makePaletteData();
|
|
934
956
|
return B(r);
|
|
935
957
|
});
|
|
936
|
-
|
|
958
|
+
u(this, "makeDtcgTokens", (r = "RGB") => {
|
|
937
959
|
const s = this.makePaletteData();
|
|
938
|
-
return
|
|
960
|
+
return j(s, r);
|
|
939
961
|
});
|
|
940
|
-
|
|
962
|
+
u(this, "makeStyleDictionaryTokens", () => {
|
|
941
963
|
const r = this.makePaletteData();
|
|
942
964
|
return P(r);
|
|
943
965
|
});
|
|
944
|
-
|
|
966
|
+
u(this, "makeUniversalJson", () => {
|
|
945
967
|
const r = this.makePaletteData();
|
|
946
968
|
return S(r);
|
|
947
969
|
});
|
|
948
|
-
|
|
970
|
+
u(this, "makeCssCustomProps", (r = "RGB") => {
|
|
949
971
|
const s = this.makePaletteData();
|
|
950
|
-
return
|
|
972
|
+
return G(s, r);
|
|
951
973
|
});
|
|
952
|
-
|
|
974
|
+
u(this, "makeScssVariable", (r = "RGB") => {
|
|
953
975
|
const s = this.makePaletteData();
|
|
954
976
|
return A(s, r);
|
|
955
977
|
});
|
|
956
|
-
|
|
978
|
+
u(this, "makeLessVariables", (r = "RGB") => {
|
|
957
979
|
const s = this.makePaletteData();
|
|
958
980
|
return K(s, r);
|
|
959
981
|
});
|
|
960
|
-
|
|
982
|
+
u(this, "makeTailwindConfig", () => {
|
|
961
983
|
const r = this.makePaletteData();
|
|
962
984
|
return L(r);
|
|
963
985
|
});
|
|
964
|
-
|
|
986
|
+
u(this, "makeSwiftUI", () => {
|
|
965
987
|
const r = this.makePaletteData();
|
|
966
988
|
return H(r);
|
|
967
989
|
});
|
|
968
|
-
|
|
990
|
+
u(this, "makeUIKit", () => {
|
|
969
991
|
const r = this.makePaletteData();
|
|
970
992
|
return T(r);
|
|
971
993
|
});
|
|
972
|
-
|
|
994
|
+
u(this, "makeCompose", () => {
|
|
973
995
|
const r = this.makePaletteData();
|
|
974
|
-
return
|
|
996
|
+
return _(r);
|
|
975
997
|
});
|
|
976
|
-
|
|
998
|
+
u(this, "makeResources", () => {
|
|
977
999
|
const r = this.makePaletteData();
|
|
978
1000
|
return R(r);
|
|
979
1001
|
});
|
|
980
|
-
|
|
1002
|
+
u(this, "makeCsv", () => {
|
|
1003
|
+
const r = this.makePaletteData();
|
|
1004
|
+
return N(r);
|
|
1005
|
+
});
|
|
1006
|
+
u(this, "makePaletteFullData", () => ({
|
|
981
1007
|
base: this.base,
|
|
982
1008
|
themes: this.themes,
|
|
983
1009
|
libraryData: this.makeLibraryData(),
|
|
@@ -995,6 +1021,6 @@ class D {
|
|
|
995
1021
|
}
|
|
996
1022
|
}
|
|
997
1023
|
export {
|
|
998
|
-
|
|
1024
|
+
O as default
|
|
999
1025
|
};
|
|
1000
1026
|
//# sourceMappingURL=data.js.map
|