@a_ng_d/utils-ui-color-palette 1.5.10 → 1.5.12
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
|
|
2
|
-
var
|
|
3
|
-
var k = (m, r, n) =>
|
|
1
|
+
var N = Object.defineProperty;
|
|
2
|
+
var w = (m, r, n) => r in m ? N(m, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : m[r] = n;
|
|
3
|
+
var k = (m, r, n) => w(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
|
-
const
|
|
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 = {},
|
|
6
|
+
const S = (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"), n = {}, t = (a) => (isNaN(a.hsl[0]) && (a.hsl[0] = 0), isNaN(a.lch[2]) && (a.lch[2] = 0), isNaN(a.oklch[2]) && (a.oklch[2] = 0), {
|
|
8
8
|
rgb: {
|
|
9
9
|
r: Math.floor(a.rgb[0]),
|
|
10
10
|
g: Math.floor(a.rgb[1]),
|
|
@@ -48,7 +48,7 @@ const N = (m) => {
|
|
|
48
48
|
hex: a.hex,
|
|
49
49
|
description: a.description,
|
|
50
50
|
type: "color shade/tint"
|
|
51
|
-
}),
|
|
51
|
+
}), i = (a, e) => ({
|
|
52
52
|
rgb: {
|
|
53
53
|
r: Math.floor(e.rgb[0]),
|
|
54
54
|
g: Math.floor(e.rgb[1]),
|
|
@@ -96,20 +96,20 @@ const N = (m) => {
|
|
|
96
96
|
});
|
|
97
97
|
return r[0].type === "custom theme" ? r.forEach((a) => {
|
|
98
98
|
n[a.name] = {}, a.colors.forEach((e) => {
|
|
99
|
-
const
|
|
100
|
-
(
|
|
99
|
+
const o = e.shades.find(
|
|
100
|
+
(c) => c.type === "source color"
|
|
101
101
|
);
|
|
102
|
-
n[a.name][e.name] = {}, e.shades.forEach((
|
|
103
|
-
|
|
102
|
+
n[a.name][e.name] = {}, e.shades.forEach((c) => {
|
|
103
|
+
c && o && (n[a.name][e.name][c.name] = c.isTransparent ? i(c, o) : t(c));
|
|
104
104
|
}), n[a.name][e.name].description = e.description, n[a.name][e.name].type = "color";
|
|
105
105
|
}), n[a.name].description = a.description, n[a.name].type = "color mode";
|
|
106
106
|
}) : r.forEach((a) => {
|
|
107
107
|
a.colors.forEach((e) => {
|
|
108
|
-
const
|
|
109
|
-
(
|
|
108
|
+
const o = e.shades.find(
|
|
109
|
+
(c) => c.type === "source color"
|
|
110
110
|
);
|
|
111
|
-
n[e.name] = {}, e.shades.forEach((
|
|
112
|
-
|
|
111
|
+
n[e.name] = {}, e.shades.forEach((c) => {
|
|
112
|
+
c && o && (n[e.name][c.name] = c.isTransparent ? i(c, o) : t(c));
|
|
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((
|
|
125
|
-
return r.forEach((
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
const e = a.shades.find((
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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((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: ${
|
|
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: ${
|
|
137
|
+
)}, green: ${o.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
|
|
138
138
|
3
|
|
139
139
|
)})`
|
|
140
140
|
);
|
|
141
|
-
}),
|
|
142
|
-
}),
|
|
143
|
-
`// ${
|
|
144
|
-
struct ${new b(
|
|
145
|
-
${
|
|
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(
|
|
146
146
|
`
|
|
147
147
|
`
|
|
148
148
|
)}
|
|
149
149
|
}`
|
|
150
|
-
) : n.push(`${
|
|
150
|
+
) : n.push(`${i.join(`
|
|
151
151
|
`)}`);
|
|
152
152
|
}), `import UIKit
|
|
153
153
|
|
|
@@ -157,99 +157,99 @@ struct Color {
|
|
|
157
157
|
`)}
|
|
158
158
|
}`;
|
|
159
159
|
}, H = (m) => {
|
|
160
|
-
const r = m.themes.filter((
|
|
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");
|
|
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((
|
|
168
|
-
|
|
169
|
-
const a =
|
|
167
|
+
return r[0].type !== "custom theme" ? r.forEach((t) => {
|
|
168
|
+
t.colors.forEach((i) => {
|
|
169
|
+
const a = i.shades.find(
|
|
170
170
|
(l) => l.type === "source color"
|
|
171
|
-
), e = new b(
|
|
172
|
-
n += ` /* ${
|
|
173
|
-
`,
|
|
171
|
+
), e = new b(i.name).doKebabCase();
|
|
172
|
+
n += ` /* ${i.name} */
|
|
173
|
+
`, i.shades.sort().forEach((l) => {
|
|
174
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
|
|
179
|
-
|
|
178
|
+
const o = i === t.colors[t.colors.length - 1], c = t === r[r.length - 1];
|
|
179
|
+
o && c || (n += `
|
|
180
180
|
`);
|
|
181
181
|
});
|
|
182
|
-
}) : r.forEach((
|
|
183
|
-
const
|
|
184
|
-
|
|
182
|
+
}) : r.forEach((t) => {
|
|
183
|
+
const i = new b(t.name).doKebabCase();
|
|
184
|
+
t.colors.forEach((a) => {
|
|
185
185
|
const e = a.shades.find(
|
|
186
186
|
(h) => h.type === "source color"
|
|
187
|
-
),
|
|
188
|
-
n += ` /* ${
|
|
187
|
+
), o = new b(a.name).doKebabCase();
|
|
188
|
+
n += ` /* ${t.name} - ${a.name} */
|
|
189
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-${
|
|
191
|
+
n += ` --color-${i}-${o}-${p}: ${s};
|
|
192
192
|
`;
|
|
193
193
|
});
|
|
194
|
-
const
|
|
195
|
-
|
|
194
|
+
const c = a === t.colors[t.colors.length - 1], l = t === r[r.length - 1];
|
|
195
|
+
c && l || (n += `
|
|
196
196
|
`);
|
|
197
197
|
});
|
|
198
198
|
}), n += `}
|
|
199
199
|
`, n;
|
|
200
200
|
}, K = (m) => {
|
|
201
|
-
const r = m.themes.filter((
|
|
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 = {
|
|
202
202
|
theme: {
|
|
203
203
|
colors: {}
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
return m.themes[0].colors.forEach((
|
|
207
|
-
n.theme.colors[new b(
|
|
208
|
-
}), r[0].type === "custom theme" ? r.forEach((
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
(
|
|
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 a = i.shades.find(
|
|
211
|
+
(e) => e.type === "source color"
|
|
212
212
|
);
|
|
213
|
-
n.theme.colors[new b(
|
|
214
|
-
n.theme.colors[new b(
|
|
213
|
+
n.theme.colors[new b(i.name).doKebabCase()][new b(t.name).doKebabCase()] = {}, i.shades.forEach((e) => {
|
|
214
|
+
n.theme.colors[new b(i.name).doKebabCase()][new b(t.name).doKebabCase()][new b(e.name).doKebabCase()] = e.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
|
|
215
215
|
});
|
|
216
216
|
});
|
|
217
|
-
}) : r.forEach((
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
(
|
|
217
|
+
}) : r.forEach((t) => {
|
|
218
|
+
t.colors.forEach((i) => {
|
|
219
|
+
const a = i.shades.find(
|
|
220
|
+
(e) => e.type === "source color"
|
|
221
221
|
);
|
|
222
|
-
n.theme.colors[new b(
|
|
223
|
-
n.theme.colors[new b(
|
|
222
|
+
n.theme.colors[new b(i.name).doKebabCase()] = {}, i.shades.sort().forEach((e) => {
|
|
223
|
+
n.theme.colors[new b(i.name).doKebabCase()][new b(e.name).doKebabCase()] = e.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
|
|
224
224
|
});
|
|
225
225
|
});
|
|
226
|
-
}), `/** @type {
|
|
226
|
+
}), `/** @type {import('tailwindcss').Config} */
|
|
227
227
|
|
|
228
228
|
module.exports = ${JSON.stringify(
|
|
229
229
|
n,
|
|
230
230
|
null,
|
|
231
231
|
" "
|
|
232
|
-
)}`;
|
|
232
|
+
).replace(/import/g, "\\u0069\\u006d\\u0070\\u006f\\u0072\\u0074")}`;
|
|
233
233
|
}, A = (m) => {
|
|
234
|
-
const r = m.themes.filter((
|
|
235
|
-
return r.forEach((
|
|
236
|
-
|
|
237
|
-
const a =
|
|
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 a = i.shades.find((o) => o.type === "source color"), e = [];
|
|
238
238
|
e.push(
|
|
239
|
-
`// ${r[0].type === "custom theme" ?
|
|
240
|
-
),
|
|
239
|
+
`// ${r[0].type === "custom theme" ? t.name + " - " : ""}${i.name}`
|
|
240
|
+
), i.shades.reverse().forEach((o) => {
|
|
241
241
|
e.push(
|
|
242
|
-
|
|
242
|
+
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(
|
|
243
243
|
3
|
|
244
|
-
)}, green: ${a == null ? void 0 : a.gl[1].toFixed(3)}, blue: ${
|
|
244
|
+
)}, green: ${a == null ? void 0 : a.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
|
|
245
245
|
3
|
|
246
|
-
)}).opacity(${
|
|
246
|
+
)}).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(
|
|
247
247
|
3
|
|
248
|
-
)}, green: ${
|
|
248
|
+
)}, green: ${o.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
|
|
249
249
|
3
|
|
250
250
|
)})`
|
|
251
251
|
);
|
|
252
|
-
}), e.push(""), e.forEach((
|
|
252
|
+
}), e.push(""), e.forEach((o) => n.push(o));
|
|
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((
|
|
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 = {
|
|
267
267
|
color: {}
|
|
268
|
-
},
|
|
268
|
+
}, t = (i, a, e) => ({
|
|
269
269
|
type: "color",
|
|
270
270
|
value: a.isTransparent ? u(e.hex).alpha(a.alpha ?? 1).hex() : a.hex,
|
|
271
|
-
comment:
|
|
271
|
+
comment: i.description !== "" ? i.description + " - " + a.description : a.description
|
|
272
272
|
});
|
|
273
|
-
return m.themes[0].colors.forEach((
|
|
274
|
-
n.color[
|
|
275
|
-
}), r[0].type === "custom theme" ? r.forEach((
|
|
276
|
-
|
|
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((a) => {
|
|
277
277
|
const e = a.shades.find(
|
|
278
|
-
(
|
|
278
|
+
(o) => o.type === "source color"
|
|
279
279
|
);
|
|
280
|
-
n.color[a.name][
|
|
281
|
-
|
|
280
|
+
n.color[a.name][i.name] = {}, a.shades.forEach((o) => {
|
|
281
|
+
o && e && (n.color[a.name][i.name][o.name] = t(
|
|
282
282
|
a,
|
|
283
|
-
|
|
283
|
+
o,
|
|
284
284
|
e
|
|
285
285
|
));
|
|
286
286
|
});
|
|
287
287
|
});
|
|
288
|
-
}) : r.forEach((
|
|
289
|
-
|
|
288
|
+
}) : r.forEach((i) => {
|
|
289
|
+
i.colors.forEach((a) => {
|
|
290
290
|
const e = a.shades.find(
|
|
291
|
-
(
|
|
291
|
+
(o) => o.type === "source color"
|
|
292
292
|
);
|
|
293
|
-
n.color[a.name] = {}, a.shades.forEach((
|
|
294
|
-
|
|
293
|
+
n.color[a.name] = {}, a.shades.forEach((o) => {
|
|
294
|
+
o && e && (n.color[a.name][o.name] = t(a, o, 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"),
|
|
299
|
+
const n = m.themes.filter((s) => s.type === "custom theme").length === 0 ? m.themes.filter((s) => s.type === "default theme") : m.themes.filter((s) => s.type === "custom theme"), t = [], i = [], a = (s) => {
|
|
300
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
|
-
},
|
|
345
|
+
}, o = n.find(
|
|
346
346
|
(s) => s.type === "default theme"
|
|
347
347
|
);
|
|
348
|
-
if (
|
|
348
|
+
if (o) {
|
|
349
349
|
const s = [];
|
|
350
|
-
return
|
|
350
|
+
return o.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
354
|
`${d}: ${$.isTransparent ? e($, g) : a($)};`
|
|
355
355
|
);
|
|
356
356
|
});
|
|
357
|
-
}),
|
|
358
|
-
`)),
|
|
357
|
+
}), t.push(s.join(`
|
|
358
|
+
`)), t.join(`
|
|
359
359
|
`);
|
|
360
360
|
}
|
|
361
361
|
n.forEach((s) => {
|
|
@@ -367,22 +367,22 @@ public extension Color {
|
|
|
367
367
|
` ${E}: ${d.isTransparent ? e(d, C) : a(d)};`
|
|
368
368
|
);
|
|
369
369
|
});
|
|
370
|
-
}), f.push("}"),
|
|
370
|
+
}), f.push("}"), t.push(f.join(`
|
|
371
371
|
`));
|
|
372
372
|
});
|
|
373
|
-
const
|
|
373
|
+
const c = /* @__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
|
-
|
|
379
|
+
c.add(d);
|
|
380
380
|
}
|
|
381
381
|
});
|
|
382
382
|
});
|
|
383
|
-
}),
|
|
383
|
+
}), c.size > 0) {
|
|
384
384
|
const s = /* @__PURE__ */ new Map();
|
|
385
|
-
|
|
385
|
+
c.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
|
-
|
|
394
|
+
i.push(
|
|
395
395
|
`// ${f.charAt(0).toUpperCase() + f.slice(1)}`
|
|
396
|
-
),
|
|
397
|
-
}),
|
|
396
|
+
), i.push(...p), i.push("");
|
|
397
|
+
}), i.length > 0 && i[i.length - 1] === "" && i.pop(), t.push(i.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("}"),
|
|
406
|
+
}), l.push("}"), t.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
|
-
}),
|
|
414
|
+
}), t.push(h.join(`
|
|
415
415
|
|
|
416
|
-
`)),
|
|
416
|
+
`)), t.join(`
|
|
417
417
|
|
|
418
418
|
`);
|
|
419
419
|
}, j = (m) => {
|
|
420
|
-
const r = m.themes.filter((
|
|
421
|
-
return r.forEach((
|
|
422
|
-
|
|
423
|
-
const a =
|
|
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 a = i.shades.find((o) => o.type === "source color"), e = [];
|
|
424
424
|
e.push(
|
|
425
|
-
`<!--${r[0].type === "custom theme" ? `${
|
|
426
|
-
),
|
|
425
|
+
`<!--${r[0].type === "custom theme" ? `${t.name} - ${i.name}-->` : `${i.name}-->`}`
|
|
426
|
+
), i.shades.reverse().forEach((o) => {
|
|
427
427
|
e.push(
|
|
428
|
-
`<color name="${r[0].type === "custom theme" ? new b(
|
|
428
|
+
`<color name="${r[0].type === "custom theme" ? new b(t.name + " " + i.name).doSnakeCase() : new b(i.name).doSnakeCase()}_${o.name}">${o.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(o.alpha ?? 1).hex() : o.hex}</color>`
|
|
429
429
|
);
|
|
430
|
-
}), e.push(""), e.forEach((
|
|
430
|
+
}), e.push(""), e.forEach((o) => n.push(o));
|
|
431
431
|
});
|
|
432
432
|
}), n.pop(), `<?xml version="1.0" encoding="utf-8"?>
|
|
433
433
|
<resources>
|
|
@@ -444,40 +444,40 @@ public extension Color {
|
|
|
444
444
|
tokenSetOrder: [],
|
|
445
445
|
activeSets: []
|
|
446
446
|
}
|
|
447
|
-
},
|
|
447
|
+
}, t = m.name, i = (a, e, o) => ({
|
|
448
448
|
$type: "color",
|
|
449
|
-
$value: e.isTransparent ? u(
|
|
449
|
+
$value: e.isTransparent ? u(o.hex).alpha(e.alpha ?? 1).hex() : e.hex,
|
|
450
450
|
$description: a.description !== "" ? a.description + " - " + e.description : e.description
|
|
451
451
|
});
|
|
452
452
|
return r[0].type === "custom theme" ? r.forEach((a) => {
|
|
453
453
|
a.colors.forEach((e) => {
|
|
454
|
-
const
|
|
455
|
-
(
|
|
454
|
+
const o = e.shades.find(
|
|
455
|
+
(c) => c.type === "source color"
|
|
456
456
|
);
|
|
457
|
-
n[`${a.name}/${e.name}`] = {}, e.shades.forEach((
|
|
458
|
-
|
|
457
|
+
n[`${a.name}/${e.name}`] = {}, e.shades.forEach((c) => {
|
|
458
|
+
c && o && (n[`${a.name}/${e.name}`][c.name] = i(
|
|
459
459
|
e,
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
c,
|
|
461
|
+
o
|
|
462
462
|
));
|
|
463
463
|
});
|
|
464
464
|
});
|
|
465
465
|
}) : r.forEach((a) => {
|
|
466
466
|
a.colors.forEach((e) => {
|
|
467
|
-
const
|
|
468
|
-
(
|
|
467
|
+
const o = e.shades.find(
|
|
468
|
+
(c) => c.type === "source color"
|
|
469
469
|
);
|
|
470
|
-
n[`${
|
|
471
|
-
|
|
470
|
+
n[`${t}/${e.name}`] = {}, e.shades.forEach((c) => {
|
|
471
|
+
c && o && (n[`${t}/${e.name}`][c.name] = i(
|
|
472
472
|
e,
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
c,
|
|
474
|
+
o
|
|
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"),
|
|
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) => {
|
|
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 = {
|
|
@@ -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 ? a(p, f) :
|
|
535
|
+
`${$}: ${p.isTransparent ? a(p, f) : i(p)};`
|
|
536
536
|
);
|
|
537
537
|
});
|
|
538
|
-
}),
|
|
539
|
-
`)),
|
|
538
|
+
}), t.push(l.join(`
|
|
539
|
+
`)), t.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 ? a($, g) :
|
|
548
|
+
` ${d}: ${$.isTransparent ? a($, g) : i($)};`
|
|
549
549
|
);
|
|
550
550
|
});
|
|
551
|
-
}), s.push("}"),
|
|
551
|
+
}), s.push("}"), t.push(s.join(`
|
|
552
552
|
`));
|
|
553
553
|
});
|
|
554
|
-
const
|
|
554
|
+
const o = [":root {"];
|
|
555
555
|
n.forEach((l, h) => {
|
|
556
556
|
const s = new b(l.name).doKebabCase();
|
|
557
|
-
|
|
557
|
+
o.push(` &[data-theme="${s}"] {
|
|
558
558
|
.${s}();
|
|
559
|
-
}`), h !== n.length - 1 &&
|
|
560
|
-
}),
|
|
559
|
+
}`), h !== n.length - 1 && o.push("");
|
|
560
|
+
}), o.push("}"), t.push(o.join(`
|
|
561
561
|
`));
|
|
562
|
-
const
|
|
562
|
+
const c = [];
|
|
563
563
|
return n.forEach((l) => {
|
|
564
564
|
const h = new b(l.name).doKebabCase();
|
|
565
|
-
|
|
565
|
+
c.push(`.${h} {
|
|
566
566
|
.${h}();
|
|
567
567
|
}`);
|
|
568
|
-
}),
|
|
568
|
+
}), t.push(c.join(`
|
|
569
569
|
|
|
570
|
-
`)),
|
|
570
|
+
`)), t.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"),
|
|
575
|
-
var
|
|
574
|
+
const n = m.themes.filter((e) => e.type === "custom theme").length === 0 ? m.themes.filter((e) => e.type === "default theme") : m.themes.filter((e) => e.type === "custom theme"), t = {}, i = (e) => {
|
|
575
|
+
var c;
|
|
576
576
|
isNaN(e.oklch[2]) && (e.oklch[2] = 0);
|
|
577
|
-
const
|
|
577
|
+
const o = {
|
|
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 (
|
|
598
|
-
}, a = (e,
|
|
597
|
+
return (c = o[r ?? "RGB"]) == null ? void 0 : c.call(o);
|
|
598
|
+
}, a = (e, o) => {
|
|
599
599
|
var l;
|
|
600
|
-
isNaN(
|
|
601
|
-
const
|
|
600
|
+
isNaN(o.oklch[2]) && (o.oklch[2] = 0);
|
|
601
|
+
const c = {
|
|
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:
|
|
610
|
+
alpha: o.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:
|
|
620
|
+
alpha: o.alpha
|
|
621
621
|
})
|
|
622
622
|
};
|
|
623
|
-
return (l =
|
|
623
|
+
return (l = c[r ?? "RGB"]) == null ? void 0 : l.call(c);
|
|
624
624
|
};
|
|
625
625
|
return n[0].type === "custom theme" ? n.forEach((e) => {
|
|
626
|
-
e.colors.forEach((
|
|
627
|
-
const
|
|
626
|
+
e.colors.forEach((o) => {
|
|
627
|
+
const c = o.shades.find(
|
|
628
628
|
(l) => l.type === "source color"
|
|
629
629
|
);
|
|
630
|
-
o
|
|
630
|
+
t[o.name] || (t[o.name] = {
|
|
631
631
|
$type: "color"
|
|
632
|
-
}),
|
|
633
|
-
!o
|
|
632
|
+
}), o.shades.forEach((l) => {
|
|
633
|
+
!t[o.name][l.name] && c && (t[o.name][l.name] = {
|
|
634
634
|
$type: "color",
|
|
635
|
-
$value: l.isTransparent ? a(
|
|
636
|
-
$description:
|
|
635
|
+
$value: l.isTransparent ? a(c, l) : i(l),
|
|
636
|
+
$description: o.description !== "" ? o.description + " - " + l.description : l.description,
|
|
637
637
|
$extensions: {
|
|
638
638
|
mode: {}
|
|
639
639
|
}
|
|
640
|
-
}),
|
|
640
|
+
}), c && (t[o.name][l.name].$extensions.mode[e.name] = l.isTransparent ? a(c, l) : i(l));
|
|
641
641
|
});
|
|
642
642
|
});
|
|
643
643
|
}) : n.forEach((e) => {
|
|
644
|
-
e.colors.forEach((
|
|
645
|
-
const
|
|
644
|
+
e.colors.forEach((o) => {
|
|
645
|
+
const c = o.shades.find(
|
|
646
646
|
(l) => l.type === "source color"
|
|
647
647
|
);
|
|
648
|
-
o
|
|
649
|
-
l &&
|
|
648
|
+
t[o.name] = {}, o.shades.forEach((l) => {
|
|
649
|
+
l && c && (t[o.name][l.name] = {
|
|
650
650
|
$type: "color",
|
|
651
|
-
$value: l.isTransparent ? a(
|
|
652
|
-
$description:
|
|
651
|
+
$value: l.isTransparent ? a(c, l) : i(l),
|
|
652
|
+
$description: o.description !== "" ? o.description + " - " + l.description : l.description
|
|
653
653
|
});
|
|
654
654
|
});
|
|
655
655
|
});
|
|
656
|
-
}), JSON.stringify(
|
|
656
|
+
}), JSON.stringify(t, null, " ");
|
|
657
657
|
}, O = (m) => {
|
|
658
|
-
const r = m.themes.filter((
|
|
659
|
-
return r.forEach((
|
|
660
|
-
|
|
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 = [], a = [], e = [], o = [];
|
|
659
|
+
return r.forEach((c) => {
|
|
660
|
+
c.colors.forEach((l) => {
|
|
661
661
|
l.shades.forEach((h) => {
|
|
662
|
-
|
|
662
|
+
i.push(h.name), a.push(Math.floor(h.lch[0])), e.push(Math.floor(h.lch[1])), o.push(Math.floor(h.lch[2]));
|
|
663
663
|
}), n.push({
|
|
664
664
|
name: l.name,
|
|
665
665
|
csv: `${l.name},Lightness,Chroma,Hue
|
|
666
|
-
${
|
|
666
|
+
${i.map((h, s) => `${h},${a[s]},${e[s]},${o[s]}`).join(`
|
|
667
667
|
`)}`
|
|
668
|
-
}),
|
|
669
|
-
}),
|
|
670
|
-
name:
|
|
668
|
+
}), i.splice(0, i.length), a.splice(0, a.length), e.splice(0, e.length), o.splice(0, o.length);
|
|
669
|
+
}), t.push({
|
|
670
|
+
name: c.name,
|
|
671
671
|
colors: n.map((l) => l),
|
|
672
|
-
type:
|
|
672
|
+
type: c.type
|
|
673
673
|
}), n.splice(0, n.length);
|
|
674
|
-
}),
|
|
674
|
+
}), t;
|
|
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"),
|
|
677
|
-
var
|
|
678
|
-
isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0);
|
|
679
|
-
const
|
|
676
|
+
const n = m.themes.filter((e) => e.type === "custom theme").length === 0 ? m.themes.filter((e) => e.type === "default theme") : m.themes.filter((e) => e.type === "custom theme"), t = [], i = (e) => {
|
|
677
|
+
var c;
|
|
678
|
+
isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0), isNaN(e.oklch[2]) && (e.oklch[2] = 0);
|
|
679
|
+
const o = {
|
|
680
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,74 @@ ${c.map((h, s) => `${h},${a[s]},${e[s]},${t[s]}`).join(`
|
|
|
692
692
|
3
|
|
693
693
|
)} ${e.gl[2].toFixed(3)})`
|
|
694
694
|
};
|
|
695
|
-
return (
|
|
696
|
-
}, a = (e,
|
|
695
|
+
return (c = o[r ?? "RGB"]) == null ? void 0 : c.call(o);
|
|
696
|
+
}, a = (e, o) => {
|
|
697
697
|
var l;
|
|
698
|
-
|
|
698
|
+
isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0), isNaN(e.oklch[2]) && (e.oklch[2] = 0);
|
|
699
|
+
const c = {
|
|
699
700
|
RGB: () => {
|
|
700
701
|
var h;
|
|
701
|
-
return `rgb(${Math.floor(
|
|
702
|
-
|
|
703
|
-
)}, ${Math.floor(
|
|
702
|
+
return `rgb(${Math.floor(o.rgb[0])}, ${Math.floor(
|
|
703
|
+
o.rgb[1]
|
|
704
|
+
)}, ${Math.floor(o.rgb[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
|
|
704
705
|
},
|
|
705
|
-
HEX: () => u(
|
|
706
|
+
HEX: () => u(o.hex).alpha(e.alpha ?? 1).hex(),
|
|
706
707
|
HSL: () => {
|
|
707
708
|
var h;
|
|
708
|
-
return `hsl(${Math.floor(
|
|
709
|
-
|
|
710
|
-
)}% ${Math.floor(
|
|
709
|
+
return `hsl(${Math.floor(o.hsl[0])} ${Math.floor(
|
|
710
|
+
o.hsl[1] * 100
|
|
711
|
+
)}% ${Math.floor(o.hsl[2] * 100)}% / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
|
|
711
712
|
},
|
|
712
713
|
LCH: () => {
|
|
713
714
|
var h;
|
|
714
|
-
return `lch(${Math.floor(
|
|
715
|
-
|
|
716
|
-
)} ${Math.floor(
|
|
715
|
+
return `lch(${Math.floor(o.lch[0])}% ${Math.floor(
|
|
716
|
+
o.lch[1]
|
|
717
|
+
)} ${Math.floor(o.lch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
|
|
717
718
|
},
|
|
718
719
|
OKLCH: () => {
|
|
719
720
|
var h;
|
|
720
|
-
return `oklch(${Math.floor(
|
|
721
|
+
return `oklch(${Math.floor(o.oklch[0 * 100])}% ${o.oklch[1].toFixed(3)} ${Math.floor(o.oklch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
|
|
721
722
|
},
|
|
722
723
|
P3: () => {
|
|
723
724
|
var h;
|
|
724
|
-
return `color(display-p3 ${
|
|
725
|
+
return `color(display-p3 ${o.gl[0].toFixed(3)} ${o.gl[1].toFixed(
|
|
725
726
|
3
|
|
726
|
-
)} ${
|
|
727
|
+
)} ${o.gl[2].toFixed(3)} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
|
|
727
728
|
}
|
|
728
729
|
};
|
|
729
|
-
return (l =
|
|
730
|
+
return (l = c[r ?? "RGB"]) == null ? void 0 : l.call(c);
|
|
730
731
|
};
|
|
731
732
|
return n.forEach((e) => {
|
|
732
|
-
const
|
|
733
|
-
e.colors.forEach((
|
|
734
|
-
|
|
735
|
-
const h =
|
|
736
|
-
h &&
|
|
737
|
-
`--${new b(
|
|
733
|
+
const o = [];
|
|
734
|
+
e.colors.forEach((c) => {
|
|
735
|
+
o.push(`/* ${c.name} */`), c.shades.reverse().forEach((l) => {
|
|
736
|
+
const h = c.shades.find((s) => s.type === "source color");
|
|
737
|
+
h && o.push(
|
|
738
|
+
`--${new b(c.name).doKebabCase()}-${l.name}: ${l.isTransparent ? a(l, h) : i(l)};`
|
|
738
739
|
);
|
|
739
|
-
}),
|
|
740
|
-
}),
|
|
740
|
+
}), o.push("");
|
|
741
|
+
}), o.pop(), t.push(
|
|
741
742
|
`${e.type === "custom theme" ? `/* ${e.name} */
|
|
742
743
|
` : ""}:root${e.type === "custom theme" ? `[data-theme='${new b(e.name).doKebabCase()}']` : ""} {
|
|
743
|
-
${
|
|
744
|
+
${o.join(`
|
|
744
745
|
`)}
|
|
745
746
|
}`
|
|
746
747
|
);
|
|
747
|
-
}),
|
|
748
|
+
}), t.join(`
|
|
748
749
|
|
|
749
750
|
`);
|
|
750
751
|
}, U = (m) => {
|
|
751
|
-
const r = m.themes.filter((
|
|
752
|
-
return r.forEach((
|
|
753
|
-
|
|
754
|
-
const a =
|
|
752
|
+
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 = [];
|
|
753
|
+
return r.forEach((t) => {
|
|
754
|
+
t.colors.forEach((i) => {
|
|
755
|
+
const a = i.shades.find((o) => o.type === "source color"), e = [];
|
|
755
756
|
e.push(
|
|
756
|
-
`// ${r[0].type === "custom theme" ?
|
|
757
|
-
),
|
|
757
|
+
`// ${r[0].type === "custom theme" ? t.name + " - " : ""}${i.name}`
|
|
758
|
+
), i.shades.reverse().forEach((o) => {
|
|
758
759
|
e.push(
|
|
759
|
-
`val ${r[0].type === "custom theme" ? new b(
|
|
760
|
+
`val ${r[0].type === "custom theme" ? new b(t.name + " " + i.name).doSnakeCase() : new b(i.name).doSnakeCase()}_${o.name} = Color(${o.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(o.alpha ?? 1).hex().replace("#", "0xFF").toUpperCase() : o.hex.replace("#", "0xFF").toUpperCase()})`
|
|
760
761
|
);
|
|
761
|
-
}), e.push(""), e.forEach((
|
|
762
|
+
}), e.push(""), e.forEach((o) => n.push(o));
|
|
762
763
|
});
|
|
763
764
|
}), n.pop(), `import androidx.compose.ui.graphics.Color
|
|
764
765
|
|
|
@@ -769,7 +770,7 @@ class J {
|
|
|
769
770
|
constructor({
|
|
770
771
|
base: r,
|
|
771
772
|
themes: n,
|
|
772
|
-
meta:
|
|
773
|
+
meta: t
|
|
773
774
|
}) {
|
|
774
775
|
k(this, "base");
|
|
775
776
|
k(this, "themes");
|
|
@@ -784,24 +785,24 @@ class J {
|
|
|
784
785
|
colors: [],
|
|
785
786
|
type: r.type
|
|
786
787
|
};
|
|
787
|
-
this.base.colors.forEach((
|
|
788
|
-
const
|
|
789
|
-
if (
|
|
788
|
+
this.base.colors.forEach((t) => {
|
|
789
|
+
const i = Object.entries(r.scale).reverse().map((h) => {
|
|
790
|
+
if (t.alpha.isEnabled) {
|
|
790
791
|
const s = new x({
|
|
791
792
|
render: "RGB",
|
|
792
793
|
sourceColor: [
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
794
|
+
t.rgb.r * 255,
|
|
795
|
+
t.rgb.g * 255,
|
|
796
|
+
t.rgb.b * 255
|
|
796
797
|
],
|
|
797
798
|
alpha: parseFloat((h[1] / 100).toFixed(2)),
|
|
798
|
-
hueShifting:
|
|
799
|
-
chromaShifting:
|
|
799
|
+
hueShifting: t.hue.shift !== void 0 ? t.hue.shift : 0,
|
|
800
|
+
chromaShifting: t.chroma.shift !== void 0 ? t.chroma.shift : 100,
|
|
800
801
|
algorithmVersion: this.base.algorithmVersion,
|
|
801
802
|
visionSimulationMode: r.visionSimulationMode
|
|
802
803
|
}), p = new x({
|
|
803
804
|
render: "RGB",
|
|
804
|
-
sourceColor: u(
|
|
805
|
+
sourceColor: u(t.alpha.backgroundColor).rgb(),
|
|
805
806
|
algorithmVersion: this.base.algorithmVersion,
|
|
806
807
|
visionSimulationMode: r.visionSimulationMode
|
|
807
808
|
});
|
|
@@ -873,13 +874,13 @@ class J {
|
|
|
873
874
|
const s = new x({
|
|
874
875
|
render: "RGB",
|
|
875
876
|
sourceColor: [
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
877
|
+
t.rgb.r * 255,
|
|
878
|
+
t.rgb.g * 255,
|
|
879
|
+
t.rgb.b * 255
|
|
879
880
|
],
|
|
880
881
|
lightness: h[1],
|
|
881
|
-
hueShifting:
|
|
882
|
-
chromaShifting:
|
|
882
|
+
hueShifting: t.hue.shift !== void 0 ? t.hue.shift : 0,
|
|
883
|
+
chromaShifting: t.chroma.shift !== void 0 ? t.chroma.shift : 100,
|
|
883
884
|
algorithmVersion: this.base.algorithmVersion,
|
|
884
885
|
visionSimulationMode: r.visionSimulationMode
|
|
885
886
|
});
|
|
@@ -901,17 +902,17 @@ class J {
|
|
|
901
902
|
}
|
|
902
903
|
}
|
|
903
904
|
}), a = {
|
|
904
|
-
id:
|
|
905
|
-
name:
|
|
906
|
-
description:
|
|
905
|
+
id: t.id,
|
|
906
|
+
name: t.name,
|
|
907
|
+
description: t.description,
|
|
907
908
|
shades: [],
|
|
908
909
|
type: "color"
|
|
909
910
|
}, e = [
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
],
|
|
914
|
-
|
|
911
|
+
t.rgb.r * 255,
|
|
912
|
+
t.rgb.g * 255,
|
|
913
|
+
t.rgb.b * 255
|
|
914
|
+
], o = new M();
|
|
915
|
+
o.rgb_r = t.rgb.r, o.rgb_g = t.rgb.g, o.rgb_b = t.rgb.b, o.rgbToHsluv(), a.shades.push({
|
|
915
916
|
name: "source",
|
|
916
917
|
description: "Source color",
|
|
917
918
|
hex: u(e).hex(),
|
|
@@ -923,20 +924,20 @@ class J {
|
|
|
923
924
|
oklab: u(e).oklab(),
|
|
924
925
|
hsl: u(e).hsl(),
|
|
925
926
|
hsluv: [
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
927
|
+
o.hsluv_h,
|
|
928
|
+
o.hsluv_s,
|
|
929
|
+
o.hsluv_l
|
|
929
930
|
],
|
|
930
931
|
type: "source color"
|
|
931
932
|
});
|
|
932
|
-
const
|
|
933
|
+
const c = i.map(
|
|
933
934
|
(h) => u.distance(
|
|
934
935
|
u(e).hex(),
|
|
935
936
|
u(h[1]).hex(),
|
|
936
937
|
"rgb"
|
|
937
938
|
)
|
|
938
|
-
), l =
|
|
939
|
-
|
|
939
|
+
), l = c.indexOf(Math.min(...c));
|
|
940
|
+
i.forEach((h, s) => {
|
|
940
941
|
const p = u.distance(
|
|
941
942
|
u(e).hex(),
|
|
942
943
|
u(h[1]).hex(),
|
|
@@ -952,21 +953,21 @@ class J {
|
|
|
952
953
|
sourceColor: u(e).rgb(),
|
|
953
954
|
visionSimulationMode: r.visionSimulationMode
|
|
954
955
|
}).setColor();
|
|
955
|
-
s === l && this.base.areSourceColorsLocked && !
|
|
956
|
+
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(), a.shades.push({
|
|
956
957
|
name: f,
|
|
957
|
-
description: `Shade/Tint color with ${typeof h[0][1] == "number" ? h[0][1].toFixed(1) : h[0][1]}% of ${
|
|
958
|
-
hex: s === l && this.base.areSourceColorsLocked && !
|
|
959
|
-
rgb: s === l && this.base.areSourceColorsLocked && !
|
|
960
|
-
gl: s === l && this.base.areSourceColorsLocked && !
|
|
961
|
-
lch: s === l && this.base.areSourceColorsLocked && !
|
|
962
|
-
oklch: s === l && this.base.areSourceColorsLocked && !
|
|
963
|
-
lab: s === l && this.base.areSourceColorsLocked && !
|
|
964
|
-
oklab: s === l && this.base.areSourceColorsLocked && !
|
|
965
|
-
hsl: s === l && this.base.areSourceColorsLocked && !
|
|
958
|
+
description: `Shade/Tint color with ${typeof h[0][1] == "number" ? h[0][1].toFixed(1) : h[0][1]}% of ${t.alpha.isEnabled ? "opacity" : "lightness"}`,
|
|
959
|
+
hex: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).hex() : u(h[1]).hex(),
|
|
960
|
+
rgb: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).rgb() : u(h[1]).rgb(),
|
|
961
|
+
gl: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).gl() : u(h[1]).gl(),
|
|
962
|
+
lch: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).lch() : u(h[1]).lch(),
|
|
963
|
+
oklch: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).oklch() : u(h[1]).oklch(),
|
|
964
|
+
lab: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).lab() : u(h[1]).lab(),
|
|
965
|
+
oklab: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).oklab() : u(h[1]).oklab(),
|
|
966
|
+
hsl: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).hsl() : u(h[1]).hsl(),
|
|
966
967
|
hsluv: [$.hsluv_h, $.hsluv_s, $.hsluv_l],
|
|
967
|
-
alpha:
|
|
968
|
-
backgroundColor:
|
|
969
|
-
mixedColor:
|
|
968
|
+
alpha: t.alpha.isEnabled ? parseFloat((h[0][1] / 100).toFixed(2)) : void 0,
|
|
969
|
+
backgroundColor: t.alpha.isEnabled && t.alpha.backgroundColor ? u(h[2]).rgb() : void 0,
|
|
970
|
+
mixedColor: t.alpha.isEnabled && t.alpha.backgroundColor ? new x({
|
|
970
971
|
visionSimulationMode: r.visionSimulationMode
|
|
971
972
|
}).mixColorsRgb(
|
|
972
973
|
[
|
|
@@ -978,30 +979,30 @@ class J {
|
|
|
978
979
|
[...h[2], 1]
|
|
979
980
|
) : void 0,
|
|
980
981
|
isClosestToRef: p < 4 && !this.base.areSourceColorsLocked,
|
|
981
|
-
isSourceColorLocked: s === l && this.base.areSourceColorsLocked && !
|
|
982
|
-
isTransparent:
|
|
982
|
+
isSourceColorLocked: s === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled,
|
|
983
|
+
isTransparent: t.alpha.isEnabled,
|
|
983
984
|
type: "color shade/tint"
|
|
984
985
|
});
|
|
985
986
|
}), n.colors.push(a);
|
|
986
987
|
}), this.paletteData.themes.push(n);
|
|
987
988
|
}), this.paletteData));
|
|
988
989
|
k(this, "makeLibraryData", (r, n) => {
|
|
989
|
-
const
|
|
990
|
-
return
|
|
990
|
+
const t = this.makePaletteData();
|
|
991
|
+
return t.themes.flatMap(
|
|
991
992
|
(a) => a.colors.flatMap(
|
|
992
|
-
(e) => e.shades.flatMap((
|
|
993
|
-
const
|
|
994
|
-
(h) => h.id ===
|
|
993
|
+
(e) => e.shades.flatMap((o) => {
|
|
994
|
+
const c = `${a.id}:${e.id}:${o.name}`, l = n == null ? void 0 : n.find(
|
|
995
|
+
(h) => h.id === c
|
|
995
996
|
);
|
|
996
997
|
return {
|
|
997
|
-
id:
|
|
998
|
-
paletteName:
|
|
998
|
+
id: c,
|
|
999
|
+
paletteName: t.name,
|
|
999
1000
|
themeName: a.name,
|
|
1000
1001
|
colorName: e.name,
|
|
1001
|
-
shadeName:
|
|
1002
|
-
...(r == null ? void 0 : r.includes("alpha")) && { alpha:
|
|
1003
|
-
...(r == null ? void 0 : r.includes("hex")) && { hex:
|
|
1004
|
-
...(r == null ? void 0 : r.includes("gl")) && { gl:
|
|
1002
|
+
shadeName: o.name,
|
|
1003
|
+
...(r == null ? void 0 : r.includes("alpha")) && { alpha: o.alpha ?? 1 },
|
|
1004
|
+
...(r == null ? void 0 : r.includes("hex")) && { hex: o.hex },
|
|
1005
|
+
...(r == null ? void 0 : r.includes("gl")) && { gl: o.gl },
|
|
1005
1006
|
...(r == null ? void 0 : r.includes("description")) && {
|
|
1006
1007
|
description: e.description
|
|
1007
1008
|
},
|
|
@@ -1036,7 +1037,7 @@ class J {
|
|
|
1036
1037
|
});
|
|
1037
1038
|
k(this, "makeUniversalJson", () => {
|
|
1038
1039
|
const r = this.makePaletteData();
|
|
1039
|
-
return
|
|
1040
|
+
return S(r);
|
|
1040
1041
|
});
|
|
1041
1042
|
k(this, "makeCssCustomProps", (r = "RGB") => {
|
|
1042
1043
|
const n = this.makePaletteData();
|
|
@@ -1086,13 +1087,13 @@ class J {
|
|
|
1086
1087
|
version: "2025.06",
|
|
1087
1088
|
type: "UI_COLOR_PALETTE"
|
|
1088
1089
|
}));
|
|
1089
|
-
var
|
|
1090
|
-
this.base = r, this.themes = n, this.meta =
|
|
1090
|
+
var i;
|
|
1091
|
+
this.base = r, this.themes = n, this.meta = t, this.paletteData = {
|
|
1091
1092
|
name: r.name ?? "UI Color Palette",
|
|
1092
1093
|
description: r.description,
|
|
1093
1094
|
themes: [],
|
|
1094
1095
|
type: "palette"
|
|
1095
|
-
}, this.currentScale = ((
|
|
1096
|
+
}, this.currentScale = ((i = n.find((a) => a.isEnabled)) == null ? void 0 : i.scale) ?? {};
|
|
1096
1097
|
}
|
|
1097
1098
|
}
|
|
1098
1099
|
export {
|