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