@a_ng_d/utils-ui-color-palette 1.5.14 → 1.6.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.
@@ -1,1085 +1,323 @@
1
- var N = Object.defineProperty;
2
- var w = (m, l, n) => l in m ? N(m, l, { enumerable: !0, configurable: !0, writable: !0, value: n }) : m[l] = n;
3
- var k = (m, l, n) => w(m, typeof l != "symbol" ? l + "" : l, n);
4
- import { C as x, H as M } from "../../color-1CXTuV84.js";
5
- import { c as u } from "../../index-Beb8qoyd.js";
6
- const S = (m) => {
7
- const l = m.themes.filter((a) => a.type === "custom theme").length === 0 ? m.themes.filter((a) => a.type === "default theme") : m.themes.filter((a) => a.type === "custom theme"), n = {}, t = (a) => (isNaN(a.hsl[0]) && (a.hsl[0] = 0), isNaN(a.lch[2]) && (a.lch[2] = 0), isNaN(a.oklch[2]) && (a.oklch[2] = 0), {
8
- rgb: {
9
- r: Math.floor(a.rgb[0]),
10
- g: Math.floor(a.rgb[1]),
11
- b: Math.floor(a.rgb[2])
12
- },
13
- gl: {
14
- r: parseFloat(a.gl[0].toFixed(3)),
15
- g: parseFloat(a.gl[1].toFixed(3)),
16
- b: parseFloat(a.gl[2].toFixed(3))
17
- },
18
- lch: {
19
- l: Math.floor(a.lch[0]),
20
- c: Math.floor(a.lch[1]),
21
- h: Math.floor(a.lch[2])
22
- },
23
- oklch: {
24
- l: parseFloat(a.oklch[0].toFixed(3)),
25
- c: parseFloat(a.oklch[1].toFixed(3)),
26
- h: Math.floor(a.oklch[2])
27
- },
28
- lab: {
29
- l: Math.floor(a.lab[0]),
30
- a: Math.floor(a.lab[1]),
31
- b: Math.floor(a.lab[2])
32
- },
33
- oklab: {
34
- l: parseFloat(a.oklab[0].toFixed(3)),
35
- a: parseFloat(a.oklab[1].toFixed(3)),
36
- b: parseFloat(a.oklab[2].toFixed(3))
37
- },
38
- hsl: {
39
- h: Math.floor(a.hsl[0]),
40
- s: Math.floor(a.hsl[1] * 100),
41
- l: Math.floor(a.hsl[2] * 100)
42
- },
43
- hsluv: {
44
- h: Math.floor(a.hsluv[0]),
45
- s: Math.floor(a.hsluv[1]),
46
- l: Math.floor(a.hsluv[2])
47
- },
48
- hex: a.hex,
49
- description: a.description,
50
- type: "color shade/tint"
51
- }), i = (a, e) => ({
52
- rgb: {
53
- r: Math.floor(e.rgb[0]),
54
- g: Math.floor(e.rgb[1]),
55
- b: Math.floor(e.rgb[2])
56
- },
57
- gl: {
58
- r: parseFloat(e.gl[0].toFixed(3)),
59
- g: parseFloat(e.gl[1].toFixed(3)),
60
- b: parseFloat(e.gl[2].toFixed(3))
61
- },
62
- lch: {
63
- l: Math.floor(e.lch[0]),
64
- c: Math.floor(e.lch[1]),
65
- h: Math.floor(e.lch[2])
66
- },
67
- oklch: {
68
- l: parseFloat(e.oklch[0].toFixed(3)),
69
- c: parseFloat(e.oklch[1].toFixed(3)),
70
- h: Math.floor(e.oklch[2])
71
- },
72
- lab: {
73
- l: Math.floor(e.lab[0]),
74
- a: Math.floor(e.lab[1]),
75
- b: Math.floor(e.lab[2])
76
- },
77
- oklab: {
78
- l: parseFloat(e.oklab[0].toFixed(3)),
79
- a: parseFloat(e.oklab[1].toFixed(3)),
80
- b: parseFloat(e.oklab[2].toFixed(3))
81
- },
82
- hsl: {
83
- h: Math.floor(e.hsl[0]),
84
- s: Math.floor(e.hsl[1] * 100),
85
- l: Math.floor(e.hsl[2] * 100)
86
- },
87
- hsluv: {
88
- h: Math.floor(e.hsluv[0]),
89
- s: Math.floor(e.hsluv[1]),
90
- l: Math.floor(e.hsluv[2])
91
- },
92
- hex: e.hex,
93
- alpha: a.alpha,
94
- description: a.description,
95
- type: "color shade/tint"
96
- });
97
- return l[0].type === "custom theme" ? l.forEach((a) => {
98
- n[a.name] = {}, a.colors.forEach((e) => {
99
- const o = e.shades.find(
100
- (c) => c.type === "source color"
101
- );
102
- n[a.name][e.name] = {}, e.shades.forEach((c) => {
103
- c && o && (n[a.name][e.name][c.name] = c.isTransparent ? i(c, o) : t(c));
104
- }), n[a.name][e.name].description = e.description, n[a.name][e.name].type = "color";
105
- }), n[a.name].description = a.description, n[a.name].type = "color mode";
106
- }) : l.forEach((a) => {
107
- a.colors.forEach((e) => {
108
- const o = e.shades.find(
109
- (c) => c.type === "source color"
110
- );
111
- n[e.name] = {}, e.shades.forEach((c) => {
112
- c && o && (n[e.name][c.name] = c.isTransparent ? i(c, o) : t(c));
113
- }), n[e.name].description = e.description, n[e.name].type = "color";
114
- });
115
- }), n.description = m.description, n.type = "color palette", JSON.stringify(n, null, " ");
116
- };
117
- var v = Object.defineProperty, T = (m, l, n) => l in m ? v(m, l, { enumerable: !0, configurable: !0, writable: !0, value: n }) : m[l] = n, y = (m, l, n) => T(m, typeof l != "symbol" ? l + "" : l, n);
118
- class b {
119
- constructor(l) {
120
- y(this, "string"), y(this, "doSnakeCase", () => this.string.toLowerCase().split(" ").join("_").replace(/[@/$^%#&!?.,;:+=<>(){}"«»]/g, "")), y(this, "doPascalCase", () => this.string.charAt(0).toUpperCase() + this.string.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (n) => n.toUpperCase()).replace(/[@/$^%#&!?.,;:+=<>(){}"«» ]/g, "").slice(1)), y(this, "doKebabCase", () => this.string.toLowerCase().split(" ").join("-").replace(/[@/$^%#&!?.,;:+=<>(){}"«»]/g, "")), y(this, "doCamelCase", () => this.string.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (n) => n.toUpperCase()).replace(/[@/$^%#&!?.,;:+=<>(){}"«» ]/g, "")), this.string = l;
121
- }
122
- }
123
- const L = (m) => {
124
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = [];
125
- return l.forEach((t) => {
126
- const i = [];
127
- t.colors.forEach((a) => {
128
- const e = a.shades.find((o) => o.type === "source color");
129
- i.push(`// ${a.name}`), a.shades.reverse().forEach((o) => {
130
- i.push(
131
- o.isTransparent ? `static let ${new b(a.name).doPascalCase()}${o.name === "source" ? "Source" : o.name} = UIColor(red: ${e == null ? void 0 : e.gl[0].toFixed(
132
- 3
133
- )}, green: ${e == null ? void 0 : e.gl[1].toFixed(3)}, blue: ${e == null ? void 0 : e.gl[2].toFixed(
134
- 3
135
- )}, alpha: ${o.alpha ?? 1})` : `static let ${new b(a.name).doPascalCase()}${o.name === "source" ? "Source" : o.name} = UIColor(red: ${o.gl[0].toFixed(
136
- 3
137
- )}, green: ${o.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
138
- 3
139
- )})`
140
- );
141
- }), i.push("");
142
- }), i.pop(), l[0].type === "custom theme" ? n.push(
143
- `// ${t.name}
144
- struct ${new b(t.name).doPascalCase()} {
145
- ${i.join(
146
- `
147
- `
148
- )}
149
- }`
150
- ) : n.push(`${i.join(`
151
- `)}`);
152
- }), `import UIKit
153
-
154
- struct Color {
155
- ${n.join(`
156
-
157
- `)}
158
- }`;
159
- }, H = (m) => {
160
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme");
161
- let n = `@import "tailwindcss";
162
-
163
- @theme {
164
- --color-*: initial;
165
-
166
- `;
167
- return l[0].type !== "custom theme" ? l.forEach((t) => {
168
- t.colors.forEach((i) => {
169
- const a = i.shades.find(
170
- (r) => r.type === "source color"
171
- ), e = new b(i.name).doKebabCase();
172
- n += ` /* ${i.name} */
173
- `, i.shades.sort().forEach((r) => {
174
- const h = r.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(r.alpha ?? 1).hex() : r.hex, s = new b(r.name).doKebabCase();
175
- n += ` --color-${e}-${s}: ${h};
176
- `;
177
- });
178
- const o = i === t.colors[t.colors.length - 1], c = t === l[l.length - 1];
179
- o && c || (n += `
180
- `);
181
- });
182
- }) : l.forEach((t) => {
183
- const i = new b(t.name).doKebabCase();
184
- t.colors.forEach((a) => {
185
- const e = a.shades.find(
186
- (h) => h.type === "source color"
187
- ), o = new b(a.name).doKebabCase();
188
- n += ` /* ${t.name} - ${a.name} */
189
- `, a.shades.forEach((h) => {
190
- const s = h.isTransparent ? u((e == null ? void 0 : e.hex) ?? "#000000").alpha(h.alpha ?? 1).hex() : h.hex, p = new b(h.name).doKebabCase();
191
- n += ` --color-${i}-${o}-${p}: ${s};
192
- `;
193
- });
194
- const c = a === t.colors[t.colors.length - 1], r = t === l[l.length - 1];
195
- c && r || (n += `
196
- `);
197
- });
198
- }), n += `}
199
- `, n;
200
- }, K = (m) => {
201
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = {
202
- theme: {
203
- colors: {}
204
- }
205
- };
206
- return m.themes[0].colors.forEach((t) => {
207
- n.theme.colors[new b(t.name).doKebabCase()] = {};
208
- }), l[0].type === "custom theme" ? l.forEach((t) => {
209
- t.colors.forEach((i) => {
210
- const a = i.shades.find(
211
- (e) => e.type === "source color"
212
- );
213
- n.theme.colors[new b(i.name).doKebabCase()][new b(t.name).doKebabCase()] = {}, i.shades.forEach((e) => {
214
- n.theme.colors[new b(i.name).doKebabCase()][new b(t.name).doKebabCase()][new b(e.name).doKebabCase()] = e.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
215
- });
216
- });
217
- }) : l.forEach((t) => {
218
- t.colors.forEach((i) => {
219
- const a = i.shades.find(
220
- (e) => e.type === "source color"
221
- );
222
- n.theme.colors[new b(i.name).doKebabCase()] = {}, i.shades.sort().forEach((e) => {
223
- n.theme.colors[new b(i.name).doKebabCase()][new b(e.name).doKebabCase()] = e.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
224
- });
225
- });
226
- }), `/** @type {import('tailwindcss').Config} */
227
-
228
- module.exports = ${JSON.stringify(
229
- n,
230
- null,
231
- " "
232
- )}`;
233
- }, A = (m) => {
234
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = [];
235
- return l.forEach((t) => {
236
- t.colors.forEach((i) => {
237
- const a = i.shades.find((o) => o.type === "source color"), e = [];
238
- e.push(
239
- `// ${l[0].type === "custom theme" ? t.name + " - " : ""}${i.name}`
240
- ), i.shades.reverse().forEach((o) => {
241
- e.push(
242
- o.isTransparent ? `public let ${l[0].type === "custom theme" ? new b(t.name + " " + i.name).doPascalCase() : new b(i.name).doPascalCase()}${o.name === "source" ? "Source" : o.name} = Color(red: ${a == null ? void 0 : a.gl[0].toFixed(
243
- 3
244
- )}, green: ${a == null ? void 0 : a.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
245
- 3
246
- )}).opacity(${o.alpha ?? 1})` : `public let ${l[0].type === "custom theme" ? new b(t.name + " " + i.name).doPascalCase() : new b(i.name).doPascalCase()}${o.name === "source" ? "Source" : o.name} = Color(red: ${o.gl[0].toFixed(
247
- 3
248
- )}, green: ${o.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
249
- 3
250
- )})`
251
- );
252
- }), e.push(""), e.forEach((o) => n.push(o));
253
- });
254
- }), n.pop(), `import SwiftUI
255
-
256
- public extension Color {
257
- static let Token = Color.TokenColor()
258
- struct TokenColor {
259
- ${n.join(
260
- `
261
- `
262
- )}
263
- }
264
- }`;
265
- }, V = (m) => {
266
- const l = m.themes.filter((i) => i.type === "custom theme").length === 0 ? m.themes.filter((i) => i.type === "default theme") : m.themes.filter((i) => i.type === "custom theme"), n = {
267
- color: {}
268
- }, t = (i, a, e) => ({
269
- type: "color",
270
- value: a.isTransparent ? u(e.hex).alpha(a.alpha ?? 1).hex() : a.hex,
271
- comment: i.description !== "" ? i.description + " - " + a.description : a.description
272
- });
273
- return m.themes[0].colors.forEach((i) => {
274
- n.color[i.name] = {};
275
- }), l[0].type === "custom theme" ? l.forEach((i) => {
276
- i.colors.forEach((a) => {
277
- const e = a.shades.find(
278
- (o) => o.type === "source color"
279
- );
280
- n.color[a.name][i.name] = {}, a.shades.forEach((o) => {
281
- o && e && (n.color[a.name][i.name][o.name] = t(
282
- a,
283
- o,
284
- e
285
- ));
286
- });
287
- });
288
- }) : l.forEach((i) => {
289
- i.colors.forEach((a) => {
290
- const e = a.shades.find(
291
- (o) => o.type === "source color"
292
- );
293
- n.color[a.name] = {}, a.shades.forEach((o) => {
294
- o && e && (n.color[a.name][o.name] = t(a, o, e));
295
- });
296
- });
297
- }), JSON.stringify(n, null, " ");
298
- }, P = (m, l) => {
299
- const n = m.themes.filter((s) => s.type === "custom theme").length === 0 ? m.themes.filter((s) => s.type === "default theme") : m.themes.filter((s) => s.type === "custom theme"), t = [], i = [], a = (s) => {
300
- var f;
301
- isNaN(s.hsl[0]) && (s.hsl[0] = 0), isNaN(s.lch[2]) && (s.lch[2] = 0), isNaN(s.oklch[2]) && (s.oklch[2] = 0);
302
- const p = {
303
- RGB: () => `rgb(${Math.floor(s.rgb[0])}, ${Math.floor(
304
- s.rgb[1]
305
- )}, ${Math.floor(s.rgb[2])})`,
306
- HEX: () => s.hex,
307
- HSL: () => `hsl(${Math.floor(s.hsl[0])} ${Math.floor(
308
- s.hsl[1] * 100
309
- )}% ${Math.floor(s.hsl[2] * 100)}%)`,
310
- LCH: () => `lch(${Math.floor(s.lch[0])}% ${Math.floor(
311
- s.lch[1]
312
- )} ${Math.floor(s.lch[2])})`,
313
- OKLCH: () => `oklch(${Math.floor(s.oklch[0] * 100)}% ${s.oklch[1].toFixed(3)} ${Math.floor(s.oklch[2])})`
314
- };
315
- return (f = p[l ?? "RGB"]) == null ? void 0 : f.call(p);
316
- }, e = (s, p) => {
317
- var $;
318
- isNaN(s.hsl[0]) && (s.hsl[0] = 0), isNaN(s.lch[2]) && (s.lch[2] = 0), isNaN(s.oklch[2]) && (s.oklch[2] = 0);
319
- const f = {
320
- RGB: () => {
321
- var g;
322
- return `rgba(${Math.floor(p.rgb[0])}, ${Math.floor(
323
- p.rgb[1]
324
- )}, ${Math.floor(p.rgb[2])}, ${((g = s.alpha) == null ? void 0 : g.toFixed(2)) ?? 1})`;
325
- },
326
- HEX: () => u(p.hex).alpha(s.alpha ?? 1).hex(),
327
- HSL: () => {
328
- var g;
329
- return `hsla(${Math.floor(p.hsl[0])} ${Math.floor(
330
- p.hsl[1] * 100
331
- )}%, ${Math.floor(p.hsl[2] * 100)}% ${((g = s.alpha) == null ? void 0 : g.toFixed(2)) ?? 1})`;
332
- },
333
- LCH: () => {
334
- var g;
335
- return `lch(${Math.floor(p.lch[0])}% ${Math.floor(
336
- p.lch[1]
337
- )} ${Math.floor(p.lch[2])} / ${((g = s.alpha) == null ? void 0 : g.toFixed(2)) ?? 1})`;
338
- },
339
- OKLCH: () => {
340
- var g;
341
- return `oklch(${Math.floor(p.oklch[0 * 100])}% ${p.oklch[1].toFixed(3)} ${Math.floor(p.oklch[2])} / ${((g = s.alpha) == null ? void 0 : g.toFixed(2)) ?? 1})`;
342
- }
343
- };
344
- return ($ = f[l ?? "RGB"]) == null ? void 0 : $.call(f);
345
- }, o = n.find(
346
- (s) => s.type === "default theme"
347
- );
348
- if (o) {
349
- const s = [];
350
- return o.colors.forEach((p, f) => {
351
- f > 0 && s.push(""), s.push(`// ${p.name}`), p.shades.reverse().forEach(($) => {
352
- const g = p.shades.find((C) => C.type === "source color"), d = `$${new b(p.name).doKebabCase()}-${$.name}`;
353
- g && s.push(
354
- `${d}: ${$.isTransparent ? e($, g) : a($)};`
355
- );
356
- });
357
- }), t.push(s.join(`
358
- `)), t.join(`
359
- `);
360
- }
361
- n.forEach((s) => {
362
- const p = new b(s.name).doKebabCase(), f = [];
363
- f.push(`// ${s.name}`), f.push(`@mixin ${p} {`), s.colors.forEach(($, g) => {
364
- g > 0 && f.push(""), f.push(` // ${$.name}`), $.shades.reverse().forEach((d) => {
365
- const C = $.shades.find((F) => F.type === "source color"), E = `--${new b($.name).doKebabCase()}-${d.name}`;
366
- C && f.push(
367
- ` ${E}: ${d.isTransparent ? e(d, C) : a(d)};`
368
- );
369
- });
370
- }), f.push("}"), t.push(f.join(`
371
- `));
372
- });
373
- const c = /* @__PURE__ */ new Set();
374
- if (n.forEach((s) => {
375
- s.colors.forEach((p) => {
376
- p.shades.forEach((f) => {
377
- if (p.shades.find((g) => g.type === "source color")) {
378
- const d = `--${new b(p.name).doKebabCase()}-${f.name}`;
379
- c.add(d);
380
- }
381
- });
382
- });
383
- }), c.size > 0) {
384
- const s = /* @__PURE__ */ new Map();
385
- c.forEach((p) => {
386
- const f = p.match(/--([a-zA-Z0-9-]+)-([a-zA-Z0-9-]+)/);
387
- if (f) {
388
- const $ = f[1];
389
- s.has($) || s.set($, []);
390
- const g = `$${p.substring(2)}`;
391
- s.get($).push(`${g}: var(${p});`);
392
- }
393
- }), s.forEach((p, f) => {
394
- i.push(
395
- `// ${f.charAt(0).toUpperCase() + f.slice(1)}`
396
- ), i.push(...p), i.push("");
397
- }), i.length > 0 && i[i.length - 1] === "" && i.pop(), t.push(i.join(`
398
- `));
399
- }
400
- const r = [":root {"];
401
- n.forEach((s, p) => {
402
- const f = new b(s.name).doKebabCase();
403
- r.push(` &[data-theme="${f}"] {
404
- @include ${f};
405
- }`), p !== n.length - 1 && r.push("");
406
- }), r.push("}"), t.push(r.join(`
407
- `));
408
- const h = [];
409
- return n.forEach((s) => {
410
- const p = new b(s.name).doKebabCase();
411
- h.push(`.${p} {
412
- @include ${p};
413
- }`);
414
- }), t.push(h.join(`
415
-
416
- `)), t.join(`
417
-
418
- `);
419
- }, j = (m) => {
420
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = [];
421
- return l.forEach((t) => {
422
- t.colors.forEach((i) => {
423
- const a = i.shades.find((o) => o.type === "source color"), e = [];
424
- e.push(
425
- `<!--${l[0].type === "custom theme" ? `${t.name} - ${i.name}-->` : `${i.name}-->`}`
426
- ), i.shades.reverse().forEach((o) => {
427
- e.push(
428
- `<color name="${l[0].type === "custom theme" ? new b(t.name + " " + i.name).doSnakeCase() : new b(i.name).doSnakeCase()}_${o.name}">${o.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(o.alpha ?? 1).hex() : o.hex}</color>`
429
- );
430
- }), e.push(""), e.forEach((o) => n.push(o));
431
- });
432
- }), n.pop(), `<?xml version="1.0" encoding="utf-8"?>
433
- <resources>
434
- ${n.join(
435
- `
436
- `
437
- )}
438
- </resources>`;
439
- }, B = (m) => {
440
- const l = m.themes.filter((a) => a.type === "custom theme").length === 0 ? m.themes.filter((a) => a.type === "default theme") : m.themes.filter((a) => a.type === "custom theme"), n = {
441
- $themes: [],
442
- $metadata: {
443
- activeThemes: [],
444
- tokenSetOrder: [],
445
- activeSets: []
446
- }
447
- }, t = m.name, i = (a, e, o) => ({
448
- $type: "color",
449
- $value: e.isTransparent ? u(o.hex).alpha(e.alpha ?? 1).hex() : e.hex,
450
- $description: a.description !== "" ? a.description + " - " + e.description : e.description
451
- });
452
- return l[0].type === "custom theme" ? l.forEach((a) => {
453
- a.colors.forEach((e) => {
454
- const o = e.shades.find(
455
- (c) => c.type === "source color"
456
- );
457
- n[`${a.name}/${e.name}`] = {}, e.shades.forEach((c) => {
458
- c && o && (n[`${a.name}/${e.name}`][c.name] = i(
459
- e,
460
- c,
461
- o
462
- ));
463
- });
464
- });
465
- }) : l.forEach((a) => {
466
- a.colors.forEach((e) => {
467
- const o = e.shades.find(
468
- (c) => c.type === "source color"
469
- );
470
- n[`${t}/${e.name}`] = {}, e.shades.forEach((c) => {
471
- c && o && (n[`${t}/${e.name}`][c.name] = i(
472
- e,
473
- c,
474
- o
475
- ));
476
- });
477
- });
478
- }), JSON.stringify(n, null, " ");
479
- }, R = (m, l) => {
480
- const n = m.themes.filter((r) => r.type === "custom theme").length === 0 ? m.themes.filter((r) => r.type === "default theme") : m.themes.filter((r) => r.type === "custom theme"), t = [], i = (r) => {
481
- var s;
482
- isNaN(r.hsl[0]) && (r.hsl[0] = 0), isNaN(r.lch[2]) && (r.lch[2] = 0), isNaN(r.oklch[2]) && (r.oklch[2] = 0);
483
- const h = {
484
- RGB: () => `rgb(${Math.floor(r.rgb[0])}, ${Math.floor(
485
- r.rgb[1]
486
- )}, ${Math.floor(r.rgb[2])})`,
487
- HEX: () => r.hex,
488
- HSL: () => `hsl(${Math.floor(r.hsl[0])} ${Math.floor(
489
- r.hsl[1] * 100
490
- )}% ${Math.floor(r.hsl[2] * 100)}%)`,
491
- LCH: () => `lch(${Math.floor(r.lch[0])}% ${Math.floor(
492
- r.lch[1]
493
- )} ${Math.floor(r.lch[2])})`,
494
- OKLCH: () => `oklch(${Math.floor(r.oklch[0] * 100)}% ${r.oklch[1].toFixed(3)} ${Math.floor(r.oklch[2])})`
495
- };
496
- return (s = h[l ?? "RGB"]) == null ? void 0 : s.call(h);
497
- }, a = (r, h) => {
498
- var p;
499
- isNaN(r.hsl[0]) && (r.hsl[0] = 0), isNaN(r.lch[2]) && (r.lch[2] = 0), isNaN(r.oklch[2]) && (r.oklch[2] = 0);
500
- const s = {
501
- RGB: () => {
502
- var f;
503
- return `rgba(${Math.floor(h.rgb[0])}, ${Math.floor(
504
- h.rgb[1]
505
- )}, ${Math.floor(h.rgb[2])}, ${((f = r.alpha) == null ? void 0 : f.toFixed(2)) ?? 1})`;
506
- },
507
- HEX: () => u(h.hex).alpha(r.alpha ?? 1).hex(),
508
- HSL: () => {
509
- var f;
510
- return `hsla(${Math.floor(h.hsl[0])}, ${Math.floor(
511
- h.hsl[1] * 100
512
- )}% ${Math.floor(h.hsl[2] * 100)}% ${((f = r.alpha) == null ? void 0 : f.toFixed(2)) ?? 1})`;
513
- },
514
- LCH: () => {
515
- var f;
516
- return `lch(${Math.floor(h.lch[0])}% ${Math.floor(
517
- h.lch[1]
518
- )} ${Math.floor(h.lch[2])} / ${((f = r.alpha) == null ? void 0 : f.toFixed(2)) ?? 1})`;
519
- },
520
- OKLCH: () => {
521
- var f;
522
- return `oklch(${Math.floor(h.oklch[0] * 100)}% ${h.oklch[1].toFixed(3)} ${Math.floor(h.oklch[2])} / ${((f = r.alpha) == null ? void 0 : f.toFixed(2)) ?? 1})`;
523
- }
524
- };
525
- return (p = s[l ?? "RGB"]) == null ? void 0 : p.call(s);
526
- }, e = n.find(
527
- (r) => r.type === "default theme"
528
- );
529
- if (e) {
530
- const r = [];
531
- return e.colors.forEach((h, s) => {
532
- s > 0 && r.push(""), r.push(`// ${h.name}`), h.shades.reverse().forEach((p) => {
533
- const f = h.shades.find((g) => g.type === "source color"), $ = `@${new b(h.name).doKebabCase()}-${p.name}`;
534
- f && r.push(
535
- `${$}: ${p.isTransparent ? a(p, f) : i(p)};`
536
- );
537
- });
538
- }), t.push(r.join(`
539
- `)), t.join(`
540
- `);
541
- }
542
- n.forEach((r) => {
543
- const h = new b(r.name).doKebabCase(), s = [];
544
- s.push(`// ${r.name}`), s.push(`.${h}() {`), r.colors.forEach((p, f) => {
545
- f > 0 && s.push(""), s.push(` // ${p.name}`), p.shades.reverse().forEach(($) => {
546
- const g = p.shades.find((C) => C.type === "source color"), d = `@${new b(p.name).doKebabCase()}-${$.name}`;
547
- g && s.push(
548
- ` ${d}: ${$.isTransparent ? a($, g) : i($)};`
549
- );
550
- });
551
- }), s.push("}"), t.push(s.join(`
552
- `));
553
- });
554
- const o = [":root {"];
555
- n.forEach((r, h) => {
556
- const s = new b(r.name).doKebabCase();
557
- o.push(` &[data-theme="${s}"] {
558
- .${s}();
559
- }`), h !== n.length - 1 && o.push("");
560
- }), o.push("}"), t.push(o.join(`
561
- `));
562
- const c = [];
563
- return n.forEach((r) => {
564
- const h = new b(r.name).doKebabCase();
565
- c.push(`.${h} {
566
- .${h}();
567
- }`);
568
- }), t.push(c.join(`
569
-
570
- `)), t.join(`
571
-
572
- `);
573
- }, G = (m, l) => {
574
- const n = m.themes.filter((e) => e.type === "custom theme").length === 0 ? m.themes.filter((e) => e.type === "default theme") : m.themes.filter((e) => e.type === "custom theme"), t = {}, i = (e) => {
575
- var c;
576
- isNaN(e.oklch[2]) && (e.oklch[2] = 0);
577
- const o = {
578
- RGB: () => ({
579
- colorSpace: "srgb",
580
- components: [
581
- parseFloat(e.gl[0].toFixed(3)),
582
- parseFloat(e.gl[1].toFixed(3)),
583
- parseFloat(e.gl[2].toFixed(3))
584
- ],
585
- hex: e.hex
586
- }),
587
- OKLCH: () => ({
588
- colorSpace: "oklch",
589
- components: [
590
- parseFloat(e.oklch[0].toFixed(3)),
591
- parseFloat(e.oklch[1].toFixed(3)),
592
- parseFloat(e.oklch[2].toFixed(0))
593
- ],
594
- hex: e.hex
595
- })
596
- };
597
- return (c = o[l ?? "RGB"]) == null ? void 0 : c.call(o);
598
- }, a = (e, o) => {
599
- var r;
600
- isNaN(o.oklch[2]) && (o.oklch[2] = 0);
601
- const c = {
602
- RGB: () => ({
603
- colorSpace: "srgb",
604
- components: [
605
- parseFloat(e.gl[0].toFixed(3)),
606
- parseFloat(e.gl[1].toFixed(3)),
607
- parseFloat(e.gl[2].toFixed(3))
608
- ],
609
- hex: e.hex,
610
- alpha: o.alpha
611
- }),
612
- OKLCH: () => ({
613
- colorSpace: "oklch",
614
- components: [
615
- parseFloat(e.oklch[0].toFixed(3)),
616
- parseFloat(e.oklch[1].toFixed(3)),
617
- parseFloat(e.oklch[2].toFixed(0))
618
- ],
619
- hex: e.hex,
620
- alpha: o.alpha
621
- })
622
- };
623
- return (r = c[l ?? "RGB"]) == null ? void 0 : r.call(c);
624
- };
625
- return n[0].type === "custom theme" ? n.forEach((e) => {
626
- e.colors.forEach((o) => {
627
- const c = o.shades.find(
628
- (r) => r.type === "source color"
629
- );
630
- t[o.name] || (t[o.name] = {
631
- $type: "color"
632
- }), o.shades.forEach((r) => {
633
- !t[o.name][r.name] && c && (t[o.name][r.name] = {
634
- $type: "color",
635
- $value: r.isTransparent ? a(c, r) : i(r),
636
- $description: o.description !== "" ? o.description + " - " + r.description : r.description,
637
- $extensions: {
638
- mode: {}
639
- }
640
- }), c && (t[o.name][r.name].$extensions.mode[e.name] = r.isTransparent ? a(c, r) : i(r));
641
- });
642
- });
643
- }) : n.forEach((e) => {
644
- e.colors.forEach((o) => {
645
- const c = o.shades.find(
646
- (r) => r.type === "source color"
647
- );
648
- t[o.name] = {}, o.shades.forEach((r) => {
649
- r && c && (t[o.name][r.name] = {
650
- $type: "color",
651
- $value: r.isTransparent ? a(c, r) : i(r),
652
- $description: o.description !== "" ? o.description + " - " + r.description : r.description
653
- });
654
- });
655
- });
656
- }), JSON.stringify(t, null, " ");
657
- }, O = (m) => {
658
- const l = m.themes.filter((c) => c.type === "custom theme").length === 0 ? m.themes.filter((c) => c.type === "default theme") : m.themes.filter((c) => c.type === "custom theme"), n = [], t = [], i = [], a = [], e = [], o = [];
659
- return l.forEach((c) => {
660
- c.colors.forEach((r) => {
661
- r.shades.forEach((h) => {
662
- i.push(h.name), a.push(Math.floor(h.lch[0])), e.push(Math.floor(h.lch[1])), o.push(Math.floor(h.lch[2]));
663
- }), n.push({
664
- name: r.name,
665
- csv: `${r.name},Lightness,Chroma,Hue
666
- ${i.map((h, s) => `${h},${a[s]},${e[s]},${o[s]}`).join(`
667
- `)}`
668
- }), i.splice(0, i.length), a.splice(0, a.length), e.splice(0, e.length), o.splice(0, o.length);
669
- }), t.push({
670
- name: c.name,
671
- colors: n.map((r) => r),
672
- type: c.type
673
- }), n.splice(0, n.length);
674
- }), t;
675
- }, _ = (m, l) => {
676
- const n = m.themes.filter((e) => e.type === "custom theme").length === 0 ? m.themes.filter((e) => e.type === "default theme") : m.themes.filter((e) => e.type === "custom theme"), t = [], i = (e) => {
677
- var c;
678
- isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0), isNaN(e.oklch[2]) && (e.oklch[2] = 0);
679
- const o = {
680
- RGB: () => `rgb(${Math.floor(e.rgb[0])}, ${Math.floor(
681
- e.rgb[1]
682
- )}, ${Math.floor(e.rgb[2])})`,
683
- HEX: () => e.hex,
684
- HSL: () => `hsl(${Math.floor(e.hsl[0])} ${Math.floor(
685
- e.hsl[1] * 100
686
- )}% ${Math.floor(e.hsl[2] * 100)}%)`,
687
- LCH: () => `lch(${Math.floor(e.lch[0])}% ${Math.floor(
688
- e.lch[1]
689
- )} ${Math.floor(e.lch[2])})`,
690
- OKLCH: () => `oklch(${Math.floor(e.oklch[0] * 100)}% ${e.oklch[1].toFixed(3)} ${Math.floor(e.oklch[2])})`,
691
- P3: () => `color(display-p3 ${e.gl[0].toFixed(3)} ${e.gl[1].toFixed(
692
- 3
693
- )} ${e.gl[2].toFixed(3)})`
694
- };
695
- return (c = o[l ?? "RGB"]) == null ? void 0 : c.call(o);
696
- }, a = (e, o) => {
697
- var r;
698
- isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0), isNaN(e.oklch[2]) && (e.oklch[2] = 0);
699
- const c = {
700
- RGB: () => {
701
- var h;
702
- return `rgb(${Math.floor(o.rgb[0])}, ${Math.floor(
703
- o.rgb[1]
704
- )}, ${Math.floor(o.rgb[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
705
- },
706
- HEX: () => u(o.hex).alpha(e.alpha ?? 1).hex(),
707
- HSL: () => {
708
- var h;
709
- return `hsl(${Math.floor(o.hsl[0])} ${Math.floor(
710
- o.hsl[1] * 100
711
- )}% ${Math.floor(o.hsl[2] * 100)}% / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
712
- },
713
- LCH: () => {
714
- var h;
715
- return `lch(${Math.floor(o.lch[0])}% ${Math.floor(
716
- o.lch[1]
717
- )} ${Math.floor(o.lch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
718
- },
719
- OKLCH: () => {
720
- var h;
721
- return `oklch(${Math.floor(o.oklch[0 * 100])}% ${o.oklch[1].toFixed(3)} ${Math.floor(o.oklch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
722
- },
723
- P3: () => {
724
- var h;
725
- return `color(display-p3 ${o.gl[0].toFixed(3)} ${o.gl[1].toFixed(
726
- 3
727
- )} ${o.gl[2].toFixed(3)} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
728
- }
729
- };
730
- return (r = c[l ?? "RGB"]) == null ? void 0 : r.call(c);
731
- };
732
- return n.forEach((e) => {
733
- const o = [];
734
- e.colors.forEach((c) => {
735
- o.push(`/* ${c.name} */`), c.shades.reverse().forEach((r) => {
736
- const h = c.shades.find((s) => s.type === "source color");
737
- h && o.push(
738
- `--${new b(c.name).doKebabCase()}-${r.name}: ${r.isTransparent ? a(r, h) : i(r)};`
739
- );
740
- }), o.push("");
741
- }), o.pop(), t.push(
742
- `${e.type === "custom theme" ? `/* ${e.name} */
743
- ` : ""}:root${e.type === "custom theme" ? `[data-theme='${new b(e.name).doKebabCase()}']` : ""} {
744
- ${o.join(`
745
- `)}
746
- }`
747
- );
748
- }), t.join(`
749
-
750
- `);
751
- }, U = (m) => {
752
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = [];
753
- return l.forEach((t) => {
754
- t.colors.forEach((i) => {
755
- const a = i.shades.find((o) => o.type === "source color"), e = [];
756
- e.push(
757
- `// ${l[0].type === "custom theme" ? t.name + " - " : ""}${i.name}`
758
- ), i.shades.reverse().forEach((o) => {
759
- e.push(
760
- `val ${l[0].type === "custom theme" ? new b(t.name + " " + i.name).doSnakeCase() : new b(i.name).doSnakeCase()}_${o.name} = Color(${o.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(o.alpha ?? 1).hex().replace("#", "0xFF").toUpperCase() : o.hex.replace("#", "0xFF").toUpperCase()})`
761
- );
762
- }), e.push(""), e.forEach((o) => n.push(o));
763
- });
764
- }), n.pop(), `import androidx.compose.ui.graphics.Color
765
-
766
- ${n.join(`
767
- `)}`;
768
- };
769
- class J {
1
+ var L = Object.defineProperty;
2
+ var v = (d, a, h) => a in d ? L(d, a, { enumerable: !0, configurable: !0, writable: !0, value: h }) : d[a] = h;
3
+ var i = (d, a, h) => v(d, typeof a != "symbol" ? a + "" : a, h);
4
+ import { C as g, H as C } from "../../color-1CXTuV84.js";
5
+ import { c as s } from "../../index-Beb8qoyd.js";
6
+ import { m as E, a as P, b as y, c as _, d as T, e as w, f as V, g as A, h as H, i as M, j as R, k as x, l as N, n as B } from "../../makeCompose-hjSTxNaX.js";
7
+ class F {
770
8
  constructor({
771
- base: l,
772
- themes: n,
9
+ base: a,
10
+ themes: h,
773
11
  meta: t
774
12
  }) {
775
- k(this, "base");
776
- k(this, "themes");
777
- k(this, "meta");
778
- k(this, "paletteData");
779
- k(this, "currentScale");
780
- k(this, "makePaletteData", () => (this.themes.forEach((l) => {
781
- const n = {
782
- id: l.id,
783
- name: l.name,
784
- description: l.description,
13
+ i(this, "base");
14
+ i(this, "themes");
15
+ i(this, "meta");
16
+ i(this, "paletteData");
17
+ i(this, "currentScale");
18
+ i(this, "makePaletteData", () => (this.themes.forEach((a) => {
19
+ const h = {
20
+ id: a.id,
21
+ name: a.name,
22
+ description: a.description,
785
23
  colors: [],
786
- type: l.type
24
+ type: a.type
787
25
  };
788
26
  this.base.colors.forEach((t) => {
789
- const i = Object.entries(l.scale).reverse().map((h) => {
27
+ const k = Object.entries(a.scale).reverse().map((e) => {
790
28
  if (t.alpha.isEnabled) {
791
- const s = new x({
29
+ const r = new g({
792
30
  render: "RGB",
793
31
  sourceColor: [
794
32
  t.rgb.r * 255,
795
33
  t.rgb.g * 255,
796
34
  t.rgb.b * 255
797
35
  ],
798
- alpha: parseFloat((h[1] / 100).toFixed(2)),
36
+ alpha: parseFloat((e[1] / 100).toFixed(2)),
799
37
  hueShifting: t.hue.shift !== void 0 ? t.hue.shift : 0,
800
38
  chromaShifting: t.chroma.shift !== void 0 ? t.chroma.shift : 100,
801
39
  algorithmVersion: this.base.algorithmVersion,
802
- visionSimulationMode: l.visionSimulationMode
803
- }), p = new x({
40
+ visionSimulationMode: a.visionSimulationMode
41
+ }), o = new g({
804
42
  render: "RGB",
805
- sourceColor: u(t.alpha.backgroundColor).rgb(),
43
+ sourceColor: s(t.alpha.backgroundColor).rgb(),
806
44
  algorithmVersion: this.base.algorithmVersion,
807
- visionSimulationMode: l.visionSimulationMode
45
+ visionSimulationMode: a.visionSimulationMode
808
46
  });
809
47
  switch (this.base.colorSpace) {
810
48
  case "LCH":
811
49
  return this.base.areSourceColorsLocked ? [
812
- h,
813
- s.setColorWithAlpha(),
814
- p.setColorWithAlpha()
50
+ e,
51
+ r.setColorWithAlpha(),
52
+ o.setColorWithAlpha()
815
53
  ] : [
816
- h,
817
- s.lcha(),
818
- p.lcha()
54
+ e,
55
+ r.lcha(),
56
+ o.lcha()
819
57
  ];
820
58
  case "OKLCH":
821
59
  return this.base.areSourceColorsLocked ? [
822
- h,
823
- s.setColorWithAlpha(),
824
- p.setColorWithAlpha()
60
+ e,
61
+ r.setColorWithAlpha(),
62
+ o.setColorWithAlpha()
825
63
  ] : [
826
- h,
827
- s.oklcha(),
828
- p.oklcha()
64
+ e,
65
+ r.oklcha(),
66
+ o.oklcha()
829
67
  ];
830
68
  case "LAB":
831
69
  return this.base.areSourceColorsLocked ? [
832
- h,
833
- s.setColorWithAlpha(),
834
- p.setColorWithAlpha()
70
+ e,
71
+ r.setColorWithAlpha(),
72
+ o.setColorWithAlpha()
835
73
  ] : [
836
- h,
837
- s.laba(),
838
- p.laba()
74
+ e,
75
+ r.laba(),
76
+ o.laba()
839
77
  ];
840
78
  case "OKLAB":
841
79
  return this.base.areSourceColorsLocked ? [
842
- h,
843
- s.setColorWithAlpha(),
844
- p.setColorWithAlpha()
80
+ e,
81
+ r.setColorWithAlpha(),
82
+ o.setColorWithAlpha()
845
83
  ] : [
846
- h,
847
- s.oklaba(),
848
- p.oklaba()
84
+ e,
85
+ r.oklaba(),
86
+ o.oklaba()
849
87
  ];
850
88
  case "HSL":
851
89
  return this.base.areSourceColorsLocked ? [
852
- h,
853
- s.setColorWithAlpha(),
854
- p.setColorWithAlpha()
90
+ e,
91
+ r.setColorWithAlpha(),
92
+ o.setColorWithAlpha()
855
93
  ] : [
856
- h,
857
- s.hsla(),
858
- p.hsla()
94
+ e,
95
+ r.hsla(),
96
+ o.hsla()
859
97
  ];
860
98
  case "HSLUV":
861
99
  return this.base.areSourceColorsLocked ? [
862
- h,
863
- s.setColorWithAlpha(),
864
- p.setColorWithAlpha()
100
+ e,
101
+ r.setColorWithAlpha(),
102
+ o.setColorWithAlpha()
865
103
  ] : [
866
- h,
867
- s.hsluva(),
868
- p.hsluva()
104
+ e,
105
+ r.hsluva(),
106
+ o.hsluva()
869
107
  ];
870
108
  default:
871
- return [h, [0, 0, 0], [255, 255, 255]];
109
+ return [e, [0, 0, 0], [255, 255, 255]];
872
110
  }
873
111
  } else {
874
- const s = new x({
112
+ const r = new g({
875
113
  render: "RGB",
876
114
  sourceColor: [
877
115
  t.rgb.r * 255,
878
116
  t.rgb.g * 255,
879
117
  t.rgb.b * 255
880
118
  ],
881
- lightness: h[1],
119
+ lightness: e[1],
882
120
  hueShifting: t.hue.shift !== void 0 ? t.hue.shift : 0,
883
121
  chromaShifting: t.chroma.shift !== void 0 ? t.chroma.shift : 100,
884
122
  algorithmVersion: this.base.algorithmVersion,
885
- visionSimulationMode: l.visionSimulationMode
123
+ visionSimulationMode: a.visionSimulationMode
886
124
  });
887
125
  switch (this.base.colorSpace) {
888
126
  case "LCH":
889
- return [h, s.lch()];
127
+ return [e, r.lch()];
890
128
  case "OKLCH":
891
- return [h, s.oklch()];
129
+ return [e, r.oklch()];
892
130
  case "LAB":
893
- return [h, s.lab()];
131
+ return [e, r.lab()];
894
132
  case "OKLAB":
895
- return [h, s.oklab()];
133
+ return [e, r.oklab()];
896
134
  case "HSL":
897
- return [h, s.hsl()];
135
+ return [e, r.hsl()];
898
136
  case "HSLUV":
899
- return [h, s.hsluv()];
137
+ return [e, r.hsluv()];
900
138
  default:
901
- return [h, [0, 0, 0]];
139
+ return [e, [0, 0, 0]];
902
140
  }
903
141
  }
904
- }), a = {
142
+ }), u = {
905
143
  id: t.id,
906
144
  name: t.name,
907
145
  description: t.description,
908
146
  shades: [],
909
147
  type: "color"
910
- }, e = [
148
+ }, n = [
911
149
  t.rgb.r * 255,
912
150
  t.rgb.g * 255,
913
151
  t.rgb.b * 255
914
- ], o = new M();
915
- o.rgb_r = t.rgb.r, o.rgb_g = t.rgb.g, o.rgb_b = t.rgb.b, o.rgbToHsluv(), a.shades.push({
152
+ ], c = new C();
153
+ c.rgb_r = t.rgb.r, c.rgb_g = t.rgb.g, c.rgb_b = t.rgb.b, c.rgbToHsluv(), u.shades.push({
916
154
  name: "source",
917
155
  description: "Source color",
918
- hex: u(e).hex(),
919
- rgb: e,
920
- gl: u(e).gl(),
921
- lch: u(e).lch(),
922
- oklch: u(e).oklch(),
923
- lab: u(e).lab(),
924
- oklab: u(e).oklab(),
925
- hsl: u(e).hsl(),
156
+ hex: s(n).hex(),
157
+ rgb: n,
158
+ gl: s(n).gl(),
159
+ lch: s(n).lch(),
160
+ oklch: s(n).oklch(),
161
+ lab: s(n).lab(),
162
+ oklab: s(n).oklab(),
163
+ hsl: s(n).hsl(),
926
164
  hsluv: [
927
- o.hsluv_h,
928
- o.hsluv_s,
929
- o.hsluv_l
165
+ c.hsluv_h,
166
+ c.hsluv_s,
167
+ c.hsluv_l
930
168
  ],
931
169
  type: "source color"
932
170
  });
933
- const c = i.map(
934
- (h) => u.distance(
935
- u(e).hex(),
936
- u(h[1]).hex(),
171
+ const S = k.map(
172
+ (e) => s.distance(
173
+ s(n).hex(),
174
+ s(e[1]).hex(),
937
175
  "rgb"
938
176
  )
939
- ), r = c.indexOf(Math.min(...c));
940
- i.forEach((h, s) => {
941
- const p = u.distance(
942
- u(e).hex(),
943
- u(h[1]).hex(),
177
+ ), l = S.indexOf(Math.min(...S));
178
+ k.forEach((e, r) => {
179
+ const o = s.distance(
180
+ s(n).hex(),
181
+ s(e[1]).hex(),
944
182
  "rgb"
945
- ), f = Object.keys(this.currentScale).find(
946
- (C) => C === h[0][0]
947
- ) ?? "0", $ = new M(), g = new x({
183
+ ), D = Object.keys(this.currentScale).find(
184
+ (f) => f === e[0][0]
185
+ ) ?? "0", b = new C(), p = new g({
948
186
  render: "RGB",
949
- sourceColor: u(e).rgb(),
950
- visionSimulationMode: l.visionSimulationMode
951
- }).setColor(), d = new x({
187
+ sourceColor: s(n).rgb(),
188
+ visionSimulationMode: a.visionSimulationMode
189
+ }).setColor(), m = new g({
952
190
  render: "HEX",
953
- sourceColor: u(e).rgb(),
954
- visionSimulationMode: l.visionSimulationMode
191
+ sourceColor: s(n).rgb(),
192
+ visionSimulationMode: a.visionSimulationMode
955
193
  }).setColor();
956
- s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? ($.rgb_r = Number(g[0]) / 255, $.rgb_g = Number(g[1]) / 255, $.rgb_b = Number(g[2]) / 255) : ($.rgb_r = Number(h[1][0]) / 255, $.rgb_g = Number(h[1][1]) / 255, $.rgb_b = Number(h[1][2]) / 255), $.rgbToHsluv(), a.shades.push({
957
- name: f,
958
- description: `Shade/Tint color with ${typeof h[0][1] == "number" ? h[0][1].toFixed(1) : h[0][1]}% of ${t.alpha.isEnabled ? "opacity" : "lightness"}`,
959
- hex: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).hex() : u(h[1]).hex(),
960
- rgb: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).rgb() : u(h[1]).rgb(),
961
- gl: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).gl() : u(h[1]).gl(),
962
- lch: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).lch() : u(h[1]).lch(),
963
- oklch: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).oklch() : u(h[1]).oklch(),
964
- lab: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).lab() : u(h[1]).lab(),
965
- oklab: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).oklab() : u(h[1]).oklab(),
966
- hsl: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).hsl() : u(h[1]).hsl(),
967
- hsluv: [$.hsluv_h, $.hsluv_s, $.hsluv_l],
968
- alpha: t.alpha.isEnabled ? parseFloat((h[0][1] / 100).toFixed(2)) : void 0,
969
- backgroundColor: t.alpha.isEnabled && t.alpha.backgroundColor ? u(h[2]).rgb() : void 0,
970
- mixedColor: t.alpha.isEnabled && t.alpha.backgroundColor ? new x({
971
- visionSimulationMode: l.visionSimulationMode
194
+ r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? (b.rgb_r = Number(p[0]) / 255, b.rgb_g = Number(p[1]) / 255, b.rgb_b = Number(p[2]) / 255) : (b.rgb_r = Number(e[1][0]) / 255, b.rgb_g = Number(e[1][1]) / 255, b.rgb_b = Number(e[1][2]) / 255), b.rgbToHsluv(), u.shades.push({
195
+ name: D,
196
+ description: `Shade/Tint color with ${typeof e[0][1] == "number" ? e[0][1].toFixed(1) : e[0][1]}% of ${t.alpha.isEnabled ? "opacity" : "lightness"}`,
197
+ hex: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).hex() : s(e[1]).hex(),
198
+ rgb: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).rgb() : s(e[1]).rgb(),
199
+ gl: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).gl() : s(e[1]).gl(),
200
+ lch: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).lch() : s(e[1]).lch(),
201
+ oklch: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).oklch() : s(e[1]).oklch(),
202
+ lab: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).lab() : s(e[1]).lab(),
203
+ oklab: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).oklab() : s(e[1]).oklab(),
204
+ hsl: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).hsl() : s(e[1]).hsl(),
205
+ hsluv: [b.hsluv_h, b.hsluv_s, b.hsluv_l],
206
+ alpha: t.alpha.isEnabled ? parseFloat((e[0][1] / 100).toFixed(2)) : void 0,
207
+ backgroundColor: t.alpha.isEnabled && t.alpha.backgroundColor ? s(e[2]).rgb() : void 0,
208
+ mixedColor: t.alpha.isEnabled && t.alpha.backgroundColor ? new g({
209
+ visionSimulationMode: a.visionSimulationMode
972
210
  }).mixColorsRgb(
973
211
  [
974
- ...h[1],
212
+ ...e[1],
975
213
  parseFloat(
976
- (h[0][1] / 100).toFixed(2)
214
+ (e[0][1] / 100).toFixed(2)
977
215
  )
978
216
  ],
979
- [...h[2], 1]
217
+ [...e[2], 1]
980
218
  ) : void 0,
981
- isClosestToRef: p < 4 && !this.base.areSourceColorsLocked,
982
- isSourceColorLocked: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled,
219
+ isClosestToRef: o < 4 && !this.base.areSourceColorsLocked,
220
+ isSourceColorLocked: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled,
983
221
  isTransparent: t.alpha.isEnabled,
984
222
  type: "color shade/tint"
985
223
  });
986
- }), n.colors.push(a);
987
- }), this.paletteData.themes.push(n);
224
+ }), h.colors.push(u);
225
+ }), this.paletteData.themes.push(h);
988
226
  }), this.paletteData));
989
- k(this, "makeLibraryData", (l, n) => {
227
+ i(this, "makeLibraryData", (a, h) => {
990
228
  const t = this.makePaletteData();
991
229
  return t.themes.flatMap(
992
- (a) => a.colors.flatMap(
993
- (e) => e.shades.flatMap((o) => {
994
- const c = `${a.id}:${e.id}:${o.name}`, r = n == null ? void 0 : n.find(
995
- (h) => h.id === c
230
+ (u) => u.colors.flatMap(
231
+ (n) => n.shades.flatMap((c) => {
232
+ const S = `${u.id}:${n.id}:${c.name}`, l = h == null ? void 0 : h.find(
233
+ (e) => e.id === S
996
234
  );
997
235
  return {
998
- id: c,
236
+ id: S,
999
237
  paletteName: t.name,
1000
- themeName: a.name,
1001
- colorName: e.name,
1002
- shadeName: o.name,
1003
- ...(l == null ? void 0 : l.includes("alpha")) && { alpha: o.alpha ?? 1 },
1004
- ...(l == null ? void 0 : l.includes("hex")) && { hex: o.hex },
1005
- ...(l == null ? void 0 : l.includes("gl")) && { gl: o.gl },
1006
- ...(l == null ? void 0 : l.includes("description")) && {
1007
- description: e.description
238
+ themeName: u.name,
239
+ colorName: n.name,
240
+ shadeName: c.name,
241
+ ...(a == null ? void 0 : a.includes("alpha")) && { alpha: c.alpha ?? 1 },
242
+ ...(a == null ? void 0 : a.includes("hex")) && { hex: c.hex },
243
+ ...(a == null ? void 0 : a.includes("gl")) && { gl: c.gl },
244
+ ...(a == null ? void 0 : a.includes("description")) && {
245
+ description: n.description
1008
246
  },
1009
- ...(l == null ? void 0 : l.includes("collection_id")) && {
1010
- collectionId: r == null ? void 0 : r.collectionId
247
+ ...(a == null ? void 0 : a.includes("collection_id")) && {
248
+ collectionId: l == null ? void 0 : l.collectionId
1011
249
  },
1012
- ...(l == null ? void 0 : l.includes("mode_id")) && {
1013
- modeId: r == null ? void 0 : r.modeId
250
+ ...(a == null ? void 0 : a.includes("mode_id")) && {
251
+ modeId: l == null ? void 0 : l.modeId
1014
252
  },
1015
- ...(l == null ? void 0 : l.includes("variable_id")) && {
1016
- variableId: r == null ? void 0 : r.variableId
253
+ ...(a == null ? void 0 : a.includes("variable_id")) && {
254
+ variableId: l == null ? void 0 : l.variableId
1017
255
  },
1018
- ...(l == null ? void 0 : l.includes("style_id")) && {
1019
- styleId: r == null ? void 0 : r.styleId
256
+ ...(a == null ? void 0 : a.includes("style_id")) && {
257
+ styleId: l == null ? void 0 : l.styleId
1020
258
  }
1021
259
  };
1022
260
  })
1023
261
  )
1024
262
  );
1025
263
  });
1026
- k(this, "makeNativeTokens", () => {
1027
- const l = this.makePaletteData();
1028
- return B(l);
264
+ i(this, "makeNativeTokens", () => {
265
+ const a = this.makePaletteData();
266
+ return E(a);
1029
267
  });
1030
- k(this, "makeDtcgTokens", (l = "RGB") => {
1031
- const n = this.makePaletteData();
1032
- return G(n, l);
268
+ i(this, "makeDtcgTokens", (a = "RGB") => {
269
+ const h = this.makePaletteData();
270
+ return P(h, a);
1033
271
  });
1034
- k(this, "makeStyleDictionaryV3Tokens", () => {
1035
- const l = this.makePaletteData();
1036
- return V(l);
272
+ i(this, "makeStyleDictionaryV3Tokens", () => {
273
+ const a = this.makePaletteData();
274
+ return y(a);
1037
275
  });
1038
- k(this, "makeUniversalJson", () => {
1039
- const l = this.makePaletteData();
1040
- return S(l);
276
+ i(this, "makeUniversalJson", () => {
277
+ const a = this.makePaletteData();
278
+ return _(a);
1041
279
  });
1042
- k(this, "makeCssCustomProps", (l = "RGB") => {
1043
- const n = this.makePaletteData();
1044
- return _(n, l);
280
+ i(this, "makeCssCustomProps", (a = "RGB") => {
281
+ const h = this.makePaletteData();
282
+ return T(h, a);
1045
283
  });
1046
- k(this, "makeScssVariables", (l = "RGB") => {
1047
- const n = this.makePaletteData();
1048
- return P(n, l);
284
+ i(this, "makeScssVariables", (a = "RGB") => {
285
+ const h = this.makePaletteData();
286
+ return w(h, a);
1049
287
  });
1050
- k(this, "makeLessVariables", (l = "RGB") => {
1051
- const n = this.makePaletteData();
1052
- return R(n, l);
288
+ i(this, "makeLessVariables", (a = "RGB") => {
289
+ const h = this.makePaletteData();
290
+ return V(h, a);
1053
291
  });
1054
- k(this, "makeTailwindV3Config", () => {
1055
- const l = this.makePaletteData();
1056
- return K(l);
292
+ i(this, "makeTailwindV3Config", () => {
293
+ const a = this.makePaletteData();
294
+ return A(a);
1057
295
  });
1058
- k(this, "makeTailwindV4Config", () => {
1059
- const l = this.makePaletteData();
1060
- return H(l);
296
+ i(this, "makeTailwindV4Config", () => {
297
+ const a = this.makePaletteData();
298
+ return H(a);
1061
299
  });
1062
- k(this, "makeSwiftUI", () => {
1063
- const l = this.makePaletteData();
1064
- return A(l);
300
+ i(this, "makeSwiftUI", () => {
301
+ const a = this.makePaletteData();
302
+ return M(a);
1065
303
  });
1066
- k(this, "makeUIKit", () => {
1067
- const l = this.makePaletteData();
1068
- return L(l);
304
+ i(this, "makeUIKit", () => {
305
+ const a = this.makePaletteData();
306
+ return R(a);
1069
307
  });
1070
- k(this, "makeCompose", () => {
1071
- const l = this.makePaletteData();
1072
- return U(l);
308
+ i(this, "makeCompose", () => {
309
+ const a = this.makePaletteData();
310
+ return x(a);
1073
311
  });
1074
- k(this, "makeResources", () => {
1075
- const l = this.makePaletteData();
1076
- return j(l);
312
+ i(this, "makeResources", () => {
313
+ const a = this.makePaletteData();
314
+ return N(a);
1077
315
  });
1078
- k(this, "makeCsv", () => {
1079
- const l = this.makePaletteData();
1080
- return O(l);
316
+ i(this, "makeCsv", () => {
317
+ const a = this.makePaletteData();
318
+ return B(a);
1081
319
  });
1082
- k(this, "makePaletteFullData", () => ({
320
+ i(this, "makePaletteFullData", () => ({
1083
321
  base: this.base,
1084
322
  themes: this.themes,
1085
323
  libraryData: this.makeLibraryData(),
@@ -1087,16 +325,16 @@ class J {
1087
325
  version: "2025.06",
1088
326
  type: "UI_COLOR_PALETTE"
1089
327
  }));
1090
- var i;
1091
- this.base = l, this.themes = n, this.meta = t, this.paletteData = {
1092
- name: l.name ?? "UI Color Palette",
1093
- description: l.description,
328
+ var k;
329
+ this.base = a, this.themes = h, this.meta = t, this.paletteData = {
330
+ name: a.name ?? "UI Color Palette",
331
+ description: a.description,
1094
332
  themes: [],
1095
333
  type: "palette"
1096
- }, this.currentScale = ((i = n.find((a) => a.isEnabled)) == null ? void 0 : i.scale) ?? {};
334
+ }, this.currentScale = ((k = h.find((u) => u.isEnabled)) == null ? void 0 : k.scale) ?? {};
1097
335
  }
1098
336
  }
1099
337
  export {
1100
- J as default
338
+ F as default
1101
339
  };
1102
340
  //# sourceMappingURL=data.js.map