@a_ng_d/utils-ui-color-palette 1.5.9 → 1.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,51 +4,51 @@ var k = (m, r, n) => S(m, typeof r != "symbol" ? r + "" : r, n);
4
4
  import { C as x, H as M } from "../../color-1CXTuV84.js";
5
5
  import { c as u } from "../../index-Beb8qoyd.js";
6
6
  const N = (m) => {
7
- const r = m.themes.filter((o) => o.type === "custom theme").length === 0 ? m.themes.filter((o) => o.type === "default theme") : m.themes.filter((o) => o.type === "custom theme"), n = {}, t = (o) => (isNaN(o.hsl[0]) && (o.hsl[0] = 0), isNaN(o.lch[2]) && (o.lch[2] = 0), isNaN(o.oklch[2]) && (o.oklch[2] = 0), {
7
+ const r = 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 = {}, o = (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
8
  rgb: {
9
- r: Math.floor(o.rgb[0]),
10
- g: Math.floor(o.rgb[1]),
11
- b: Math.floor(o.rgb[2])
9
+ r: Math.floor(a.rgb[0]),
10
+ g: Math.floor(a.rgb[1]),
11
+ b: Math.floor(a.rgb[2])
12
12
  },
13
13
  gl: {
14
- r: parseFloat(o.gl[0].toFixed(3)),
15
- g: parseFloat(o.gl[1].toFixed(3)),
16
- b: parseFloat(o.gl[2].toFixed(3))
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
17
  },
18
18
  lch: {
19
- l: Math.floor(o.lch[0]),
20
- c: Math.floor(o.lch[1]),
21
- h: Math.floor(o.lch[2])
19
+ l: Math.floor(a.lch[0]),
20
+ c: Math.floor(a.lch[1]),
21
+ h: Math.floor(a.lch[2])
22
22
  },
23
23
  oklch: {
24
- l: parseFloat(o.oklch[0].toFixed(3)),
25
- c: parseFloat(o.oklch[1].toFixed(3)),
26
- h: Math.floor(o.oklch[2])
24
+ l: parseFloat(a.oklch[0].toFixed(3)),
25
+ c: parseFloat(a.oklch[1].toFixed(3)),
26
+ h: Math.floor(a.oklch[2])
27
27
  },
28
28
  lab: {
29
- l: Math.floor(o.lab[0]),
30
- a: Math.floor(o.lab[1]),
31
- b: Math.floor(o.lab[2])
29
+ l: Math.floor(a.lab[0]),
30
+ a: Math.floor(a.lab[1]),
31
+ b: Math.floor(a.lab[2])
32
32
  },
33
33
  oklab: {
34
- l: parseFloat(o.oklab[0].toFixed(3)),
35
- a: parseFloat(o.oklab[1].toFixed(3)),
36
- b: parseFloat(o.oklab[2].toFixed(3))
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
37
  },
38
38
  hsl: {
39
- h: Math.floor(o.hsl[0]),
40
- s: Math.floor(o.hsl[1] * 100),
41
- l: Math.floor(o.hsl[2] * 100)
39
+ h: Math.floor(a.hsl[0]),
40
+ s: Math.floor(a.hsl[1] * 100),
41
+ l: Math.floor(a.hsl[2] * 100)
42
42
  },
43
43
  hsluv: {
44
- h: Math.floor(o.hsluv[0]),
45
- s: Math.floor(o.hsluv[1]),
46
- l: Math.floor(o.hsluv[2])
44
+ h: Math.floor(a.hsluv[0]),
45
+ s: Math.floor(a.hsluv[1]),
46
+ l: Math.floor(a.hsluv[2])
47
47
  },
48
- hex: o.hex,
49
- description: o.description,
48
+ hex: a.hex,
49
+ description: a.description,
50
50
  type: "color shade/tint"
51
- }), i = (o, e) => ({
51
+ }), c = (a, e) => ({
52
52
  rgb: {
53
53
  r: Math.floor(e.rgb[0]),
54
54
  g: Math.floor(e.rgb[1]),
@@ -90,26 +90,26 @@ const N = (m) => {
90
90
  l: Math.floor(e.hsluv[2])
91
91
  },
92
92
  hex: e.hex,
93
- alpha: o.alpha,
94
- description: o.description,
93
+ alpha: a.alpha,
94
+ description: a.description,
95
95
  type: "color shade/tint"
96
96
  });
97
- return r[0].type === "custom theme" ? r.forEach((o) => {
98
- n[o.name] = {}, o.colors.forEach((e) => {
99
- const a = e.shades.find(
100
- (c) => c.type === "source color"
97
+ return r[0].type === "custom theme" ? r.forEach((a) => {
98
+ n[a.name] = {}, a.colors.forEach((e) => {
99
+ const t = e.shades.find(
100
+ (i) => i.type === "source color"
101
101
  );
102
- n[o.name][e.name] = {}, e.shades.forEach((c) => {
103
- c && a && (n[o.name][e.name][c.name] = c.isTransparent ? i(c, a) : t(c));
104
- }), n[o.name][e.name].description = e.description, n[o.name][e.name].type = "color";
105
- }), n[o.name].description = o.description, n[o.name].type = "color mode";
106
- }) : r.forEach((o) => {
107
- o.colors.forEach((e) => {
108
- const a = e.shades.find(
109
- (c) => c.type === "source color"
102
+ n[a.name][e.name] = {}, e.shades.forEach((i) => {
103
+ i && t && (n[a.name][e.name][i.name] = i.isTransparent ? c(i, t) : o(i));
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
+ }) : r.forEach((a) => {
107
+ a.colors.forEach((e) => {
108
+ const t = e.shades.find(
109
+ (i) => i.type === "source color"
110
110
  );
111
- n[e.name] = {}, e.shades.forEach((c) => {
112
- c && a && (n[e.name][c.name] = c.isTransparent ? i(c, a) : t(c));
111
+ n[e.name] = {}, e.shades.forEach((i) => {
112
+ i && t && (n[e.name][i.name] = i.isTransparent ? c(i, t) : o(i));
113
113
  }), n[e.name].description = e.description, n[e.name].type = "color";
114
114
  });
115
115
  }), n.description = m.description, n.type = "color palette", JSON.stringify(n, null, " ");
@@ -121,33 +121,33 @@ class b {
121
121
  }
122
122
  }
123
123
  const L = (m) => {
124
- const r = 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 r.forEach((t) => {
126
- const i = [];
127
- t.colors.forEach((o) => {
128
- const e = o.shades.find((a) => a.type === "source color");
129
- i.push(`// ${o.name}`), o.shades.reverse().forEach((a) => {
130
- i.push(
131
- a.isTransparent ? `static let ${new b(o.name).doPascalCase()}${a.name === "source" ? "Source" : a.name} = UIColor(red: ${e == null ? void 0 : e.gl[0].toFixed(
124
+ const r = m.themes.filter((o) => o.type === "custom theme").length === 0 ? m.themes.filter((o) => o.type === "default theme") : m.themes.filter((o) => o.type === "custom theme"), n = [];
125
+ return r.forEach((o) => {
126
+ const c = [];
127
+ o.colors.forEach((a) => {
128
+ const e = a.shades.find((t) => t.type === "source color");
129
+ c.push(`// ${a.name}`), a.shades.reverse().forEach((t) => {
130
+ c.push(
131
+ t.isTransparent ? `static let ${new b(a.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = UIColor(red: ${e == null ? void 0 : e.gl[0].toFixed(
132
132
  3
133
133
  )}, green: ${e == null ? void 0 : e.gl[1].toFixed(3)}, blue: ${e == null ? void 0 : e.gl[2].toFixed(
134
134
  3
135
- )}, alpha: ${a.alpha ?? 1})` : `static let ${new b(o.name).doPascalCase()}${a.name === "source" ? "Source" : a.name} = UIColor(red: ${a.gl[0].toFixed(
135
+ )}, alpha: ${t.alpha ?? 1})` : `static let ${new b(a.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = UIColor(red: ${t.gl[0].toFixed(
136
136
  3
137
- )}, green: ${a.gl[1].toFixed(3)}, blue: ${a.gl[2].toFixed(
137
+ )}, green: ${t.gl[1].toFixed(3)}, blue: ${t.gl[2].toFixed(
138
138
  3
139
139
  )})`
140
140
  );
141
- }), i.push("");
142
- }), i.pop(), r[0].type === "custom theme" ? n.push(
143
- `// ${t.name}
144
- struct ${new b(t.name).doPascalCase()} {
145
- ${i.join(
141
+ }), c.push("");
142
+ }), c.pop(), r[0].type === "custom theme" ? n.push(
143
+ `// ${o.name}
144
+ struct ${new b(o.name).doPascalCase()} {
145
+ ${c.join(
146
146
  `
147
147
  `
148
148
  )}
149
149
  }`
150
- ) : n.push(`${i.join(`
150
+ ) : n.push(`${c.join(`
151
151
  `)}`);
152
152
  }), `import UIKit
153
153
 
@@ -157,73 +157,73 @@ struct Color {
157
157
  `)}
158
158
  }`;
159
159
  }, H = (m) => {
160
- const r = 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");
160
+ const r = m.themes.filter((o) => o.type === "custom theme").length === 0 ? m.themes.filter((o) => o.type === "default theme") : m.themes.filter((o) => o.type === "custom theme");
161
161
  let n = `@import "tailwindcss";
162
162
 
163
163
  @theme {
164
164
  --color-*: initial;
165
165
 
166
166
  `;
167
- return r[0].type !== "custom theme" ? r.forEach((t) => {
168
- t.colors.forEach((i) => {
169
- const o = i.shades.find(
167
+ return r[0].type !== "custom theme" ? r.forEach((o) => {
168
+ o.colors.forEach((c) => {
169
+ const a = c.shades.find(
170
170
  (l) => l.type === "source color"
171
- ), e = new b(i.name).doKebabCase();
172
- n += ` /* ${i.name} */
173
- `, i.shades.sort().forEach((l) => {
174
- const h = l.isTransparent ? u((o == null ? void 0 : o.hex) ?? "#000000").alpha(l.alpha ?? 1).hex() : l.hex, s = new b(l.name).doKebabCase();
171
+ ), e = new b(c.name).doKebabCase();
172
+ n += ` /* ${c.name} */
173
+ `, c.shades.sort().forEach((l) => {
174
+ const h = l.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(l.alpha ?? 1).hex() : l.hex, s = new b(l.name).doKebabCase();
175
175
  n += ` --color-${e}-${s}: ${h};
176
176
  `;
177
177
  });
178
- const a = i === t.colors[t.colors.length - 1], c = t === r[r.length - 1];
179
- a && c || (n += `
178
+ const t = c === o.colors[o.colors.length - 1], i = o === r[r.length - 1];
179
+ t && i || (n += `
180
180
  `);
181
181
  });
182
- }) : r.forEach((t) => {
183
- const i = new b(t.name).doKebabCase();
184
- t.colors.forEach((o) => {
185
- const e = o.shades.find(
182
+ }) : r.forEach((o) => {
183
+ const c = new b(o.name).doKebabCase();
184
+ o.colors.forEach((a) => {
185
+ const e = a.shades.find(
186
186
  (h) => h.type === "source color"
187
- ), a = new b(o.name).doKebabCase();
188
- n += ` /* ${t.name} - ${o.name} */
189
- `, o.shades.forEach((h) => {
187
+ ), t = new b(a.name).doKebabCase();
188
+ n += ` /* ${o.name} - ${a.name} */
189
+ `, a.shades.forEach((h) => {
190
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}-${a}-${p}: ${s};
191
+ n += ` --color-${c}-${t}-${p}: ${s};
192
192
  `;
193
193
  });
194
- const c = o === t.colors[t.colors.length - 1], l = t === r[r.length - 1];
195
- c && l || (n += `
194
+ const i = a === o.colors[o.colors.length - 1], l = o === r[r.length - 1];
195
+ i && l || (n += `
196
196
  `);
197
197
  });
198
198
  }), n += `}
199
199
  `, n;
200
200
  }, K = (m) => {
201
- const r = 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 = {
201
+ const r = 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 = {
202
202
  theme: {
203
203
  colors: {}
204
204
  }
205
205
  };
206
- return m.themes[0].colors.forEach((t) => {
207
- n.theme.colors[new b(t.name).doKebabCase()] = {};
208
- }), r[0].type === "custom theme" ? r.forEach((t) => {
209
- t.colors.forEach((i) => {
210
- const o = i.shades.find(
211
- (e) => e.type === "source color"
206
+ return m.themes[0].colors.forEach((a) => {
207
+ n.theme.colors[new b(a.name).doKebabCase()] = {};
208
+ }), r[0].type === "custom theme" ? r.forEach((a) => {
209
+ a.colors.forEach((e) => {
210
+ const t = e.shades.find(
211
+ (i) => i.type === "source color"
212
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((o == null ? void 0 : o.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
213
+ n.theme.colors[new b(e.name).doKebabCase()][new b(a.name).doKebabCase()] = {}, e.shades.forEach((i) => {
214
+ n.theme.colors[new b(e.name).doKebabCase()][new b(a.name).doKebabCase()][new b(i.name).doKebabCase()] = i.isTransparent ? u((t == null ? void 0 : t.hex) ?? "#000000").alpha(i.alpha ?? 1).hex() : i.hex;
215
215
  });
216
216
  });
217
- }) : r.forEach((t) => {
218
- t.colors.forEach((i) => {
219
- const o = i.shades.find(
220
- (e) => e.type === "source color"
217
+ }) : r.forEach((a) => {
218
+ a.colors.forEach((e) => {
219
+ const t = e.shades.find(
220
+ (i) => i.type === "source color"
221
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((o == null ? void 0 : o.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
222
+ n.theme.colors[new b(e.name).doKebabCase()] = {}, e.shades.sort().forEach((i) => {
223
+ n.theme.colors[new b(e.name).doKebabCase()][new b(i.name).doKebabCase()] = i.isTransparent ? u((t == null ? void 0 : t.hex) ?? "#000000").alpha(i.alpha ?? 1).hex() : i.hex;
224
224
  });
225
225
  });
226
- }), `/** @type {import('tailwindcss').Config} */
226
+ }), `/** @type {${"i" + "mport"}('tailwindcss').Config} */
227
227
 
228
228
  module.exports = ${JSON.stringify(
229
229
  n,
@@ -231,25 +231,25 @@ module.exports = ${JSON.stringify(
231
231
  " "
232
232
  )}`;
233
233
  }, A = (m) => {
234
- const r = 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 r.forEach((t) => {
236
- t.colors.forEach((i) => {
237
- const o = i.shades.find((a) => a.type === "source color"), e = [];
234
+ const r = m.themes.filter((o) => o.type === "custom theme").length === 0 ? m.themes.filter((o) => o.type === "default theme") : m.themes.filter((o) => o.type === "custom theme"), n = [];
235
+ return r.forEach((o) => {
236
+ o.colors.forEach((c) => {
237
+ const a = c.shades.find((t) => t.type === "source color"), e = [];
238
238
  e.push(
239
- `// ${r[0].type === "custom theme" ? t.name + " - " : ""}${i.name}`
240
- ), i.shades.reverse().forEach((a) => {
239
+ `// ${r[0].type === "custom theme" ? o.name + " - " : ""}${c.name}`
240
+ ), c.shades.reverse().forEach((t) => {
241
241
  e.push(
242
- a.isTransparent ? `public let ${r[0].type === "custom theme" ? new b(t.name + " " + i.name).doPascalCase() : new b(i.name).doPascalCase()}${a.name === "source" ? "Source" : a.name} = Color(red: ${o == null ? void 0 : o.gl[0].toFixed(
242
+ t.isTransparent ? `public let ${r[0].type === "custom theme" ? new b(o.name + " " + c.name).doPascalCase() : new b(c.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = Color(red: ${a == null ? void 0 : a.gl[0].toFixed(
243
243
  3
244
- )}, green: ${o == null ? void 0 : o.gl[1].toFixed(3)}, blue: ${a.gl[2].toFixed(
244
+ )}, green: ${a == null ? void 0 : a.gl[1].toFixed(3)}, blue: ${t.gl[2].toFixed(
245
245
  3
246
- )}).opacity(${a.alpha ?? 1})` : `public let ${r[0].type === "custom theme" ? new b(t.name + " " + i.name).doPascalCase() : new b(i.name).doPascalCase()}${a.name === "source" ? "Source" : a.name} = Color(red: ${a.gl[0].toFixed(
246
+ )}).opacity(${t.alpha ?? 1})` : `public let ${r[0].type === "custom theme" ? new b(o.name + " " + c.name).doPascalCase() : new b(c.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = Color(red: ${t.gl[0].toFixed(
247
247
  3
248
- )}, green: ${a.gl[1].toFixed(3)}, blue: ${a.gl[2].toFixed(
248
+ )}, green: ${t.gl[1].toFixed(3)}, blue: ${t.gl[2].toFixed(
249
249
  3
250
250
  )})`
251
251
  );
252
- }), e.push(""), e.forEach((a) => n.push(a));
252
+ }), e.push(""), e.forEach((t) => n.push(t));
253
253
  });
254
254
  }), n.pop(), `import SwiftUI
255
255
 
@@ -263,40 +263,40 @@ public extension Color {
263
263
  }
264
264
  }`;
265
265
  }, V = (m) => {
266
- const r = 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 = {
266
+ const r = 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 = {
267
267
  color: {}
268
- }, t = (i, o, e) => ({
268
+ }, o = (c, a, e) => ({
269
269
  type: "color",
270
- value: o.isTransparent ? u(e.hex).alpha(o.alpha ?? 1).hex() : o.hex,
271
- comment: i.description !== "" ? i.description + " - " + o.description : o.description
270
+ value: a.isTransparent ? u(e.hex).alpha(a.alpha ?? 1).hex() : a.hex,
271
+ comment: c.description !== "" ? c.description + " - " + a.description : a.description
272
272
  });
273
- return m.themes[0].colors.forEach((i) => {
274
- n.color[i.name] = {};
275
- }), r[0].type === "custom theme" ? r.forEach((i) => {
276
- i.colors.forEach((o) => {
277
- const e = o.shades.find(
278
- (a) => a.type === "source color"
273
+ return m.themes[0].colors.forEach((c) => {
274
+ n.color[c.name] = {};
275
+ }), r[0].type === "custom theme" ? r.forEach((c) => {
276
+ c.colors.forEach((a) => {
277
+ const e = a.shades.find(
278
+ (t) => t.type === "source color"
279
279
  );
280
- n.color[o.name][i.name] = {}, o.shades.forEach((a) => {
281
- a && e && (n.color[o.name][i.name][a.name] = t(
282
- o,
280
+ n.color[a.name][c.name] = {}, a.shades.forEach((t) => {
281
+ t && e && (n.color[a.name][c.name][t.name] = o(
283
282
  a,
283
+ t,
284
284
  e
285
285
  ));
286
286
  });
287
287
  });
288
- }) : r.forEach((i) => {
289
- i.colors.forEach((o) => {
290
- const e = o.shades.find(
291
- (a) => a.type === "source color"
288
+ }) : r.forEach((c) => {
289
+ c.colors.forEach((a) => {
290
+ const e = a.shades.find(
291
+ (t) => t.type === "source color"
292
292
  );
293
- n.color[o.name] = {}, o.shades.forEach((a) => {
294
- a && e && (n.color[o.name][a.name] = t(o, a, e));
293
+ n.color[a.name] = {}, a.shades.forEach((t) => {
294
+ t && e && (n.color[a.name][t.name] = o(a, t, e));
295
295
  });
296
296
  });
297
297
  }), JSON.stringify(n, null, " ");
298
298
  }, P = (m, r) => {
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 = [], o = (s) => {
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"), o = [], c = [], a = (s) => {
300
300
  var f;
301
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
302
  const p = {
@@ -342,20 +342,20 @@ public extension Color {
342
342
  }
343
343
  };
344
344
  return ($ = f[r ?? "RGB"]) == null ? void 0 : $.call(f);
345
- }, a = n.find(
345
+ }, t = n.find(
346
346
  (s) => s.type === "default theme"
347
347
  );
348
- if (a) {
348
+ if (t) {
349
349
  const s = [];
350
- return a.colors.forEach((p, f) => {
350
+ return t.colors.forEach((p, f) => {
351
351
  f > 0 && s.push(""), s.push(`// ${p.name}`), p.shades.reverse().forEach(($) => {
352
352
  const g = p.shades.find((C) => C.type === "source color"), d = `$${new b(p.name).doKebabCase()}-${$.name}`;
353
353
  g && s.push(
354
- `${d}: ${$.isTransparent ? e($, g) : o($)};`
354
+ `${d}: ${$.isTransparent ? e($, g) : a($)};`
355
355
  );
356
356
  });
357
- }), t.push(s.join(`
358
- `)), t.join(`
357
+ }), o.push(s.join(`
358
+ `)), o.join(`
359
359
  `);
360
360
  }
361
361
  n.forEach((s) => {
@@ -364,25 +364,25 @@ public extension Color {
364
364
  g > 0 && f.push(""), f.push(` // ${$.name}`), $.shades.reverse().forEach((d) => {
365
365
  const C = $.shades.find((F) => F.type === "source color"), E = `--${new b($.name).doKebabCase()}-${d.name}`;
366
366
  C && f.push(
367
- ` ${E}: ${d.isTransparent ? e(d, C) : o(d)};`
367
+ ` ${E}: ${d.isTransparent ? e(d, C) : a(d)};`
368
368
  );
369
369
  });
370
- }), f.push("}"), t.push(f.join(`
370
+ }), f.push("}"), o.push(f.join(`
371
371
  `));
372
372
  });
373
- const c = /* @__PURE__ */ new Set();
373
+ const i = /* @__PURE__ */ new Set();
374
374
  if (n.forEach((s) => {
375
375
  s.colors.forEach((p) => {
376
376
  p.shades.forEach((f) => {
377
377
  if (p.shades.find((g) => g.type === "source color")) {
378
378
  const d = `--${new b(p.name).doKebabCase()}-${f.name}`;
379
- c.add(d);
379
+ i.add(d);
380
380
  }
381
381
  });
382
382
  });
383
- }), c.size > 0) {
383
+ }), i.size > 0) {
384
384
  const s = /* @__PURE__ */ new Map();
385
- c.forEach((p) => {
385
+ i.forEach((p) => {
386
386
  const f = p.match(/--([a-zA-Z0-9-]+)-([a-zA-Z0-9-]+)/);
387
387
  if (f) {
388
388
  const $ = f[1];
@@ -391,10 +391,10 @@ public extension Color {
391
391
  s.get($).push(`${g}: var(${p});`);
392
392
  }
393
393
  }), s.forEach((p, f) => {
394
- i.push(
394
+ c.push(
395
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(`
396
+ ), c.push(...p), c.push("");
397
+ }), c.length > 0 && c[c.length - 1] === "" && c.pop(), o.push(c.join(`
398
398
  `));
399
399
  }
400
400
  const l = [":root {"];
@@ -403,7 +403,7 @@ public extension Color {
403
403
  l.push(` &[data-theme="${f}"] {
404
404
  @include ${f};
405
405
  }`), p !== n.length - 1 && l.push("");
406
- }), l.push("}"), t.push(l.join(`
406
+ }), l.push("}"), o.push(l.join(`
407
407
  `));
408
408
  const h = [];
409
409
  return n.forEach((s) => {
@@ -411,23 +411,23 @@ public extension Color {
411
411
  h.push(`.${p} {
412
412
  @include ${p};
413
413
  }`);
414
- }), t.push(h.join(`
414
+ }), o.push(h.join(`
415
415
 
416
- `)), t.join(`
416
+ `)), o.join(`
417
417
 
418
418
  `);
419
419
  }, j = (m) => {
420
- const r = 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 r.forEach((t) => {
422
- t.colors.forEach((i) => {
423
- const o = i.shades.find((a) => a.type === "source color"), e = [];
420
+ const r = m.themes.filter((o) => o.type === "custom theme").length === 0 ? m.themes.filter((o) => o.type === "default theme") : m.themes.filter((o) => o.type === "custom theme"), n = [];
421
+ return r.forEach((o) => {
422
+ o.colors.forEach((c) => {
423
+ const a = c.shades.find((t) => t.type === "source color"), e = [];
424
424
  e.push(
425
- `<!--${r[0].type === "custom theme" ? `${t.name} - ${i.name}-->` : `${i.name}-->`}`
426
- ), i.shades.reverse().forEach((a) => {
425
+ `<!--${r[0].type === "custom theme" ? `${o.name} - ${c.name}-->` : `${c.name}-->`}`
426
+ ), c.shades.reverse().forEach((t) => {
427
427
  e.push(
428
- `<color name="${r[0].type === "custom theme" ? new b(t.name + " " + i.name).doSnakeCase() : new b(i.name).doSnakeCase()}_${a.name}">${a.isTransparent ? u((o == null ? void 0 : o.hex) ?? "#000000").alpha(a.alpha ?? 1).hex() : a.hex}</color>`
428
+ `<color name="${r[0].type === "custom theme" ? new b(o.name + " " + c.name).doSnakeCase() : new b(c.name).doSnakeCase()}_${t.name}">${t.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(t.alpha ?? 1).hex() : t.hex}</color>`
429
429
  );
430
- }), e.push(""), e.forEach((a) => n.push(a));
430
+ }), e.push(""), e.forEach((t) => n.push(t));
431
431
  });
432
432
  }), n.pop(), `<?xml version="1.0" encoding="utf-8"?>
433
433
  <resources>
@@ -437,47 +437,47 @@ public extension Color {
437
437
  )}
438
438
  </resources>`;
439
439
  }, B = (m) => {
440
- const r = m.themes.filter((o) => o.type === "custom theme").length === 0 ? m.themes.filter((o) => o.type === "default theme") : m.themes.filter((o) => o.type === "custom theme"), n = {
440
+ const r = 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
441
  $themes: [],
442
442
  $metadata: {
443
443
  activeThemes: [],
444
444
  tokenSetOrder: [],
445
445
  activeSets: []
446
446
  }
447
- }, t = m.name, i = (o, e, a) => ({
447
+ }, o = m.name, c = (a, e, t) => ({
448
448
  $type: "color",
449
- $value: e.isTransparent ? u(a.hex).alpha(e.alpha ?? 1).hex() : e.hex,
450
- $description: o.description !== "" ? o.description + " - " + e.description : e.description
449
+ $value: e.isTransparent ? u(t.hex).alpha(e.alpha ?? 1).hex() : e.hex,
450
+ $description: a.description !== "" ? a.description + " - " + e.description : e.description
451
451
  });
452
- return r[0].type === "custom theme" ? r.forEach((o) => {
453
- o.colors.forEach((e) => {
454
- const a = e.shades.find(
455
- (c) => c.type === "source color"
452
+ return r[0].type === "custom theme" ? r.forEach((a) => {
453
+ a.colors.forEach((e) => {
454
+ const t = e.shades.find(
455
+ (i) => i.type === "source color"
456
456
  );
457
- n[`${o.name}/${e.name}`] = {}, e.shades.forEach((c) => {
458
- c && a && (n[`${o.name}/${e.name}`][c.name] = i(
457
+ n[`${a.name}/${e.name}`] = {}, e.shades.forEach((i) => {
458
+ i && t && (n[`${a.name}/${e.name}`][i.name] = c(
459
459
  e,
460
- c,
461
- a
460
+ i,
461
+ t
462
462
  ));
463
463
  });
464
464
  });
465
- }) : r.forEach((o) => {
466
- o.colors.forEach((e) => {
467
- const a = e.shades.find(
468
- (c) => c.type === "source color"
465
+ }) : r.forEach((a) => {
466
+ a.colors.forEach((e) => {
467
+ const t = e.shades.find(
468
+ (i) => i.type === "source color"
469
469
  );
470
- n[`${t}/${e.name}`] = {}, e.shades.forEach((c) => {
471
- c && a && (n[`${t}/${e.name}`][c.name] = i(
470
+ n[`${o}/${e.name}`] = {}, e.shades.forEach((i) => {
471
+ i && t && (n[`${o}/${e.name}`][i.name] = c(
472
472
  e,
473
- c,
474
- a
473
+ i,
474
+ t
475
475
  ));
476
476
  });
477
477
  });
478
478
  }), JSON.stringify(n, null, " ");
479
479
  }, R = (m, r) => {
480
- const n = m.themes.filter((l) => l.type === "custom theme").length === 0 ? m.themes.filter((l) => l.type === "default theme") : m.themes.filter((l) => l.type === "custom theme"), t = [], i = (l) => {
480
+ const n = m.themes.filter((l) => l.type === "custom theme").length === 0 ? m.themes.filter((l) => l.type === "default theme") : m.themes.filter((l) => l.type === "custom theme"), o = [], c = (l) => {
481
481
  var s;
482
482
  isNaN(l.hsl[0]) && (l.hsl[0] = 0), isNaN(l.lch[2]) && (l.lch[2] = 0), isNaN(l.oklch[2]) && (l.oklch[2] = 0);
483
483
  const h = {
@@ -494,7 +494,7 @@ public extension Color {
494
494
  OKLCH: () => `oklch(${Math.floor(l.oklch[0] * 100)}% ${l.oklch[1].toFixed(3)} ${Math.floor(l.oklch[2])})`
495
495
  };
496
496
  return (s = h[r ?? "RGB"]) == null ? void 0 : s.call(h);
497
- }, o = (l, h) => {
497
+ }, a = (l, h) => {
498
498
  var p;
499
499
  isNaN(l.hsl[0]) && (l.hsl[0] = 0), isNaN(l.lch[2]) && (l.lch[2] = 0), isNaN(l.oklch[2]) && (l.oklch[2] = 0);
500
500
  const s = {
@@ -532,11 +532,11 @@ public extension Color {
532
532
  s > 0 && l.push(""), l.push(`// ${h.name}`), h.shades.reverse().forEach((p) => {
533
533
  const f = h.shades.find((g) => g.type === "source color"), $ = `@${new b(h.name).doKebabCase()}-${p.name}`;
534
534
  f && l.push(
535
- `${$}: ${p.isTransparent ? o(p, f) : i(p)};`
535
+ `${$}: ${p.isTransparent ? a(p, f) : c(p)};`
536
536
  );
537
537
  });
538
- }), t.push(l.join(`
539
- `)), t.join(`
538
+ }), o.push(l.join(`
539
+ `)), o.join(`
540
540
  `);
541
541
  }
542
542
  n.forEach((l) => {
@@ -545,36 +545,36 @@ public extension Color {
545
545
  f > 0 && s.push(""), s.push(` // ${p.name}`), p.shades.reverse().forEach(($) => {
546
546
  const g = p.shades.find((C) => C.type === "source color"), d = `@${new b(p.name).doKebabCase()}-${$.name}`;
547
547
  g && s.push(
548
- ` ${d}: ${$.isTransparent ? o($, g) : i($)};`
548
+ ` ${d}: ${$.isTransparent ? a($, g) : c($)};`
549
549
  );
550
550
  });
551
- }), s.push("}"), t.push(s.join(`
551
+ }), s.push("}"), o.push(s.join(`
552
552
  `));
553
553
  });
554
- const a = [":root {"];
554
+ const t = [":root {"];
555
555
  n.forEach((l, h) => {
556
556
  const s = new b(l.name).doKebabCase();
557
- a.push(` &[data-theme="${s}"] {
557
+ t.push(` &[data-theme="${s}"] {
558
558
  .${s}();
559
- }`), h !== n.length - 1 && a.push("");
560
- }), a.push("}"), t.push(a.join(`
559
+ }`), h !== n.length - 1 && t.push("");
560
+ }), t.push("}"), o.push(t.join(`
561
561
  `));
562
- const c = [];
562
+ const i = [];
563
563
  return n.forEach((l) => {
564
564
  const h = new b(l.name).doKebabCase();
565
- c.push(`.${h} {
565
+ i.push(`.${h} {
566
566
  .${h}();
567
567
  }`);
568
- }), t.push(c.join(`
568
+ }), o.push(i.join(`
569
569
 
570
- `)), t.join(`
570
+ `)), o.join(`
571
571
 
572
572
  `);
573
573
  }, G = (m, r) => {
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;
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"), o = {}, c = (e) => {
575
+ var i;
576
576
  isNaN(e.oklch[2]) && (e.oklch[2] = 0);
577
- const a = {
577
+ const t = {
578
578
  RGB: () => ({
579
579
  colorSpace: "srgb",
580
580
  components: [
@@ -594,11 +594,11 @@ public extension Color {
594
594
  hex: e.hex
595
595
  })
596
596
  };
597
- return (c = a[r ?? "RGB"]) == null ? void 0 : c.call(a);
598
- }, o = (e, a) => {
597
+ return (i = t[r ?? "RGB"]) == null ? void 0 : i.call(t);
598
+ }, a = (e, t) => {
599
599
  var l;
600
- isNaN(a.oklch[2]) && (a.oklch[2] = 0);
601
- const c = {
600
+ isNaN(t.oklch[2]) && (t.oklch[2] = 0);
601
+ const i = {
602
602
  RGB: () => ({
603
603
  colorSpace: "srgb",
604
604
  components: [
@@ -607,7 +607,7 @@ public extension Color {
607
607
  parseFloat(e.gl[2].toFixed(3))
608
608
  ],
609
609
  hex: e.hex,
610
- alpha: a.alpha
610
+ alpha: t.alpha
611
611
  }),
612
612
  OKLCH: () => ({
613
613
  colorSpace: "oklch",
@@ -617,66 +617,66 @@ public extension Color {
617
617
  parseFloat(e.oklch[2].toFixed(0))
618
618
  ],
619
619
  hex: e.hex,
620
- alpha: a.alpha
620
+ alpha: t.alpha
621
621
  })
622
622
  };
623
- return (l = c[r ?? "RGB"]) == null ? void 0 : l.call(c);
623
+ return (l = i[r ?? "RGB"]) == null ? void 0 : l.call(i);
624
624
  };
625
625
  return n[0].type === "custom theme" ? n.forEach((e) => {
626
- e.colors.forEach((a) => {
627
- const c = a.shades.find(
626
+ e.colors.forEach((t) => {
627
+ const i = t.shades.find(
628
628
  (l) => l.type === "source color"
629
629
  );
630
- t[a.name] || (t[a.name] = {
630
+ o[t.name] || (o[t.name] = {
631
631
  $type: "color"
632
- }), a.shades.forEach((l) => {
633
- !t[a.name][l.name] && c && (t[a.name][l.name] = {
632
+ }), t.shades.forEach((l) => {
633
+ !o[t.name][l.name] && i && (o[t.name][l.name] = {
634
634
  $type: "color",
635
- $value: l.isTransparent ? o(c, l) : i(l),
636
- $description: a.description !== "" ? a.description + " - " + l.description : l.description,
635
+ $value: l.isTransparent ? a(i, l) : c(l),
636
+ $description: t.description !== "" ? t.description + " - " + l.description : l.description,
637
637
  $extensions: {
638
638
  mode: {}
639
639
  }
640
- }), c && (t[a.name][l.name].$extensions.mode[e.name] = l.isTransparent ? o(c, l) : i(l));
640
+ }), i && (o[t.name][l.name].$extensions.mode[e.name] = l.isTransparent ? a(i, l) : c(l));
641
641
  });
642
642
  });
643
643
  }) : n.forEach((e) => {
644
- e.colors.forEach((a) => {
645
- const c = a.shades.find(
644
+ e.colors.forEach((t) => {
645
+ const i = t.shades.find(
646
646
  (l) => l.type === "source color"
647
647
  );
648
- t[a.name] = {}, a.shades.forEach((l) => {
649
- l && c && (t[a.name][l.name] = {
648
+ o[t.name] = {}, t.shades.forEach((l) => {
649
+ l && i && (o[t.name][l.name] = {
650
650
  $type: "color",
651
- $value: l.isTransparent ? o(c, l) : i(l),
652
- $description: a.description !== "" ? a.description + " - " + l.description : l.description
651
+ $value: l.isTransparent ? a(i, l) : c(l),
652
+ $description: t.description !== "" ? t.description + " - " + l.description : l.description
653
653
  });
654
654
  });
655
655
  });
656
- }), JSON.stringify(t, null, " ");
656
+ }), JSON.stringify(o, null, " ");
657
657
  }, O = (m) => {
658
- const r = 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 = [], o = [], e = [], a = [];
659
- return r.forEach((c) => {
660
- c.colors.forEach((l) => {
658
+ const r = 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 = [], o = [], c = [], a = [], e = [], t = [];
659
+ return r.forEach((i) => {
660
+ i.colors.forEach((l) => {
661
661
  l.shades.forEach((h) => {
662
- i.push(h.name), o.push(Math.floor(h.lch[0])), e.push(Math.floor(h.lch[1])), a.push(Math.floor(h.lch[2]));
662
+ c.push(h.name), a.push(Math.floor(h.lch[0])), e.push(Math.floor(h.lch[1])), t.push(Math.floor(h.lch[2]));
663
663
  }), n.push({
664
664
  name: l.name,
665
665
  csv: `${l.name},Lightness,Chroma,Hue
666
- ${i.map((h, s) => `${h},${o[s]},${e[s]},${a[s]}`).join(`
666
+ ${c.map((h, s) => `${h},${a[s]},${e[s]},${t[s]}`).join(`
667
667
  `)}`
668
- }), i.splice(0, i.length), o.splice(0, o.length), e.splice(0, e.length), a.splice(0, a.length);
669
- }), t.push({
670
- name: c.name,
668
+ }), c.splice(0, c.length), a.splice(0, a.length), e.splice(0, e.length), t.splice(0, t.length);
669
+ }), o.push({
670
+ name: i.name,
671
671
  colors: n.map((l) => l),
672
- type: c.type
672
+ type: i.type
673
673
  }), n.splice(0, n.length);
674
- }), t;
674
+ }), o;
675
675
  }, _ = (m, r) => {
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;
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"), o = [], c = (e) => {
677
+ var i;
678
678
  isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0);
679
- const a = {
679
+ const t = {
680
680
  RGB: () => `rgb(${Math.floor(e.rgb[0])}, ${Math.floor(
681
681
  e.rgb[1]
682
682
  )}, ${Math.floor(e.rgb[2])})`,
@@ -692,73 +692,73 @@ ${i.map((h, s) => `${h},${o[s]},${e[s]},${a[s]}`).join(`
692
692
  3
693
693
  )} ${e.gl[2].toFixed(3)})`
694
694
  };
695
- return (c = a[r ?? "RGB"]) == null ? void 0 : c.call(a);
696
- }, o = (e, a) => {
695
+ return (i = t[r ?? "RGB"]) == null ? void 0 : i.call(t);
696
+ }, a = (e, t) => {
697
697
  var l;
698
- const c = {
698
+ const i = {
699
699
  RGB: () => {
700
700
  var h;
701
- return `rgb(${Math.floor(a.rgb[0])}, ${Math.floor(
702
- a.rgb[1]
703
- )}, ${Math.floor(a.rgb[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
701
+ return `rgb(${Math.floor(t.rgb[0])}, ${Math.floor(
702
+ t.rgb[1]
703
+ )}, ${Math.floor(t.rgb[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
704
704
  },
705
- HEX: () => u(a.hex).alpha(e.alpha ?? 1).hex(),
705
+ HEX: () => u(t.hex).alpha(e.alpha ?? 1).hex(),
706
706
  HSL: () => {
707
707
  var h;
708
- return `hsl(${Math.floor(a.hsl[0])} ${Math.floor(
709
- a.hsl[1] * 100
710
- )}% ${Math.floor(a.hsl[2] * 100)}% / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
708
+ return `hsl(${Math.floor(t.hsl[0])} ${Math.floor(
709
+ t.hsl[1] * 100
710
+ )}% ${Math.floor(t.hsl[2] * 100)}% / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
711
711
  },
712
712
  LCH: () => {
713
713
  var h;
714
- return `lch(${Math.floor(a.lch[0])}% ${Math.floor(
715
- a.lch[1]
716
- )} ${Math.floor(a.lch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
714
+ return `lch(${Math.floor(t.lch[0])}% ${Math.floor(
715
+ t.lch[1]
716
+ )} ${Math.floor(t.lch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
717
717
  },
718
718
  OKLCH: () => {
719
719
  var h;
720
- return `oklch(${Math.floor(a.oklch[0])}% ${a.oklch[1].toFixed(3)} ${Math.floor(a.oklch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
720
+ return `oklch(${Math.floor(t.oklch[0])}% ${t.oklch[1].toFixed(3)} ${Math.floor(t.oklch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
721
721
  },
722
722
  P3: () => {
723
723
  var h;
724
- return `color(display-p3 ${a.gl[0].toFixed(3)} ${a.gl[1].toFixed(
724
+ return `color(display-p3 ${t.gl[0].toFixed(3)} ${t.gl[1].toFixed(
725
725
  3
726
- )} ${a.gl[2].toFixed(3)} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
726
+ )} ${t.gl[2].toFixed(3)} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
727
727
  }
728
728
  };
729
- return (l = c[r ?? "RGB"]) == null ? void 0 : l.call(c);
729
+ return (l = i[r ?? "RGB"]) == null ? void 0 : l.call(i);
730
730
  };
731
731
  return n.forEach((e) => {
732
- const a = [];
733
- e.colors.forEach((c) => {
734
- a.push(`/* ${c.name} */`), c.shades.reverse().forEach((l) => {
735
- const h = c.shades.find((s) => s.type === "source color");
736
- h && a.push(
737
- `--${new b(c.name).doKebabCase()}-${l.name}: ${l.isTransparent ? o(l, h) : i(l)};`
732
+ const t = [];
733
+ e.colors.forEach((i) => {
734
+ t.push(`/* ${i.name} */`), i.shades.reverse().forEach((l) => {
735
+ const h = i.shades.find((s) => s.type === "source color");
736
+ h && t.push(
737
+ `--${new b(i.name).doKebabCase()}-${l.name}: ${l.isTransparent ? a(l, h) : c(l)};`
738
738
  );
739
- }), a.push("");
740
- }), a.pop(), t.push(
739
+ }), t.push("");
740
+ }), t.pop(), o.push(
741
741
  `${e.type === "custom theme" ? `/* ${e.name} */
742
742
  ` : ""}:root${e.type === "custom theme" ? `[data-theme='${new b(e.name).doKebabCase()}']` : ""} {
743
- ${a.join(`
743
+ ${t.join(`
744
744
  `)}
745
745
  }`
746
746
  );
747
- }), t.join(`
747
+ }), o.join(`
748
748
 
749
749
  `);
750
750
  }, U = (m) => {
751
- const r = 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 = [];
752
- return r.forEach((t) => {
753
- t.colors.forEach((i) => {
754
- const o = i.shades.find((a) => a.type === "source color"), e = [];
751
+ const r = m.themes.filter((o) => o.type === "custom theme").length === 0 ? m.themes.filter((o) => o.type === "default theme") : m.themes.filter((o) => o.type === "custom theme"), n = [];
752
+ return r.forEach((o) => {
753
+ o.colors.forEach((c) => {
754
+ const a = c.shades.find((t) => t.type === "source color"), e = [];
755
755
  e.push(
756
- `// ${r[0].type === "custom theme" ? t.name + " - " : ""}${i.name}`
757
- ), i.shades.reverse().forEach((a) => {
756
+ `// ${r[0].type === "custom theme" ? o.name + " - " : ""}${c.name}`
757
+ ), c.shades.reverse().forEach((t) => {
758
758
  e.push(
759
- `val ${r[0].type === "custom theme" ? new b(t.name + " " + i.name).doSnakeCase() : new b(i.name).doSnakeCase()}_${a.name} = Color(${a.isTransparent ? u((o == null ? void 0 : o.hex) ?? "#000000").alpha(a.alpha ?? 1).hex().replace("#", "0xFF").toUpperCase() : a.hex.replace("#", "0xFF").toUpperCase()})`
759
+ `val ${r[0].type === "custom theme" ? new b(o.name + " " + c.name).doSnakeCase() : new b(c.name).doSnakeCase()}_${t.name} = Color(${t.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(t.alpha ?? 1).hex().replace("#", "0xFF").toUpperCase() : t.hex.replace("#", "0xFF").toUpperCase()})`
760
760
  );
761
- }), e.push(""), e.forEach((a) => n.push(a));
761
+ }), e.push(""), e.forEach((t) => n.push(t));
762
762
  });
763
763
  }), n.pop(), `import androidx.compose.ui.graphics.Color
764
764
 
@@ -769,7 +769,7 @@ class J {
769
769
  constructor({
770
770
  base: r,
771
771
  themes: n,
772
- meta: t
772
+ meta: o
773
773
  }) {
774
774
  k(this, "base");
775
775
  k(this, "themes");
@@ -784,24 +784,24 @@ class J {
784
784
  colors: [],
785
785
  type: r.type
786
786
  };
787
- this.base.colors.forEach((t) => {
788
- const i = Object.entries(r.scale).reverse().map((h) => {
789
- if (t.alpha.isEnabled) {
787
+ this.base.colors.forEach((o) => {
788
+ const c = Object.entries(r.scale).reverse().map((h) => {
789
+ if (o.alpha.isEnabled) {
790
790
  const s = new x({
791
791
  render: "RGB",
792
792
  sourceColor: [
793
- t.rgb.r * 255,
794
- t.rgb.g * 255,
795
- t.rgb.b * 255
793
+ o.rgb.r * 255,
794
+ o.rgb.g * 255,
795
+ o.rgb.b * 255
796
796
  ],
797
797
  alpha: parseFloat((h[1] / 100).toFixed(2)),
798
- hueShifting: t.hue.shift !== void 0 ? t.hue.shift : 0,
799
- chromaShifting: t.chroma.shift !== void 0 ? t.chroma.shift : 100,
798
+ hueShifting: o.hue.shift !== void 0 ? o.hue.shift : 0,
799
+ chromaShifting: o.chroma.shift !== void 0 ? o.chroma.shift : 100,
800
800
  algorithmVersion: this.base.algorithmVersion,
801
801
  visionSimulationMode: r.visionSimulationMode
802
802
  }), p = new x({
803
803
  render: "RGB",
804
- sourceColor: u(t.alpha.backgroundColor).rgb(),
804
+ sourceColor: u(o.alpha.backgroundColor).rgb(),
805
805
  algorithmVersion: this.base.algorithmVersion,
806
806
  visionSimulationMode: r.visionSimulationMode
807
807
  });
@@ -873,13 +873,13 @@ class J {
873
873
  const s = new x({
874
874
  render: "RGB",
875
875
  sourceColor: [
876
- t.rgb.r * 255,
877
- t.rgb.g * 255,
878
- t.rgb.b * 255
876
+ o.rgb.r * 255,
877
+ o.rgb.g * 255,
878
+ o.rgb.b * 255
879
879
  ],
880
880
  lightness: h[1],
881
- hueShifting: t.hue.shift !== void 0 ? t.hue.shift : 0,
882
- chromaShifting: t.chroma.shift !== void 0 ? t.chroma.shift : 100,
881
+ hueShifting: o.hue.shift !== void 0 ? o.hue.shift : 0,
882
+ chromaShifting: o.chroma.shift !== void 0 ? o.chroma.shift : 100,
883
883
  algorithmVersion: this.base.algorithmVersion,
884
884
  visionSimulationMode: r.visionSimulationMode
885
885
  });
@@ -900,18 +900,18 @@ class J {
900
900
  return [h, [0, 0, 0]];
901
901
  }
902
902
  }
903
- }), o = {
904
- id: t.id,
905
- name: t.name,
906
- description: t.description,
903
+ }), a = {
904
+ id: o.id,
905
+ name: o.name,
906
+ description: o.description,
907
907
  shades: [],
908
908
  type: "color"
909
909
  }, e = [
910
- t.rgb.r * 255,
911
- t.rgb.g * 255,
912
- t.rgb.b * 255
913
- ], a = new M();
914
- a.rgb_r = t.rgb.r, a.rgb_g = t.rgb.g, a.rgb_b = t.rgb.b, a.rgbToHsluv(), o.shades.push({
910
+ o.rgb.r * 255,
911
+ o.rgb.g * 255,
912
+ o.rgb.b * 255
913
+ ], t = new M();
914
+ t.rgb_r = o.rgb.r, t.rgb_g = o.rgb.g, t.rgb_b = o.rgb.b, t.rgbToHsluv(), a.shades.push({
915
915
  name: "source",
916
916
  description: "Source color",
917
917
  hex: u(e).hex(),
@@ -923,20 +923,20 @@ class J {
923
923
  oklab: u(e).oklab(),
924
924
  hsl: u(e).hsl(),
925
925
  hsluv: [
926
- a.hsluv_h,
927
- a.hsluv_s,
928
- a.hsluv_l
926
+ t.hsluv_h,
927
+ t.hsluv_s,
928
+ t.hsluv_l
929
929
  ],
930
930
  type: "source color"
931
931
  });
932
- const c = i.map(
932
+ const i = c.map(
933
933
  (h) => u.distance(
934
934
  u(e).hex(),
935
935
  u(h[1]).hex(),
936
936
  "rgb"
937
937
  )
938
- ), l = c.indexOf(Math.min(...c));
939
- i.forEach((h, s) => {
938
+ ), l = i.indexOf(Math.min(...i));
939
+ c.forEach((h, s) => {
940
940
  const p = u.distance(
941
941
  u(e).hex(),
942
942
  u(h[1]).hex(),
@@ -952,21 +952,21 @@ class J {
952
952
  sourceColor: u(e).rgb(),
953
953
  visionSimulationMode: r.visionSimulationMode
954
954
  }).setColor();
955
- s === l && 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(), o.shades.push({
955
+ s === l && this.base.areSourceColorsLocked && !o.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({
956
956
  name: f,
957
- description: `Shade/Tint color with ${typeof h[0][1] == "number" ? h[0][1].toFixed(1) : h[0][1]}% of ${t.alpha.isEnabled ? "opacity" : "lightness"}`,
958
- hex: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).hex() : u(h[1]).hex(),
959
- rgb: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).rgb() : u(h[1]).rgb(),
960
- gl: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).gl() : u(h[1]).gl(),
961
- lch: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).lch() : u(h[1]).lch(),
962
- oklch: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).oklch() : u(h[1]).oklch(),
963
- lab: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).lab() : u(h[1]).lab(),
964
- oklab: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).oklab() : u(h[1]).oklab(),
965
- hsl: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).hsl() : u(h[1]).hsl(),
957
+ description: `Shade/Tint color with ${typeof h[0][1] == "number" ? h[0][1].toFixed(1) : h[0][1]}% of ${o.alpha.isEnabled ? "opacity" : "lightness"}`,
958
+ hex: s === l && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? u(d).hex() : u(h[1]).hex(),
959
+ rgb: s === l && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? u(d).rgb() : u(h[1]).rgb(),
960
+ gl: s === l && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? u(d).gl() : u(h[1]).gl(),
961
+ lch: s === l && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? u(d).lch() : u(h[1]).lch(),
962
+ oklch: s === l && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? u(d).oklch() : u(h[1]).oklch(),
963
+ lab: s === l && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? u(d).lab() : u(h[1]).lab(),
964
+ oklab: s === l && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? u(d).oklab() : u(h[1]).oklab(),
965
+ hsl: s === l && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? u(d).hsl() : u(h[1]).hsl(),
966
966
  hsluv: [$.hsluv_h, $.hsluv_s, $.hsluv_l],
967
- alpha: t.alpha.isEnabled ? parseFloat((h[0][1] / 100).toFixed(2)) : void 0,
968
- backgroundColor: t.alpha.isEnabled && t.alpha.backgroundColor ? u(h[2]).rgb() : void 0,
969
- mixedColor: t.alpha.isEnabled && t.alpha.backgroundColor ? new x({
967
+ alpha: o.alpha.isEnabled ? parseFloat((h[0][1] / 100).toFixed(2)) : void 0,
968
+ backgroundColor: o.alpha.isEnabled && o.alpha.backgroundColor ? u(h[2]).rgb() : void 0,
969
+ mixedColor: o.alpha.isEnabled && o.alpha.backgroundColor ? new x({
970
970
  visionSimulationMode: r.visionSimulationMode
971
971
  }).mixColorsRgb(
972
972
  [
@@ -978,30 +978,30 @@ class J {
978
978
  [...h[2], 1]
979
979
  ) : void 0,
980
980
  isClosestToRef: p < 4 && !this.base.areSourceColorsLocked,
981
- isSourceColorLocked: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled,
982
- isTransparent: t.alpha.isEnabled,
981
+ isSourceColorLocked: s === l && this.base.areSourceColorsLocked && !o.alpha.isEnabled,
982
+ isTransparent: o.alpha.isEnabled,
983
983
  type: "color shade/tint"
984
984
  });
985
- }), n.colors.push(o);
985
+ }), n.colors.push(a);
986
986
  }), this.paletteData.themes.push(n);
987
987
  }), this.paletteData));
988
988
  k(this, "makeLibraryData", (r, n) => {
989
- const t = this.makePaletteData();
990
- return t.themes.flatMap(
991
- (o) => o.colors.flatMap(
992
- (e) => e.shades.flatMap((a) => {
993
- const c = `${o.id}:${e.id}:${a.name}`, l = n == null ? void 0 : n.find(
994
- (h) => h.id === c
989
+ const o = this.makePaletteData();
990
+ return o.themes.flatMap(
991
+ (a) => a.colors.flatMap(
992
+ (e) => e.shades.flatMap((t) => {
993
+ const i = `${a.id}:${e.id}:${t.name}`, l = n == null ? void 0 : n.find(
994
+ (h) => h.id === i
995
995
  );
996
996
  return {
997
- id: c,
998
- paletteName: t.name,
999
- themeName: o.name,
997
+ id: i,
998
+ paletteName: o.name,
999
+ themeName: a.name,
1000
1000
  colorName: e.name,
1001
- shadeName: a.name,
1002
- ...(r == null ? void 0 : r.includes("alpha")) && { alpha: a.alpha ?? 1 },
1003
- ...(r == null ? void 0 : r.includes("hex")) && { hex: a.hex },
1004
- ...(r == null ? void 0 : r.includes("gl")) && { gl: a.gl },
1001
+ shadeName: t.name,
1002
+ ...(r == null ? void 0 : r.includes("alpha")) && { alpha: t.alpha ?? 1 },
1003
+ ...(r == null ? void 0 : r.includes("hex")) && { hex: t.hex },
1004
+ ...(r == null ? void 0 : r.includes("gl")) && { gl: t.gl },
1005
1005
  ...(r == null ? void 0 : r.includes("description")) && {
1006
1006
  description: e.description
1007
1007
  },
@@ -1086,13 +1086,13 @@ class J {
1086
1086
  version: "2025.06",
1087
1087
  type: "UI_COLOR_PALETTE"
1088
1088
  }));
1089
- var i;
1090
- this.base = r, this.themes = n, this.meta = t, this.paletteData = {
1089
+ var c;
1090
+ this.base = r, this.themes = n, this.meta = o, this.paletteData = {
1091
1091
  name: r.name ?? "UI Color Palette",
1092
1092
  description: r.description,
1093
1093
  themes: [],
1094
1094
  type: "palette"
1095
- }, this.currentScale = ((i = n.find((o) => o.isEnabled)) == null ? void 0 : i.scale) ?? {};
1095
+ }, this.currentScale = ((c = n.find((a) => a.isEnabled)) == null ? void 0 : c.scale) ?? {};
1096
1096
  }
1097
1097
  }
1098
1098
  export {