@a_ng_d/utils-ui-color-palette 1.4.3 → 1.5.3

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