@gryt/theme 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +421 -138
- package/dist/index.js.map +1 -1
- package/dist/presets.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
1
|
+
function P(r) {
|
|
2
2
|
return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function A(r) {
|
|
5
5
|
return r <= 31308e-7 ? 12.92 * r : 1.055 * r ** (1 / 2.4) - 0.055;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function x(r) {
|
|
8
8
|
return Math.min(1, Math.max(0, r));
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function H(r) {
|
|
11
11
|
const a = r.replace("#", ""), t = a.length === 3 ? a.split("").map((e) => e + e).join("") : a;
|
|
12
12
|
return [
|
|
13
13
|
parseInt(t.slice(0, 2), 16) / 255,
|
|
@@ -15,38 +15,38 @@ function x(r) {
|
|
|
15
15
|
parseInt(t.slice(4, 6), 16) / 255
|
|
16
16
|
];
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const e = (o) => Math.round(
|
|
18
|
+
function _([r, a, t]) {
|
|
19
|
+
const e = (o) => Math.round(x(o) * 255).toString(16).padStart(2, "0");
|
|
20
20
|
return `#${e(r)}${e(a)}${e(t)}`;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const [a, t, e] =
|
|
22
|
+
function R(r) {
|
|
23
|
+
const [a, t, e] = H(r).map(P), o = Math.cbrt(
|
|
24
24
|
0.4122214708 * a + 0.5363325363 * t + 0.0514459929 * e
|
|
25
25
|
), c = Math.cbrt(
|
|
26
26
|
0.2119034982 * a + 0.6806995451 * t + 0.1073969566 * e
|
|
27
27
|
), n = Math.cbrt(
|
|
28
28
|
0.0883024619 * a + 0.2817188376 * t + 0.6299787005 * e
|
|
29
|
-
),
|
|
29
|
+
), d = 0.2104542553 * o + 0.793617785 * c - 0.0040720468 * n, f = 1.9779984951 * o - 2.428592205 * c + 0.4505937099 * n, g = 0.0259040371 * o + 0.7827717662 * c - 0.808675766 * n;
|
|
30
30
|
return {
|
|
31
|
-
l:
|
|
32
|
-
c: Math.hypot(
|
|
33
|
-
h: (Math.atan2(g,
|
|
31
|
+
l: d,
|
|
32
|
+
c: Math.hypot(f, g),
|
|
33
|
+
h: (Math.atan2(g, f) * 180 / Math.PI + 360) % 360
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const e = a * Math.cos(t * Math.PI / 180), o = a * Math.sin(t * Math.PI / 180), c = (r + 0.3963377774 * e + 0.2158037573 * o) ** 3, n = (r - 0.1055613458 * e - 0.0638541728 * o) ** 3,
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
function m({ l: r, c: a, h: t }) {
|
|
37
|
+
const e = a * Math.cos(t * Math.PI / 180), o = a * Math.sin(t * Math.PI / 180), c = (r + 0.3963377774 * e + 0.2158037573 * o) ** 3, n = (r - 0.1055613458 * e - 0.0638541728 * o) ** 3, d = (r - 0.0894841775 * e - 1.291485548 * o) ** 3;
|
|
38
|
+
return _([
|
|
39
|
+
A(x(4.0767416621 * c - 3.3077115913 * n + 0.2309699292 * d)),
|
|
40
|
+
A(x(-1.2684380046 * c + 2.6097574011 * n - 0.3413193965 * d)),
|
|
41
|
+
A(x(-0.0041960863 * c - 0.7034186147 * n + 1.707614701 * d))
|
|
42
42
|
]);
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const Y = [0.195, 0.24, 0.27, 0.3, 0.33, 0.37, 0.43, 0.52], z = [0.014, 0.026, 0.04, 0.052, 0.062, 0.072, 0.084, 0.1];
|
|
45
45
|
function h(r, a) {
|
|
46
|
-
const { h: t } =
|
|
46
|
+
const { h: t } = R(r), e = Y.map((d, f) => m({ l: d, c: z[f], h: t }));
|
|
47
47
|
e.push(r, a);
|
|
48
|
-
const o =
|
|
49
|
-
return e.push(
|
|
48
|
+
const o = R(a).l, c = Math.min(0.95, Math.max(0.84, o + 0.04)), n = Math.min(0.98, Math.max(c + 0.06, 0.93));
|
|
49
|
+
return e.push(m({ l: c, c: 0.11, h: t })), e.push(m({ l: n, c: 0.055, h: t })), e;
|
|
50
50
|
}
|
|
51
51
|
const W = [
|
|
52
52
|
0.187,
|
|
@@ -61,7 +61,7 @@ const W = [
|
|
|
61
61
|
0.57,
|
|
62
62
|
0.627,
|
|
63
63
|
0.908
|
|
64
|
-
],
|
|
64
|
+
], q = [
|
|
65
65
|
0.011,
|
|
66
66
|
0.014,
|
|
67
67
|
0.016,
|
|
@@ -75,7 +75,7 @@ const W = [
|
|
|
75
75
|
0,
|
|
76
76
|
8e-3
|
|
77
77
|
];
|
|
78
|
-
function
|
|
78
|
+
function N(r) {
|
|
79
79
|
const a = {
|
|
80
80
|
0: r.bg,
|
|
81
81
|
1: r.surface,
|
|
@@ -83,28 +83,28 @@ function U(r) {
|
|
|
83
83
|
5: r.border,
|
|
84
84
|
10: r.muted,
|
|
85
85
|
11: r.text
|
|
86
|
-
}, t =
|
|
86
|
+
}, t = R(r.border).h;
|
|
87
87
|
return W.map(
|
|
88
|
-
(e, o) => a[o] ??
|
|
88
|
+
(e, o) => a[o] ?? m({ l: e, c: q[o], h: t })
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
const t =
|
|
91
|
+
function S(r, a) {
|
|
92
|
+
const t = H(a);
|
|
93
93
|
return r.map((e) => {
|
|
94
|
-
const o =
|
|
94
|
+
const o = H(e);
|
|
95
95
|
let c = 0;
|
|
96
96
|
for (let u = 0; u < 3; u++) {
|
|
97
|
-
const i = o[u],
|
|
98
|
-
i >
|
|
97
|
+
const i = o[u], p = t[u];
|
|
98
|
+
i > p ? c = Math.max(c, p < 1 ? (i - p) / (1 - p) : 0) : i < p && (c = Math.max(c, p > 0 ? (p - i) / p : 0));
|
|
99
99
|
}
|
|
100
100
|
if (c < 1e-6) return "transparent";
|
|
101
|
-
const n =
|
|
102
|
-
o.map((u, i) =>
|
|
103
|
-
), [
|
|
104
|
-
return `rgb(${
|
|
101
|
+
const n = _(
|
|
102
|
+
o.map((u, i) => x(t[i] + (u - t[i]) / c))
|
|
103
|
+
), [d, f, g] = H(n).map((u) => Math.round(u * 255));
|
|
104
|
+
return `rgb(${d} ${f} ${g} / ${(c * 100).toFixed(1)}%)`;
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
const
|
|
107
|
+
const K = [
|
|
108
108
|
0.962,
|
|
109
109
|
1,
|
|
110
110
|
0.978,
|
|
@@ -131,7 +131,7 @@ const q = [
|
|
|
131
131
|
0.012,
|
|
132
132
|
0.014
|
|
133
133
|
], X = [0.975, 0.955, 0.93, 0.905, 0.878, 0.845, 0.795, 0.72], Q = [0.012, 0.024, 0.038, 0.05, 0.062, 0.074, 0.09, 0.11];
|
|
134
|
-
function
|
|
134
|
+
function U(r) {
|
|
135
135
|
const a = {
|
|
136
136
|
0: r.bg,
|
|
137
137
|
1: r.surface,
|
|
@@ -139,23 +139,23 @@ function C(r) {
|
|
|
139
139
|
5: r.border,
|
|
140
140
|
10: r.muted,
|
|
141
141
|
11: r.text
|
|
142
|
-
}, t =
|
|
143
|
-
return
|
|
144
|
-
(e, o) => a[o] ??
|
|
142
|
+
}, t = R(r.border).h;
|
|
143
|
+
return K.map(
|
|
144
|
+
(e, o) => a[o] ?? m({ l: e, c: J[o], h: t })
|
|
145
145
|
);
|
|
146
146
|
}
|
|
147
147
|
function b(r) {
|
|
148
|
-
const { l: a, c: t, h: e } =
|
|
149
|
-
(c, n) =>
|
|
148
|
+
const { l: a, c: t, h: e } = R(r), o = X.map(
|
|
149
|
+
(c, n) => m({ l: c, c: Q[n], h: e })
|
|
150
150
|
);
|
|
151
|
-
return o.push(r), o.push(
|
|
151
|
+
return o.push(r), o.push(m({ l: Math.max(0, a - 0.07), c: t, h: e })), o.push(m({ l: 0.46, c: 0.15, h: e })), o.push(m({ l: 0.33, c: 0.1, h: e })), o;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const [a, t, e] =
|
|
153
|
+
function E(r) {
|
|
154
|
+
const [a, t, e] = H(r).map(P);
|
|
155
155
|
return 0.2126 * a + 0.7152 * t + 0.0722 * e;
|
|
156
156
|
}
|
|
157
157
|
function se(r, a) {
|
|
158
|
-
const t =
|
|
158
|
+
const t = E(r), e = E(a);
|
|
159
159
|
return (Math.max(t, e) + 0.05) / (Math.min(t, e) + 0.05);
|
|
160
160
|
}
|
|
161
161
|
const s = {
|
|
@@ -196,8 +196,8 @@ const s = {
|
|
|
196
196
|
border: "#dadde6",
|
|
197
197
|
muted: "#5b5d65",
|
|
198
198
|
text: "#1f2129"
|
|
199
|
-
},
|
|
200
|
-
neutral:
|
|
199
|
+
}, C = {
|
|
200
|
+
neutral: N({
|
|
201
201
|
bg: s.color.bg,
|
|
202
202
|
surface: s.color.surface,
|
|
203
203
|
surfaceRaised: s.color.surfaceRaised,
|
|
@@ -213,25 +213,25 @@ const s = {
|
|
|
213
213
|
success: h(s.color.success, s.color.success),
|
|
214
214
|
danger: h(s.color.danger, s.color.dangerLight),
|
|
215
215
|
warning: h(s.color.warning, s.color.warning)
|
|
216
|
-
},
|
|
217
|
-
neutral:
|
|
216
|
+
}, T = {
|
|
217
|
+
neutral: U(l),
|
|
218
218
|
accent: b(s.color.accent),
|
|
219
219
|
secondary: b(s.color.secondary),
|
|
220
220
|
success: b(s.color.success),
|
|
221
221
|
danger: b(s.color.danger),
|
|
222
222
|
warning: b(s.color.warning)
|
|
223
|
-
},
|
|
224
|
-
neutral:
|
|
225
|
-
accent:
|
|
226
|
-
},
|
|
227
|
-
neutral:
|
|
228
|
-
accent:
|
|
223
|
+
}, F = T.neutral[3], de = {
|
|
224
|
+
neutral: S(C.neutral, s.color.bg),
|
|
225
|
+
accent: S(C.accent, s.color.bg)
|
|
226
|
+
}, fe = {
|
|
227
|
+
neutral: S(T.neutral, l.bg),
|
|
228
|
+
accent: S(T.accent, l.bg)
|
|
229
229
|
};
|
|
230
230
|
function ue(r = {}) {
|
|
231
231
|
const a = r.appearance === "light", e = { ...a ? {
|
|
232
232
|
...s.color,
|
|
233
233
|
...l,
|
|
234
|
-
surfaceHover:
|
|
234
|
+
surfaceHover: F
|
|
235
235
|
} : s.color, ...r.color }, o = { ...s.radius, ...r.radius }, c = {
|
|
236
236
|
bg: e.bg,
|
|
237
237
|
surface: e.surface,
|
|
@@ -240,30 +240,30 @@ function ue(r = {}) {
|
|
|
240
240
|
muted: e.muted,
|
|
241
241
|
text: e.text
|
|
242
242
|
}, n = a ? {
|
|
243
|
-
neutral:
|
|
243
|
+
neutral: U(c),
|
|
244
244
|
accent: b(e.accent),
|
|
245
245
|
secondary: b(e.secondary),
|
|
246
246
|
success: b(e.success),
|
|
247
247
|
danger: b(e.danger),
|
|
248
248
|
warning: b(e.warning)
|
|
249
249
|
} : {
|
|
250
|
-
neutral:
|
|
250
|
+
neutral: N(c),
|
|
251
251
|
accent: h(e.accent, e.accentLight),
|
|
252
252
|
secondary: h(e.secondary, e.secondaryLight),
|
|
253
253
|
success: h(e.success, e.success),
|
|
254
254
|
danger: h(e.danger, e.dangerLight),
|
|
255
255
|
warning: h(e.warning, e.warning)
|
|
256
|
-
},
|
|
257
|
-
for (const [
|
|
256
|
+
}, d = {};
|
|
257
|
+
for (const [f, g] of Object.entries(n))
|
|
258
258
|
g.forEach((u, i) => {
|
|
259
|
-
|
|
259
|
+
d[`--gryt-${f}-${i + 1}`] = u, d[`--color-gryt-${f}-${i + 1}`] = u;
|
|
260
260
|
});
|
|
261
|
-
for (const
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
for (const f of ["neutral", "accent"])
|
|
262
|
+
S(n[f], e.bg).forEach((g, u) => {
|
|
263
|
+
d[`--gryt-${f}-a${u + 1}`] = g, d[`--color-gryt-${f}-a${u + 1}`] = g;
|
|
264
264
|
});
|
|
265
265
|
return {
|
|
266
|
-
...
|
|
266
|
+
...d,
|
|
267
267
|
"--gryt-bg": e.bg,
|
|
268
268
|
"--gryt-surface": e.surface,
|
|
269
269
|
"--gryt-surface-raised": e.surfaceRaised,
|
|
@@ -310,7 +310,7 @@ function ue(r = {}) {
|
|
|
310
310
|
"--gryt-radius-full": `${o.full}px`
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
const
|
|
313
|
+
const v = [
|
|
314
314
|
"accent",
|
|
315
315
|
"accentLight",
|
|
316
316
|
"secondary",
|
|
@@ -322,7 +322,7 @@ const R = [
|
|
|
322
322
|
"onAccent",
|
|
323
323
|
"onSecondary",
|
|
324
324
|
"onDanger"
|
|
325
|
-
],
|
|
325
|
+
], O = [
|
|
326
326
|
"bg",
|
|
327
327
|
"surface",
|
|
328
328
|
"surfaceRaised",
|
|
@@ -330,11 +330,11 @@ const R = [
|
|
|
330
330
|
"border",
|
|
331
331
|
"muted",
|
|
332
332
|
"text"
|
|
333
|
-
],
|
|
334
|
-
function
|
|
333
|
+
], D = ["sm", "md", "lg", "xl", "full"], V = 60;
|
|
334
|
+
function M(r) {
|
|
335
335
|
return r.replace(/\s+/g, " ").trim().slice(0, V);
|
|
336
336
|
}
|
|
337
|
-
const
|
|
337
|
+
const L = {
|
|
338
338
|
hue: {
|
|
339
339
|
accent: s.color.accent,
|
|
340
340
|
accentLight: s.color.accentLight,
|
|
@@ -362,14 +362,14 @@ const p = {
|
|
|
362
362
|
bg: l.bg,
|
|
363
363
|
surface: l.surface,
|
|
364
364
|
surfaceRaised: l.surfaceRaised,
|
|
365
|
-
surfaceHover:
|
|
365
|
+
surfaceHover: F,
|
|
366
366
|
border: l.border,
|
|
367
367
|
muted: l.muted,
|
|
368
368
|
text: l.text
|
|
369
369
|
},
|
|
370
370
|
radius: { ...s.radius }
|
|
371
371
|
};
|
|
372
|
-
function
|
|
372
|
+
function G(r) {
|
|
373
373
|
return {
|
|
374
374
|
...r.name === void 0 ? {} : { name: r.name },
|
|
375
375
|
hue: { ...r.hue },
|
|
@@ -389,7 +389,7 @@ function ge(r, a) {
|
|
|
389
389
|
radius: { ...r.radius }
|
|
390
390
|
};
|
|
391
391
|
}
|
|
392
|
-
const
|
|
392
|
+
const w = {
|
|
393
393
|
accent: "accent",
|
|
394
394
|
accentLight: "accent-light",
|
|
395
395
|
secondary: "secondary",
|
|
@@ -401,7 +401,7 @@ const H = {
|
|
|
401
401
|
onAccent: "on-accent",
|
|
402
402
|
onSecondary: "on-secondary",
|
|
403
403
|
onDanger: "on-danger"
|
|
404
|
-
},
|
|
404
|
+
}, B = {
|
|
405
405
|
bg: "bg",
|
|
406
406
|
surface: "surface",
|
|
407
407
|
surfaceRaised: "raised",
|
|
@@ -410,28 +410,28 @@ const H = {
|
|
|
410
410
|
muted: "muted",
|
|
411
411
|
text: "text"
|
|
412
412
|
}, ee = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
413
|
-
function
|
|
413
|
+
function j(r) {
|
|
414
414
|
return ee.test(r.trim());
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function $(r) {
|
|
417
417
|
const a = r.trim().toLowerCase();
|
|
418
418
|
return a.length === 4 ? `#${a[1]}${a[1]}${a[2]}${a[2]}${a[3]}${a[3]}` : a;
|
|
419
419
|
}
|
|
420
420
|
function ie(r, a) {
|
|
421
|
-
const t = new URLSearchParams(), e = (c) =>
|
|
421
|
+
const t = new URLSearchParams(), e = (c) => $(c).slice(1), o = M(r.name ?? "");
|
|
422
422
|
o !== "" && t.set("name", o);
|
|
423
|
-
for (const c of
|
|
424
|
-
r.hue[c] !==
|
|
423
|
+
for (const c of v)
|
|
424
|
+
r.hue[c] !== L.hue[c] && t.set(w[c], e(r.hue[c]));
|
|
425
425
|
if (r.lightHue !== null)
|
|
426
|
-
for (const c of
|
|
427
|
-
t.set(`lh-${
|
|
426
|
+
for (const c of v)
|
|
427
|
+
t.set(`lh-${w[c]}`, e(r.lightHue[c]));
|
|
428
428
|
for (const c of ["dark", "light"]) {
|
|
429
429
|
const n = c === "dark" ? "d" : "l";
|
|
430
|
-
for (const
|
|
431
|
-
r[c][
|
|
430
|
+
for (const d of O)
|
|
431
|
+
r[c][d] !== L[c][d] && t.set(`${n}-${B[d]}`, e(r[c][d]));
|
|
432
432
|
}
|
|
433
|
-
for (const c of
|
|
434
|
-
r.radius[c] !==
|
|
433
|
+
for (const c of D)
|
|
434
|
+
r.radius[c] !== L.radius[c] && t.set(`r-${c}`, String(r.radius[c]));
|
|
435
435
|
return a === "light" && t.set("mode", "light"), t;
|
|
436
436
|
}
|
|
437
437
|
function le(r) {
|
|
@@ -442,35 +442,35 @@ function le(r) {
|
|
|
442
442
|
return re(new URLSearchParams(t));
|
|
443
443
|
}
|
|
444
444
|
function re(r) {
|
|
445
|
-
const a =
|
|
445
|
+
const a = G(L);
|
|
446
446
|
let t = !1;
|
|
447
447
|
const e = (c) => {
|
|
448
448
|
const n = r.get(c);
|
|
449
449
|
if (n === null) return null;
|
|
450
|
-
const
|
|
451
|
-
return
|
|
452
|
-
}, o =
|
|
450
|
+
const d = n.startsWith("#") ? n : `#${n}`;
|
|
451
|
+
return j(d) ? (t = !0, $(d)) : null;
|
|
452
|
+
}, o = M(r.get("name") ?? "");
|
|
453
453
|
o !== "" && (a.name = o, t = !0);
|
|
454
|
-
for (const c of
|
|
455
|
-
const n = e(
|
|
454
|
+
for (const c of v) {
|
|
455
|
+
const n = e(w[c]);
|
|
456
456
|
n !== null && (a.hue[c] = n);
|
|
457
457
|
}
|
|
458
|
-
if (r.has(`lh-${
|
|
458
|
+
if (r.has(`lh-${w.accent}`)) {
|
|
459
459
|
const c = { ...a.hue };
|
|
460
|
-
for (const n of
|
|
461
|
-
const
|
|
462
|
-
|
|
460
|
+
for (const n of v) {
|
|
461
|
+
const d = e(`lh-${w[n]}`);
|
|
462
|
+
d !== null && (c[n] = d);
|
|
463
463
|
}
|
|
464
464
|
a.lightHue = c;
|
|
465
465
|
}
|
|
466
466
|
for (const c of ["dark", "light"]) {
|
|
467
467
|
const n = c === "dark" ? "d" : "l";
|
|
468
|
-
for (const
|
|
469
|
-
const
|
|
470
|
-
|
|
468
|
+
for (const d of O) {
|
|
469
|
+
const f = e(`${n}-${B[d]}`);
|
|
470
|
+
f !== null && (a[c][d] = f);
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
for (const c of
|
|
473
|
+
for (const c of D) {
|
|
474
474
|
const n = Number(r.get(`r-${c}`));
|
|
475
475
|
Number.isFinite(n) && n >= 0 && n <= 999 && r.has(`r-${c}`) && (a.radius[c] = Math.round(n), t = !0);
|
|
476
476
|
}
|
|
@@ -487,15 +487,15 @@ function ae(r) {
|
|
|
487
487
|
return null;
|
|
488
488
|
}
|
|
489
489
|
if (typeof a != "object" || a === null) return null;
|
|
490
|
-
const t = a, e =
|
|
490
|
+
const t = a, e = G(L);
|
|
491
491
|
let o = !1;
|
|
492
|
-
const c = (n,
|
|
492
|
+
const c = (n, d) => {
|
|
493
493
|
if (!(typeof n != "object" || n === null))
|
|
494
|
-
for (const [
|
|
495
|
-
typeof g == "string" &&
|
|
494
|
+
for (const [f, g] of Object.entries(n))
|
|
495
|
+
typeof g == "string" && j(g) && f in d && (d[f] = $(g), o = !0);
|
|
496
496
|
};
|
|
497
497
|
if (typeof t.name == "string") {
|
|
498
|
-
const n =
|
|
498
|
+
const n = M(t.name);
|
|
499
499
|
n !== "" && (e.name = n, o = !0);
|
|
500
500
|
}
|
|
501
501
|
if (c(t.hue, e.hue), c(t.dark, e.dark), c(t.light, e.light), typeof t.lightHue == "object" && t.lightHue !== null) {
|
|
@@ -503,22 +503,22 @@ function ae(r) {
|
|
|
503
503
|
c(t.lightHue, n), e.lightHue = n;
|
|
504
504
|
}
|
|
505
505
|
if (typeof t.radius == "object" && t.radius !== null)
|
|
506
|
-
for (const [n,
|
|
506
|
+
for (const [n, d] of Object.entries(
|
|
507
507
|
t.radius
|
|
508
508
|
)) {
|
|
509
|
-
const
|
|
510
|
-
|
|
509
|
+
const f = Number(d);
|
|
510
|
+
D.includes(n) && Number.isFinite(f) && f >= 0 && f <= 999 && (e.radius[n] = Math.round(f), o = !0);
|
|
511
511
|
}
|
|
512
512
|
return o ? { theme: e, appearance: "dark" } : null;
|
|
513
513
|
}
|
|
514
|
-
const
|
|
514
|
+
const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg: 14, xl: 18, full: 999 }, ce = { sm: 4, md: 6, lg: 10, xl: 14, full: 6 }, te = { sm: 6, md: 8, lg: 10, xl: 14, full: 10 }, I = { sm: 2, md: 4, lg: 6, xl: 8, full: 4 }, ne = { sm: 8, md: 8, lg: 8, xl: 8, full: 8 }, oe = [
|
|
515
515
|
{
|
|
516
516
|
id: "gryt",
|
|
517
517
|
name: "Gryt",
|
|
518
518
|
note: "What the library ships, from the Gryt code-theme.",
|
|
519
519
|
group: "Gryt",
|
|
520
520
|
source: "github.com/Gryt-chat/code-theme",
|
|
521
|
-
theme:
|
|
521
|
+
theme: L
|
|
522
522
|
},
|
|
523
523
|
{
|
|
524
524
|
/* Credits to Carlo, who made this in the generator and sent the link.
|
|
@@ -531,7 +531,7 @@ const k = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, T = { sm: 6, md: 8, lg:
|
|
|
531
531
|
note: "The shipped palette, every corner at eight pixels. Made by Carlo.",
|
|
532
532
|
group: "Gryt",
|
|
533
533
|
source: "Carlo",
|
|
534
|
-
theme: { ...
|
|
534
|
+
theme: { ...G(L), name: "Gryt Rounded", radius: ne }
|
|
535
535
|
},
|
|
536
536
|
{
|
|
537
537
|
id: "ember",
|
|
@@ -572,7 +572,7 @@ const k = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, T = { sm: 6, md: 8, lg:
|
|
|
572
572
|
muted: "#6b5b50",
|
|
573
573
|
text: "#241a14"
|
|
574
574
|
},
|
|
575
|
-
radius:
|
|
575
|
+
radius: y
|
|
576
576
|
}
|
|
577
577
|
},
|
|
578
578
|
{
|
|
@@ -614,7 +614,290 @@ const k = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, T = { sm: 6, md: 8, lg:
|
|
|
614
614
|
muted: "#5b5b63",
|
|
615
615
|
text: "#17171a"
|
|
616
616
|
},
|
|
617
|
-
radius:
|
|
617
|
+
radius: k
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
/*
|
|
621
|
+
* The owl palettes, as themes.
|
|
622
|
+
*
|
|
623
|
+
* Six drawings of the Gryt owl, each in a different set of colours. They were
|
|
624
|
+
* made as artwork rather than as themes, so what is here is derived from them
|
|
625
|
+
* rather than lifted: a drawing names four or five colours and a theme needs
|
|
626
|
+
* eleven hues and seven neutrals in each of two appearances.
|
|
627
|
+
*
|
|
628
|
+
* Derived in OKLCH, and the reason is visible in the result — a ramp built by
|
|
629
|
+
* darkening sRGB drifts grey, so the surfaces stop belonging to the theme
|
|
630
|
+
* about three steps down. Holding hue and chroma while moving lightness keeps
|
|
631
|
+
* Rose's greys pink and Forest's greys green, which is the whole point of a
|
|
632
|
+
* themed neutral.
|
|
633
|
+
*
|
|
634
|
+
* Secondaries are analogous rather than complementary, matching Ember above.
|
|
635
|
+
* A true complement put Indigo's secondary on orange and Ice's on tan, which
|
|
636
|
+
* read as colours borrowed from another theme.
|
|
637
|
+
*
|
|
638
|
+
* `onAccent` is chosen per theme rather than assumed: whichever of the light
|
|
639
|
+
* or dark ink has more contrast on that accent is the one that ships. Forest's
|
|
640
|
+
* sage takes dark ink at 8.1:1; Indigo's periwinkle takes light at 4.7:1.
|
|
641
|
+
*
|
|
642
|
+
* Every one is checked in both appearances — text 14.8:1 or better on its own
|
|
643
|
+
* background, muted 5.7:1 or better on its surface.
|
|
644
|
+
*/
|
|
645
|
+
{
|
|
646
|
+
id: "owl-rose",
|
|
647
|
+
name: "Rose",
|
|
648
|
+
note: "Dusty rose over plum. The warmest of the six.",
|
|
649
|
+
group: "Gryt",
|
|
650
|
+
source: "Gryt owl palettes",
|
|
651
|
+
theme: {
|
|
652
|
+
name: "Rose",
|
|
653
|
+
hue: {
|
|
654
|
+
accent: "#D87489",
|
|
655
|
+
accentLight: "#EDAAAF",
|
|
656
|
+
secondary: "#d7906f",
|
|
657
|
+
secondaryLight: "#efb499",
|
|
658
|
+
success: "#69b27a",
|
|
659
|
+
danger: "#da534f",
|
|
660
|
+
dangerLight: "#f07f77",
|
|
661
|
+
warning: "#e6ac3d",
|
|
662
|
+
onAccent: "#2b0614",
|
|
663
|
+
onSecondary: "#2b0614",
|
|
664
|
+
onDanger: "#2b0a08"
|
|
665
|
+
},
|
|
666
|
+
lightHue: null,
|
|
667
|
+
dark: {
|
|
668
|
+
bg: "#1f020b",
|
|
669
|
+
surface: "#2b0c16",
|
|
670
|
+
surfaceRaised: "#34151e",
|
|
671
|
+
surfaceHover: "#45202b",
|
|
672
|
+
border: "#4c2933",
|
|
673
|
+
muted: "#a38b90",
|
|
674
|
+
text: "#f4ede9"
|
|
675
|
+
},
|
|
676
|
+
light: {
|
|
677
|
+
bg: "#fbf1ed",
|
|
678
|
+
surface: "#fffcfb",
|
|
679
|
+
surfaceRaised: "#fdf5f1",
|
|
680
|
+
surfaceHover: "#f3e6e1",
|
|
681
|
+
border: "#e4d6d0",
|
|
682
|
+
muted: "#765b61",
|
|
683
|
+
text: "#31151d"
|
|
684
|
+
},
|
|
685
|
+
radius: y
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
id: "owl-amber",
|
|
690
|
+
name: "Amber",
|
|
691
|
+
note: "Amber on aubergine — a warm accent over cool-dark neutrals.",
|
|
692
|
+
group: "Gryt",
|
|
693
|
+
source: "Gryt owl palettes",
|
|
694
|
+
theme: {
|
|
695
|
+
name: "Amber",
|
|
696
|
+
hue: {
|
|
697
|
+
accent: "#E39336",
|
|
698
|
+
accentLight: "#ECC07C",
|
|
699
|
+
secondary: "#c0b760",
|
|
700
|
+
secondaryLight: "#ddd793",
|
|
701
|
+
success: "#69b27a",
|
|
702
|
+
danger: "#da534f",
|
|
703
|
+
dangerLight: "#f07f77",
|
|
704
|
+
warning: "#e6ac3d",
|
|
705
|
+
onAccent: "#1e101e",
|
|
706
|
+
onSecondary: "#1e101e",
|
|
707
|
+
onDanger: "#2b0a08"
|
|
708
|
+
},
|
|
709
|
+
lightHue: null,
|
|
710
|
+
dark: {
|
|
711
|
+
bg: "#140814",
|
|
712
|
+
surface: "#20131f",
|
|
713
|
+
surfaceRaised: "#281c27",
|
|
714
|
+
surfaceHover: "#372836",
|
|
715
|
+
border: "#3e303d",
|
|
716
|
+
muted: "#988f97",
|
|
717
|
+
text: "#f1eee8"
|
|
718
|
+
},
|
|
719
|
+
light: {
|
|
720
|
+
bg: "#f7f3ec",
|
|
721
|
+
surface: "#fffdfa",
|
|
722
|
+
surfaceRaised: "#faf6f0",
|
|
723
|
+
surfaceHover: "#efe9df",
|
|
724
|
+
border: "#dfd8cd",
|
|
725
|
+
muted: "#6a5f69",
|
|
726
|
+
text: "#261b26"
|
|
727
|
+
},
|
|
728
|
+
radius: y
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
id: "owl-wine",
|
|
733
|
+
name: "Wine",
|
|
734
|
+
note: "Deep red throughout. Neutrals carry the same hue as the accent.",
|
|
735
|
+
group: "Gryt",
|
|
736
|
+
source: "Gryt owl palettes",
|
|
737
|
+
theme: {
|
|
738
|
+
name: "Wine",
|
|
739
|
+
hue: {
|
|
740
|
+
accent: "#CE7072",
|
|
741
|
+
accentLight: "#E29A98",
|
|
742
|
+
secondary: "#c88d61",
|
|
743
|
+
secondaryLight: "#e0b08d",
|
|
744
|
+
success: "#69b27a",
|
|
745
|
+
danger: "#da534f",
|
|
746
|
+
dangerLight: "#f07f77",
|
|
747
|
+
warning: "#e6ac3d",
|
|
748
|
+
onAccent: "#250d16",
|
|
749
|
+
onSecondary: "#250d16",
|
|
750
|
+
onDanger: "#2b0a08"
|
|
751
|
+
},
|
|
752
|
+
lightHue: null,
|
|
753
|
+
dark: {
|
|
754
|
+
bg: "#1a050d",
|
|
755
|
+
surface: "#261118",
|
|
756
|
+
surfaceRaised: "#2e1920",
|
|
757
|
+
surfaceHover: "#3e252e",
|
|
758
|
+
border: "#452e35",
|
|
759
|
+
muted: "#9d8d92",
|
|
760
|
+
text: "#f4edea"
|
|
761
|
+
},
|
|
762
|
+
light: {
|
|
763
|
+
bg: "#faf1ee",
|
|
764
|
+
surface: "#fffdfb",
|
|
765
|
+
surfaceRaised: "#fdf5f1",
|
|
766
|
+
surfaceHover: "#f2e7e2",
|
|
767
|
+
border: "#e3d6d0",
|
|
768
|
+
muted: "#705d63",
|
|
769
|
+
text: "#2c191f"
|
|
770
|
+
},
|
|
771
|
+
radius: y
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
id: "owl-indigo",
|
|
776
|
+
name: "Indigo",
|
|
777
|
+
note: "Periwinkle on deep indigo. The closest to the Gryt mark.",
|
|
778
|
+
group: "Gryt",
|
|
779
|
+
source: "Gryt owl palettes",
|
|
780
|
+
theme: {
|
|
781
|
+
name: "Indigo",
|
|
782
|
+
hue: {
|
|
783
|
+
accent: "#786FF6",
|
|
784
|
+
accentLight: "#9E97FA",
|
|
785
|
+
secondary: "#ba70cb",
|
|
786
|
+
secondaryLight: "#d397e1",
|
|
787
|
+
success: "#69b27a",
|
|
788
|
+
danger: "#da534f",
|
|
789
|
+
dangerLight: "#f07f77",
|
|
790
|
+
warning: "#e6ac3d",
|
|
791
|
+
onAccent: "#121329",
|
|
792
|
+
onSecondary: "#121329",
|
|
793
|
+
onDanger: "#2b0a08"
|
|
794
|
+
},
|
|
795
|
+
lightHue: null,
|
|
796
|
+
dark: {
|
|
797
|
+
bg: "#0a0b1e",
|
|
798
|
+
surface: "#151629",
|
|
799
|
+
surfaceRaised: "#1d1e32",
|
|
800
|
+
surfaceHover: "#2a2c42",
|
|
801
|
+
border: "#323348",
|
|
802
|
+
muted: "#8f919f",
|
|
803
|
+
text: "#eeeef3"
|
|
804
|
+
},
|
|
805
|
+
light: {
|
|
806
|
+
bg: "#f3f2f9",
|
|
807
|
+
surface: "#fdfdff",
|
|
808
|
+
surfaceRaised: "#f6f6fc",
|
|
809
|
+
surfaceHover: "#e9e8f1",
|
|
810
|
+
border: "#d9d8e2",
|
|
811
|
+
muted: "#606272",
|
|
812
|
+
text: "#1c1d2f"
|
|
813
|
+
},
|
|
814
|
+
radius: y
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
id: "owl-forest",
|
|
819
|
+
name: "Forest",
|
|
820
|
+
note: "Sage over slate. The only one whose accent is the quiet colour.",
|
|
821
|
+
group: "Gryt",
|
|
822
|
+
source: "Gryt owl palettes",
|
|
823
|
+
theme: {
|
|
824
|
+
name: "Forest",
|
|
825
|
+
hue: {
|
|
826
|
+
accent: "#98B4A1",
|
|
827
|
+
accentLight: "#C7D7CA",
|
|
828
|
+
secondary: "#a2bfbe",
|
|
829
|
+
secondaryLight: "#c5dddc",
|
|
830
|
+
success: "#69b27a",
|
|
831
|
+
danger: "#da534f",
|
|
832
|
+
dangerLight: "#f07f77",
|
|
833
|
+
warning: "#e6ac3d",
|
|
834
|
+
onAccent: "#13161e",
|
|
835
|
+
onSecondary: "#13161e",
|
|
836
|
+
onDanger: "#2b0a08"
|
|
837
|
+
},
|
|
838
|
+
lightHue: null,
|
|
839
|
+
dark: {
|
|
840
|
+
bg: "#0a0d14",
|
|
841
|
+
surface: "#15181f",
|
|
842
|
+
surfaceRaised: "#1d2028",
|
|
843
|
+
surfaceHover: "#2a2e36",
|
|
844
|
+
border: "#32353d",
|
|
845
|
+
muted: "#909297",
|
|
846
|
+
text: "#edefed"
|
|
847
|
+
},
|
|
848
|
+
light: {
|
|
849
|
+
bg: "#f2f4f2",
|
|
850
|
+
surface: "#fdfefd",
|
|
851
|
+
surfaceRaised: "#f5f7f6",
|
|
852
|
+
surfaceHover: "#e7eae8",
|
|
853
|
+
border: "#d7dad7",
|
|
854
|
+
muted: "#616369",
|
|
855
|
+
text: "#1d1f26"
|
|
856
|
+
},
|
|
857
|
+
radius: y
|
|
858
|
+
}
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
id: "owl-ice",
|
|
862
|
+
name: "Ice",
|
|
863
|
+
note: "Steel blue on near-white. Built light first.",
|
|
864
|
+
group: "Gryt",
|
|
865
|
+
source: "Gryt owl palettes",
|
|
866
|
+
theme: {
|
|
867
|
+
name: "Ice",
|
|
868
|
+
hue: {
|
|
869
|
+
accent: "#7495B9",
|
|
870
|
+
accentLight: "#BADDFC",
|
|
871
|
+
secondary: "#9c99bc",
|
|
872
|
+
secondaryLight: "#bcbad6",
|
|
873
|
+
success: "#69b27a",
|
|
874
|
+
danger: "#da534f",
|
|
875
|
+
dangerLight: "#f07f77",
|
|
876
|
+
warning: "#e6ac3d",
|
|
877
|
+
onAccent: "#10171e",
|
|
878
|
+
onSecondary: "#10171e",
|
|
879
|
+
onDanger: "#2b0a08"
|
|
880
|
+
},
|
|
881
|
+
lightHue: null,
|
|
882
|
+
dark: {
|
|
883
|
+
bg: "#080e14",
|
|
884
|
+
surface: "#13191f",
|
|
885
|
+
surfaceRaised: "#1b2127",
|
|
886
|
+
surfaceHover: "#272f36",
|
|
887
|
+
border: "#2f363d",
|
|
888
|
+
muted: "#8e9397",
|
|
889
|
+
text: "#eeeeef"
|
|
890
|
+
},
|
|
891
|
+
light: {
|
|
892
|
+
bg: "#f3f3f4",
|
|
893
|
+
surface: "#fdfdfe",
|
|
894
|
+
surfaceRaised: "#f6f7f8",
|
|
895
|
+
surfaceHover: "#e9e9eb",
|
|
896
|
+
border: "#d8d9da",
|
|
897
|
+
muted: "#5f6469",
|
|
898
|
+
text: "#1a2025"
|
|
899
|
+
},
|
|
900
|
+
radius: y
|
|
618
901
|
}
|
|
619
902
|
},
|
|
620
903
|
{
|
|
@@ -656,7 +939,7 @@ const k = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, T = { sm: 6, md: 8, lg:
|
|
|
656
939
|
muted: "#3d3d3d",
|
|
657
940
|
text: "#000000"
|
|
658
941
|
},
|
|
659
|
-
radius:
|
|
942
|
+
radius: I
|
|
660
943
|
}
|
|
661
944
|
},
|
|
662
945
|
{
|
|
@@ -715,7 +998,7 @@ const k = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, T = { sm: 6, md: 8, lg:
|
|
|
715
998
|
muted: "#6c664b",
|
|
716
999
|
text: "#1f1f1f"
|
|
717
1000
|
},
|
|
718
|
-
radius:
|
|
1001
|
+
radius: k
|
|
719
1002
|
}
|
|
720
1003
|
},
|
|
721
1004
|
{
|
|
@@ -773,7 +1056,7 @@ const k = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, T = { sm: 6, md: 8, lg:
|
|
|
773
1056
|
muted: "#4c566a",
|
|
774
1057
|
text: "#2e3440"
|
|
775
1058
|
},
|
|
776
|
-
radius:
|
|
1059
|
+
radius: k
|
|
777
1060
|
}
|
|
778
1061
|
},
|
|
779
1062
|
{
|
|
@@ -832,7 +1115,7 @@ const k = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, T = { sm: 6, md: 8, lg:
|
|
|
832
1115
|
muted: "#6c6f85",
|
|
833
1116
|
text: "#4c4f69"
|
|
834
1117
|
},
|
|
835
|
-
radius:
|
|
1118
|
+
radius: y
|
|
836
1119
|
}
|
|
837
1120
|
},
|
|
838
1121
|
{
|
|
@@ -940,7 +1223,7 @@ const k = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, T = { sm: 6, md: 8, lg:
|
|
|
940
1223
|
muted: "#87867f",
|
|
941
1224
|
text: "#141413"
|
|
942
1225
|
},
|
|
943
|
-
radius:
|
|
1226
|
+
radius: y
|
|
944
1227
|
}
|
|
945
1228
|
},
|
|
946
1229
|
{
|
|
@@ -1048,7 +1331,7 @@ const k = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, T = { sm: 6, md: 8, lg:
|
|
|
1048
1331
|
muted: "#586e75",
|
|
1049
1332
|
text: "#073642"
|
|
1050
1333
|
},
|
|
1051
|
-
radius:
|
|
1334
|
+
radius: I
|
|
1052
1335
|
}
|
|
1053
1336
|
}
|
|
1054
1337
|
], he = new Map(
|
|
@@ -1149,41 +1432,41 @@ function xe(r, a) {
|
|
|
1149
1432
|
return c + (n - c) * o;
|
|
1150
1433
|
}
|
|
1151
1434
|
export {
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1435
|
+
v as GRYT_HUE_KEYS,
|
|
1436
|
+
O as GRYT_NEUTRAL_KEYS,
|
|
1437
|
+
D as GRYT_RADIUS_KEYS,
|
|
1155
1438
|
V as GRYT_THEME_NAME_MAX,
|
|
1156
|
-
|
|
1157
|
-
|
|
1439
|
+
S as alphaScale,
|
|
1440
|
+
G as cloneGrytTheme,
|
|
1158
1441
|
se as contrast,
|
|
1159
1442
|
ue as createGrytTheme,
|
|
1160
1443
|
le as decodeGrytTheme,
|
|
1161
1444
|
ie as encodeGrytTheme,
|
|
1162
|
-
|
|
1163
|
-
|
|
1445
|
+
de as grytAlphaScales,
|
|
1446
|
+
fe as grytAlphaScalesLight,
|
|
1164
1447
|
Le as grytDrawerBleed,
|
|
1165
1448
|
me as grytDurations,
|
|
1166
1449
|
l as grytLightTokens,
|
|
1167
1450
|
oe as grytPresets,
|
|
1168
1451
|
he as grytPresetsById,
|
|
1169
1452
|
pe as grytScaleSteps,
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1453
|
+
C as grytScales,
|
|
1454
|
+
T as grytScalesLight,
|
|
1455
|
+
L as grytTheme,
|
|
1173
1456
|
Z as grytThemeHues,
|
|
1174
1457
|
ge as grytThemeToOptions,
|
|
1175
1458
|
s as grytTokens,
|
|
1176
|
-
|
|
1177
|
-
|
|
1459
|
+
R as hexToOklch,
|
|
1460
|
+
H as hexToRgb,
|
|
1178
1461
|
h as hueScale,
|
|
1179
1462
|
b as hueScaleLight,
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1463
|
+
j as isHexColor,
|
|
1464
|
+
N as neutralScale,
|
|
1465
|
+
U as neutralScaleLight,
|
|
1466
|
+
$ as normalizeHexColor,
|
|
1467
|
+
M as normalizeThemeName,
|
|
1468
|
+
m as oklchToHex,
|
|
1469
|
+
_ as rgbToHex,
|
|
1187
1470
|
xe as sampleCurve,
|
|
1188
1471
|
be as springSamples,
|
|
1189
1472
|
ye as springTightSamples
|