@kernel4632/kima 0.0.0-stage → 0.6.1
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/LICENSE +21 -0
- package/README.md +209 -2
- package/dist/THIRD_PARTY_NOTICES.txt +2676 -0
- package/dist/kima-elements-core.js +53209 -0
- package/dist/kima-elements.js +126371 -0
- package/dist/kima-theme.js +1583 -0
- package/dist/kima.js +141 -0
- package/dist/style.css +2 -0
- package/dist/vue/_virtual/_plugin-vue_export-helper.js +7 -0
- package/dist/vue/components/advanced-input/calendar.ce.js +216 -0
- package/dist/vue/components/advanced-input/date-range-picker.ce.js +224 -0
- package/dist/vue/components/advanced-input/editable.ce.js +160 -0
- package/dist/vue/components/advanced-input/mention.ce.js +181 -0
- package/dist/vue/components/advanced-input/range-slider.ce.js +111 -0
- package/dist/vue/components/advanced-input/time-range-picker.ce.js +120 -0
- package/dist/vue/components/advanced-input/transfer.ce.js +192 -0
- package/dist/vue/components/content/chart.ce.js +282 -0
- package/dist/vue/components/content/code-editor.ce.js +309 -0
- package/dist/vue/components/content/equation.ce.js +69 -0
- package/dist/vue/components/content/heatmap.ce.js +148 -0
- package/dist/vue/components/content/rich-text-editor.ce.js +319 -0
- package/dist/vue/components/core/badge.ce.js +66 -0
- package/dist/vue/components/core/button-group.ce.js +142 -0
- package/dist/vue/components/core/button.ce.js +73 -0
- package/dist/vue/components/core/card.ce.js +73 -0
- package/dist/vue/components/core/cascader.ce.js +329 -0
- package/dist/vue/components/core/checkbox.ce.js +116 -0
- package/dist/vue/components/core/code-block.ce.js +108 -0
- package/dist/vue/components/core/combobox.ce.js +354 -0
- package/dist/vue/components/core/date-picker.ce.js +433 -0
- package/dist/vue/components/core/dialog.ce.js +118 -0
- package/dist/vue/components/core/divider.ce.js +49 -0
- package/dist/vue/components/core/drawer.ce.js +235 -0
- package/dist/vue/components/core/empty-state.ce.js +58 -0
- package/dist/vue/components/core/icon-button.ce.js +93 -0
- package/dist/vue/components/core/icon.ce.js +42 -0
- package/dist/vue/components/core/layout.ce.js +68 -0
- package/dist/vue/components/core/menu.ce.js +178 -0
- package/dist/vue/components/core/notification.ce.js +158 -0
- package/dist/vue/components/core/pagination.ce.js +158 -0
- package/dist/vue/components/core/progress.ce.js +49 -0
- package/dist/vue/components/core/select.ce.js +325 -0
- package/dist/vue/components/core/slider.ce.js +116 -0
- package/dist/vue/components/core/switch.ce.js +100 -0
- package/dist/vue/components/core/tabs.ce.js +193 -0
- package/dist/vue/components/core/text-field.ce.js +194 -0
- package/dist/vue/components/core/time-picker.ce.js +486 -0
- package/dist/vue/components/core/tooltip.ce.js +125 -0
- package/dist/vue/components/core/tree.ce.js +248 -0
- package/dist/vue/components/core/virtual-scroll.ce.js +176 -0
- package/dist/vue/components/data/copy-button.ce.js +75 -0
- package/dist/vue/components/data/image-preview.ce.js +226 -0
- package/dist/vue/components/data/infinite-scroll.ce.js +126 -0
- package/dist/vue/components/data/long-text.ce.js +70 -0
- package/dist/vue/components/data/relative-time.ce.js +77 -0
- package/dist/vue/components/data/ring-progress.ce.js +87 -0
- package/dist/vue/components/data/table.ce.js +491 -0
- package/dist/vue/components/data/virtual-table.ce.js +178 -0
- package/dist/vue/components/data/virtual-tree.ce.js +213 -0
- package/dist/vue/components/display/alert.ce.js +101 -0
- package/dist/vue/components/display/avatar-group.ce.js +65 -0
- package/dist/vue/components/display/avatar.ce.js +84 -0
- package/dist/vue/components/display/blockquote.ce.js +44 -0
- package/dist/vue/components/display/countdown.ce.js +77 -0
- package/dist/vue/components/display/descriptions.ce.js +43 -0
- package/dist/vue/components/display/highlight.ce.js +48 -0
- package/dist/vue/components/display/image.ce.js +146 -0
- package/dist/vue/components/display/list.ce.js +68 -0
- package/dist/vue/components/display/result.ce.js +57 -0
- package/dist/vue/components/display/skeleton.ce.js +67 -0
- package/dist/vue/components/display/spinner.ce.js +42 -0
- package/dist/vue/components/display/statistic.ce.js +71 -0
- package/dist/vue/components/display/timeline.ce.js +59 -0
- package/dist/vue/components/form-completion/angle-slider.ce.js +103 -0
- package/dist/vue/components/form-completion/color-picker.ce.js +286 -0
- package/dist/vue/components/form-completion/date-field.ce.js +131 -0
- package/dist/vue/components/form-completion/dynamic-input.ce.js +158 -0
- package/dist/vue/components/form-completion/form.ce.js +248 -0
- package/dist/vue/components/form-completion/json-input.ce.js +114 -0
- package/dist/vue/components/form-completion/masked-input.ce.js +88 -0
- package/dist/vue/components/form-completion/period-picker.ce.js +147 -0
- package/dist/vue/components/form-completion/time-field.ce.js +120 -0
- package/dist/vue/components/form-completion/upload-manager.ce.js +223 -0
- package/dist/vue/components/foundation/banner.ce.js +106 -0
- package/dist/vue/components/foundation/error-state.ce.js +108 -0
- package/dist/vue/components/foundation/field-group.ce.js +146 -0
- package/dist/vue/components/foundation/flex.ce.js +60 -0
- package/dist/vue/components/foundation/grid.ce.js +52 -0
- package/dist/vue/components/foundation/input-group.ce.js +34 -0
- package/dist/vue/components/foundation/page-header.ce.js +55 -0
- package/dist/vue/components/foundation/time-display.ce.js +129 -0
- package/dist/vue/components/foundation/typography.ce.js +71 -0
- package/dist/vue/components/input/checkbox-group.ce.js +93 -0
- package/dist/vue/components/input/field.ce.js +74 -0
- package/dist/vue/components/input/file-upload.ce.js +142 -0
- package/dist/vue/components/input/number-field.ce.js +103 -0
- package/dist/vue/components/input/pin-input.ce.js +112 -0
- package/dist/vue/components/input/radio-group.ce.js +96 -0
- package/dist/vue/components/input/rating.ce.js +115 -0
- package/dist/vue/components/input/tags-input.ce.js +153 -0
- package/dist/vue/components/input/textarea.ce.js +180 -0
- package/dist/vue/components/input/toggle.ce.js +58 -0
- package/dist/vue/components/interaction/chip.ce.js +95 -0
- package/dist/vue/components/interaction/command.ce.js +161 -0
- package/dist/vue/components/interaction/context-menu.ce.js +113 -0
- package/dist/vue/components/interaction/hover-card.ce.js +92 -0
- package/dist/vue/components/interaction/loading-overlay.ce.js +70 -0
- package/dist/vue/components/interaction/menubar.ce.js +134 -0
- package/dist/vue/components/interaction/multi-select.ce.js +264 -0
- package/dist/vue/components/interaction/popconfirm.ce.js +95 -0
- package/dist/vue/components/interaction/popover.ce.js +83 -0
- package/dist/vue/components/interaction/tree-select.ce.js +195 -0
- package/dist/vue/components/navigation/accordion.ce.js +114 -0
- package/dist/vue/components/navigation/anchor.ce.js +125 -0
- package/dist/vue/components/navigation/back-top.ce.js +67 -0
- package/dist/vue/components/navigation/breadcrumb.ce.js +48 -0
- package/dist/vue/components/navigation/carousel.ce.js +114 -0
- package/dist/vue/components/navigation/collapsible.ce.js +57 -0
- package/dist/vue/components/navigation/link.ce.js +62 -0
- package/dist/vue/components/navigation/navigation-menu.ce.js +91 -0
- package/dist/vue/components/navigation/overflow-list.ce.js +67 -0
- package/dist/vue/components/navigation/scroll-area.ce.js +47 -0
- package/dist/vue/components/navigation/splitter.ce.js +131 -0
- package/dist/vue/components/navigation/stepper.ce.js +74 -0
- package/dist/vue/components/navigation/toolbar.ce.js +93 -0
- package/dist/vue/components/navigation/visually-hidden.ce.js +16 -0
- package/dist/vue/components/shell/app-shell.ce.js +87 -0
- package/dist/vue/components/shell/config-provider.ce.js +110 -0
- package/dist/vue/components/shell/marquee.ce.js +92 -0
- package/dist/vue/components/shell/masonry.ce.js +50 -0
- package/dist/vue/components/shell/sidebar.ce.js +125 -0
- package/dist/vue/components/utility/affix.ce.js +64 -0
- package/dist/vue/components/utility/alert-dialog.ce.js +124 -0
- package/dist/vue/components/utility/animated-number.ce.js +66 -0
- package/dist/vue/components/utility/float-button.ce.js +104 -0
- package/dist/vue/components/utility/listbox.ce.js +81 -0
- package/dist/vue/components/utility/loading-bar.ce.js +85 -0
- package/dist/vue/components/utility/log-viewer.ce.js +124 -0
- package/dist/vue/components/utility/notification-queue.ce.js +109 -0
- package/dist/vue/components/utility/progress-group.ce.js +59 -0
- package/dist/vue/components/utility/qr-code.ce.js +62 -0
- package/dist/vue/components/utility/tag-group.ce.js +124 -0
- package/dist/vue/components/utility/tour.ce.js +214 -0
- package/dist/vue/components/utility/virtual-select.ce.js +207 -0
- package/dist/vue/components/utility/watermark.ce.js +44 -0
- package/dist/vue/internal/menu-items.js +184 -0
- package/dist/vue/internal/navigation-items.js +110 -0
- package/dist/vue/utils/code-highlight.js +142 -0
- package/dist/vue/utils/config.js +47 -0
- package/dist/vue/utils/content-motion.js +37 -0
- package/dist/vue/utils/content.js +83 -0
- package/dist/vue/utils/display-status.js +31 -0
- package/dist/vue/utils/foundation.js +65 -0
- package/dist/vue/utils/input-state.js +38 -0
- package/dist/vue/utils/interaction.js +103 -0
- package/dist/vue/utils/local-date.js +48 -0
- package/dist/vue/utils/motion.js +80 -0
- package/dist/vue/utils/native-slots.js +30 -0
- package/dist/vue/utils/navigation.js +44 -0
- package/dist/vue/utils/notifications.js +60 -0
- package/dist/vue/utils/qr.js +20 -0
- package/dist/vue/utils/remote-options.js +65 -0
- package/dist/vue/utils/ripple.js +20 -0
- package/dist/vue/utils/scoped-slots.js +22 -0
- package/dist/vue/utils/shell.js +43 -0
- package/dist/vue/utils/theme.js +50 -0
- package/dist/vue/utils/utility-choice.js +56 -0
- package/package.json +105 -4
|
@@ -0,0 +1,1583 @@
|
|
|
1
|
+
// node_modules/.pnpm/@material+material-color-utilities@0.3.0/node_modules/@material/material-color-utilities/utils/math_utils.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e < 0 ? -1 : e === 0 ? 0 : 1;
|
|
4
|
+
}
|
|
5
|
+
function t(e, t, n) {
|
|
6
|
+
return (1 - n) * e + n * t;
|
|
7
|
+
}
|
|
8
|
+
function n(e, t, n) {
|
|
9
|
+
return n < e ? e : n > t ? t : n;
|
|
10
|
+
}
|
|
11
|
+
function r(e, t, n) {
|
|
12
|
+
return n < e ? e : n > t ? t : n;
|
|
13
|
+
}
|
|
14
|
+
function i(e) {
|
|
15
|
+
return e %= 360, e < 0 && (e += 360), e;
|
|
16
|
+
}
|
|
17
|
+
function a(e, t) {
|
|
18
|
+
return [
|
|
19
|
+
e[0] * t[0][0] + e[1] * t[0][1] + e[2] * t[0][2],
|
|
20
|
+
e[0] * t[1][0] + e[1] * t[1][1] + e[2] * t[1][2],
|
|
21
|
+
e[0] * t[2][0] + e[1] * t[2][1] + e[2] * t[2][2]
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
// node_modules/.pnpm/@material+material-color-utilities@0.3.0/node_modules/@material/material-color-utilities/utils/color_utils.js
|
|
25
|
+
var o = [
|
|
26
|
+
[
|
|
27
|
+
.41233895,
|
|
28
|
+
.35762064,
|
|
29
|
+
.18051042
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
.2126,
|
|
33
|
+
.7152,
|
|
34
|
+
.0722
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
.01932141,
|
|
38
|
+
.11916382,
|
|
39
|
+
.95034478
|
|
40
|
+
]
|
|
41
|
+
], s = [
|
|
42
|
+
[
|
|
43
|
+
3.2413774792388685,
|
|
44
|
+
-1.5376652402851851,
|
|
45
|
+
-.49885366846268053
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
-.9691452513005321,
|
|
49
|
+
1.8758853451067872,
|
|
50
|
+
.04156585616912061
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
.05562093689691305,
|
|
54
|
+
-.20395524564742123,
|
|
55
|
+
1.0571799111220335
|
|
56
|
+
]
|
|
57
|
+
], c = [
|
|
58
|
+
95.047,
|
|
59
|
+
100,
|
|
60
|
+
108.883
|
|
61
|
+
];
|
|
62
|
+
function l(e, t, n) {
|
|
63
|
+
return (255 << 24 | (e & 255) << 16 | (t & 255) << 8 | n & 255) >>> 0;
|
|
64
|
+
}
|
|
65
|
+
function u(e) {
|
|
66
|
+
return l(x(e[0]), x(e[1]), x(e[2]));
|
|
67
|
+
}
|
|
68
|
+
function d(e) {
|
|
69
|
+
return e >> 16 & 255;
|
|
70
|
+
}
|
|
71
|
+
function f(e) {
|
|
72
|
+
return e >> 8 & 255;
|
|
73
|
+
}
|
|
74
|
+
function p(e) {
|
|
75
|
+
return e & 255;
|
|
76
|
+
}
|
|
77
|
+
function m(e, t, n) {
|
|
78
|
+
let r = s, i = r[0][0] * e + r[0][1] * t + r[0][2] * n, a = r[1][0] * e + r[1][1] * t + r[1][2] * n, o = r[2][0] * e + r[2][1] * t + r[2][2] * n;
|
|
79
|
+
return l(x(i), x(a), x(o));
|
|
80
|
+
}
|
|
81
|
+
function h(e) {
|
|
82
|
+
return a([
|
|
83
|
+
b(d(e)),
|
|
84
|
+
b(f(e)),
|
|
85
|
+
b(p(e))
|
|
86
|
+
], o);
|
|
87
|
+
}
|
|
88
|
+
function g(e) {
|
|
89
|
+
let t = x(v(e));
|
|
90
|
+
return l(t, t, t);
|
|
91
|
+
}
|
|
92
|
+
function _(e) {
|
|
93
|
+
let t = h(e)[1];
|
|
94
|
+
return 116 * C(t / 100) - 16;
|
|
95
|
+
}
|
|
96
|
+
function v(e) {
|
|
97
|
+
return 100 * w((e + 16) / 116);
|
|
98
|
+
}
|
|
99
|
+
function y(e) {
|
|
100
|
+
return C(e / 100) * 116 - 16;
|
|
101
|
+
}
|
|
102
|
+
function b(e) {
|
|
103
|
+
let t = e / 255;
|
|
104
|
+
return t <= .040449936 ? t / 12.92 * 100 : ((t + .055) / 1.055) ** 2.4 * 100;
|
|
105
|
+
}
|
|
106
|
+
function x(e) {
|
|
107
|
+
let t = e / 100, r = 0;
|
|
108
|
+
return r = t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055, n(0, 255, Math.round(r * 255));
|
|
109
|
+
}
|
|
110
|
+
function S() {
|
|
111
|
+
return c;
|
|
112
|
+
}
|
|
113
|
+
function C(e) {
|
|
114
|
+
return e > .008856451679035631 ? e ** (1 / 3) : (903.2962962962963 * e + 16) / 116;
|
|
115
|
+
}
|
|
116
|
+
function w(e) {
|
|
117
|
+
let t = e * e * e;
|
|
118
|
+
return t > .008856451679035631 ? t : (116 * e - 16) / 903.2962962962963;
|
|
119
|
+
}
|
|
120
|
+
// node_modules/.pnpm/@material+material-color-utilities@0.3.0/node_modules/@material/material-color-utilities/hct/viewing_conditions.js
|
|
121
|
+
var T = class e {
|
|
122
|
+
static make(n = S(), r = 200 / Math.PI * v(50) / 100, i = 50, a = 2, o = !1) {
|
|
123
|
+
let s = n, c = s[0] * .401288 + s[1] * .650173 + s[2] * -.051461, l = s[0] * -.250268 + s[1] * 1.204414 + s[2] * .045854, u = s[0] * -.002079 + s[1] * .048952 + s[2] * .953127, d = .8 + a / 10, f = d >= .9 ? t(.59, .69, (d - .9) * 10) : t(.525, .59, (d - .8) * 10), p = o ? 1 : d * (1 - 1 / 3.6 * Math.exp((-r - 42) / 92));
|
|
124
|
+
p = p > 1 ? 1 : p < 0 ? 0 : p;
|
|
125
|
+
let m = d, h = [
|
|
126
|
+
100 / c * p + 1 - p,
|
|
127
|
+
100 / l * p + 1 - p,
|
|
128
|
+
100 / u * p + 1 - p
|
|
129
|
+
], g = 1 / (5 * r + 1), _ = g * g * g * g, y = 1 - _, b = _ * r + .1 * y * y * Math.cbrt(5 * r), x = v(i) / n[1], C = 1.48 + Math.sqrt(x), w = .725 / x ** .2, T = w, E = [
|
|
130
|
+
(b * h[0] * c / 100) ** .42,
|
|
131
|
+
(b * h[1] * l / 100) ** .42,
|
|
132
|
+
(b * h[2] * u / 100) ** .42
|
|
133
|
+
], D = [
|
|
134
|
+
400 * E[0] / (E[0] + 27.13),
|
|
135
|
+
400 * E[1] / (E[1] + 27.13),
|
|
136
|
+
400 * E[2] / (E[2] + 27.13)
|
|
137
|
+
], O = (2 * D[0] + D[1] + .05 * D[2]) * w;
|
|
138
|
+
return new e(x, O, w, T, f, m, h, b, b ** .25, C);
|
|
139
|
+
}
|
|
140
|
+
constructor(e, t, n, r, i, a, o, s, c, l) {
|
|
141
|
+
this.n = e, this.aw = t, this.nbb = n, this.ncb = r, this.c = i, this.nc = a, this.rgbD = o, this.fl = s, this.fLRoot = c, this.z = l;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
T.DEFAULT = T.make();
|
|
145
|
+
// node_modules/.pnpm/@material+material-color-utilities@0.3.0/node_modules/@material/material-color-utilities/hct/cam16.js
|
|
146
|
+
var E = class t {
|
|
147
|
+
constructor(e, t, n, r, i, a, o, s, c) {
|
|
148
|
+
this.hue = e, this.chroma = t, this.j = n, this.q = r, this.m = i, this.s = a, this.jstar = o, this.astar = s, this.bstar = c;
|
|
149
|
+
}
|
|
150
|
+
distance(e) {
|
|
151
|
+
let t = this.jstar - e.jstar, n = this.astar - e.astar, r = this.bstar - e.bstar;
|
|
152
|
+
return 1.41 * Math.sqrt(t * t + n * n + r * r) ** .63;
|
|
153
|
+
}
|
|
154
|
+
static fromInt(e) {
|
|
155
|
+
return t.fromIntInViewingConditions(e, T.DEFAULT);
|
|
156
|
+
}
|
|
157
|
+
static fromIntInViewingConditions(n, r) {
|
|
158
|
+
let i = (n & 16711680) >> 16, a = (n & 65280) >> 8, o = n & 255, s = b(i), c = b(a), l = b(o), u = .41233895 * s + .35762064 * c + .18051042 * l, d = .2126 * s + .7152 * c + .0722 * l, f = .01932141 * s + .11916382 * c + .95034478 * l, p = .401288 * u + .650173 * d - .051461 * f, m = -.250268 * u + 1.204414 * d + .045854 * f, h = -.002079 * u + .048952 * d + .953127 * f, g = r.rgbD[0] * p, _ = r.rgbD[1] * m, v = r.rgbD[2] * h, y = (r.fl * Math.abs(g) / 100) ** .42, x = (r.fl * Math.abs(_) / 100) ** .42, S = (r.fl * Math.abs(v) / 100) ** .42, C = e(g) * 400 * y / (y + 27.13), w = e(_) * 400 * x / (x + 27.13), T = e(v) * 400 * S / (S + 27.13), E = (11 * C + -12 * w + T) / 11, D = (C + w - 2 * T) / 9, O = (20 * C + 20 * w + 21 * T) / 20, k = (40 * C + 20 * w + T) / 20, A = Math.atan2(D, E) * 180 / Math.PI, j = A < 0 ? A + 360 : A >= 360 ? A - 360 : A, M = j * Math.PI / 180, N = 100 * (k * r.nbb / r.aw) ** +(r.c * r.z), P = 4 / r.c * Math.sqrt(N / 100) * (r.aw + 4) * r.fLRoot, F = j < 20.14 ? j + 360 : j, I = (5e4 / 13 * (.25 * (Math.cos(F * Math.PI / 180 + 2) + 3.8)) * r.nc * r.ncb * Math.sqrt(E * E + D * D) / (O + .305)) ** .9 * (1.64 - .29 ** r.n) ** .73, L = I * Math.sqrt(N / 100), R = L * r.fLRoot, z = 50 * Math.sqrt(I * r.c / (r.aw + 4)), B = (1 + 100 * .007) * N / (1 + .007 * N), V = 1 / .0228 * Math.log(1 + .0228 * R), H = V * Math.cos(M), U = V * Math.sin(M);
|
|
159
|
+
return new t(j, L, N, P, R, z, B, H, U);
|
|
160
|
+
}
|
|
161
|
+
static fromJch(e, n, r) {
|
|
162
|
+
return t.fromJchInViewingConditions(e, n, r, T.DEFAULT);
|
|
163
|
+
}
|
|
164
|
+
static fromJchInViewingConditions(e, n, r, i) {
|
|
165
|
+
let a = 4 / i.c * Math.sqrt(e / 100) * (i.aw + 4) * i.fLRoot, o = n * i.fLRoot, s = n / Math.sqrt(e / 100), c = 50 * Math.sqrt(s * i.c / (i.aw + 4)), l = r * Math.PI / 180, u = (1 + 100 * .007) * e / (1 + .007 * e), d = 1 / .0228 * Math.log(1 + .0228 * o), f = d * Math.cos(l), p = d * Math.sin(l);
|
|
166
|
+
return new t(r, n, e, a, o, c, u, f, p);
|
|
167
|
+
}
|
|
168
|
+
static fromUcs(e, n, r) {
|
|
169
|
+
return t.fromUcsInViewingConditions(e, n, r, T.DEFAULT);
|
|
170
|
+
}
|
|
171
|
+
static fromUcsInViewingConditions(e, n, r, i) {
|
|
172
|
+
let a = n, o = r, s = Math.sqrt(a * a + o * o), c = (Math.exp(s * .0228) - 1) / .0228 / i.fLRoot, l = 180 / Math.PI * Math.atan2(o, a);
|
|
173
|
+
l < 0 && (l += 360);
|
|
174
|
+
let u = e / (1 - (e - 100) * .007);
|
|
175
|
+
return t.fromJchInViewingConditions(u, c, l, i);
|
|
176
|
+
}
|
|
177
|
+
toInt() {
|
|
178
|
+
return this.viewed(T.DEFAULT);
|
|
179
|
+
}
|
|
180
|
+
viewed(t) {
|
|
181
|
+
let n = ((this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100)) / (1.64 - .29 ** t.n) ** .73) ** (1 / .9), r = this.hue * Math.PI / 180, i = .25 * (Math.cos(r + 2) + 3.8), a = t.aw * (this.j / 100) ** (1 / t.c / t.z), o = 5e4 / 13 * i * t.nc * t.ncb, s = a / t.nbb, c = Math.sin(r), l = Math.cos(r), u = 23 * (s + .305) * n / (23 * o + 11 * n * l + 108 * n * c), d = u * l, f = u * c, p = (460 * s + 451 * d + 288 * f) / 1403, h = (460 * s - 891 * d - 261 * f) / 1403, g = (460 * s - 220 * d - 6300 * f) / 1403, _ = Math.max(0, 27.13 * Math.abs(p) / (400 - Math.abs(p))), v = e(p) * (100 / t.fl) * _ ** (1 / .42), y = Math.max(0, 27.13 * Math.abs(h) / (400 - Math.abs(h))), b = e(h) * (100 / t.fl) * y ** (1 / .42), x = Math.max(0, 27.13 * Math.abs(g) / (400 - Math.abs(g))), S = e(g) * (100 / t.fl) * x ** (1 / .42), C = v / t.rgbD[0], w = b / t.rgbD[1], T = S / t.rgbD[2];
|
|
182
|
+
return m(1.86206786 * C - 1.01125463 * w + .14918677 * T, .38752654 * C + .62144744 * w - .00897398 * T, -.0158415 * C - .03412294 * w + 1.04996444 * T);
|
|
183
|
+
}
|
|
184
|
+
static fromXyzInViewingConditions(n, r, i, a) {
|
|
185
|
+
let o = .401288 * n + .650173 * r - .051461 * i, s = -.250268 * n + 1.204414 * r + .045854 * i, c = -.002079 * n + .048952 * r + .953127 * i, l = a.rgbD[0] * o, u = a.rgbD[1] * s, d = a.rgbD[2] * c, f = (a.fl * Math.abs(l) / 100) ** .42, p = (a.fl * Math.abs(u) / 100) ** .42, m = (a.fl * Math.abs(d) / 100) ** .42, h = e(l) * 400 * f / (f + 27.13), g = e(u) * 400 * p / (p + 27.13), _ = e(d) * 400 * m / (m + 27.13), v = (11 * h + -12 * g + _) / 11, y = (h + g - 2 * _) / 9, b = (20 * h + 20 * g + 21 * _) / 20, x = (40 * h + 20 * g + _) / 20, S = Math.atan2(y, v) * 180 / Math.PI, C = S < 0 ? S + 360 : S >= 360 ? S - 360 : S, w = C * Math.PI / 180, T = 100 * (x * a.nbb / a.aw) ** +(a.c * a.z), E = 4 / a.c * Math.sqrt(T / 100) * (a.aw + 4) * a.fLRoot, D = C < 20.14 ? C + 360 : C, O = (5e4 / 13 * (1 / 4 * (Math.cos(D * Math.PI / 180 + 2) + 3.8)) * a.nc * a.ncb * Math.sqrt(v * v + y * y) / (b + .305)) ** .9 * (1.64 - .29 ** a.n) ** .73, k = O * Math.sqrt(T / 100), A = k * a.fLRoot, j = 50 * Math.sqrt(O * a.c / (a.aw + 4)), M = (1 + 100 * .007) * T / (1 + .007 * T), N = Math.log(1 + .0228 * A) / .0228, P = N * Math.cos(w), F = N * Math.sin(w);
|
|
186
|
+
return new t(C, k, T, E, A, j, M, P, F);
|
|
187
|
+
}
|
|
188
|
+
xyzInViewingConditions(t) {
|
|
189
|
+
let n = ((this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100)) / (1.64 - .29 ** t.n) ** .73) ** (1 / .9), r = this.hue * Math.PI / 180, i = .25 * (Math.cos(r + 2) + 3.8), a = t.aw * (this.j / 100) ** (1 / t.c / t.z), o = 5e4 / 13 * i * t.nc * t.ncb, s = a / t.nbb, c = Math.sin(r), l = Math.cos(r), u = 23 * (s + .305) * n / (23 * o + 11 * n * l + 108 * n * c), d = u * l, f = u * c, p = (460 * s + 451 * d + 288 * f) / 1403, m = (460 * s - 891 * d - 261 * f) / 1403, h = (460 * s - 220 * d - 6300 * f) / 1403, g = Math.max(0, 27.13 * Math.abs(p) / (400 - Math.abs(p))), _ = e(p) * (100 / t.fl) * g ** (1 / .42), v = Math.max(0, 27.13 * Math.abs(m) / (400 - Math.abs(m))), y = e(m) * (100 / t.fl) * v ** (1 / .42), b = Math.max(0, 27.13 * Math.abs(h) / (400 - Math.abs(h))), x = e(h) * (100 / t.fl) * b ** (1 / .42), S = _ / t.rgbD[0], C = y / t.rgbD[1], w = x / t.rgbD[2];
|
|
190
|
+
return [
|
|
191
|
+
1.86206786 * S - 1.01125463 * C + .14918677 * w,
|
|
192
|
+
.38752654 * S + .62144744 * C - .00897398 * w,
|
|
193
|
+
-.0158415 * S - .03412294 * C + 1.04996444 * w
|
|
194
|
+
];
|
|
195
|
+
}
|
|
196
|
+
}, D = class t {
|
|
197
|
+
static sanitizeRadians(e) {
|
|
198
|
+
return (e + Math.PI * 8) % (Math.PI * 2);
|
|
199
|
+
}
|
|
200
|
+
static trueDelinearized(e) {
|
|
201
|
+
let t = e / 100, n = 0;
|
|
202
|
+
return n = t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055, n * 255;
|
|
203
|
+
}
|
|
204
|
+
static chromaticAdaptation(t) {
|
|
205
|
+
let n = Math.abs(t) ** .42;
|
|
206
|
+
return e(t) * 400 * n / (n + 27.13);
|
|
207
|
+
}
|
|
208
|
+
static hueOf(e) {
|
|
209
|
+
let n = a(e, t.SCALED_DISCOUNT_FROM_LINRGB), r = t.chromaticAdaptation(n[0]), i = t.chromaticAdaptation(n[1]), o = t.chromaticAdaptation(n[2]), s = (11 * r + -12 * i + o) / 11, c = (r + i - 2 * o) / 9;
|
|
210
|
+
return Math.atan2(c, s);
|
|
211
|
+
}
|
|
212
|
+
static areInCyclicOrder(e, n, r) {
|
|
213
|
+
return t.sanitizeRadians(n - e) < t.sanitizeRadians(r - e);
|
|
214
|
+
}
|
|
215
|
+
static intercept(e, t, n) {
|
|
216
|
+
return (t - e) / (n - e);
|
|
217
|
+
}
|
|
218
|
+
static lerpPoint(e, t, n) {
|
|
219
|
+
return [
|
|
220
|
+
e[0] + (n[0] - e[0]) * t,
|
|
221
|
+
e[1] + (n[1] - e[1]) * t,
|
|
222
|
+
e[2] + (n[2] - e[2]) * t
|
|
223
|
+
];
|
|
224
|
+
}
|
|
225
|
+
static setCoordinate(e, n, r, i) {
|
|
226
|
+
let a = t.intercept(e[i], n, r[i]);
|
|
227
|
+
return t.lerpPoint(e, a, r);
|
|
228
|
+
}
|
|
229
|
+
static isBounded(e) {
|
|
230
|
+
return 0 <= e && e <= 100;
|
|
231
|
+
}
|
|
232
|
+
static nthVertex(e, n) {
|
|
233
|
+
let r = t.Y_FROM_LINRGB[0], i = t.Y_FROM_LINRGB[1], a = t.Y_FROM_LINRGB[2], o = n % 4 <= 1 ? 0 : 100, s = n % 2 == 0 ? 0 : 100;
|
|
234
|
+
if (n < 4) {
|
|
235
|
+
let n = o, c = s, l = (e - n * i - c * a) / r;
|
|
236
|
+
return t.isBounded(l) ? [
|
|
237
|
+
l,
|
|
238
|
+
n,
|
|
239
|
+
c
|
|
240
|
+
] : [
|
|
241
|
+
-1,
|
|
242
|
+
-1,
|
|
243
|
+
-1
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
if (n < 8) {
|
|
247
|
+
let n = o, c = s, l = (e - c * r - n * a) / i;
|
|
248
|
+
return t.isBounded(l) ? [
|
|
249
|
+
c,
|
|
250
|
+
l,
|
|
251
|
+
n
|
|
252
|
+
] : [
|
|
253
|
+
-1,
|
|
254
|
+
-1,
|
|
255
|
+
-1
|
|
256
|
+
];
|
|
257
|
+
}
|
|
258
|
+
{
|
|
259
|
+
let n = o, c = s, l = (e - n * r - c * i) / a;
|
|
260
|
+
return t.isBounded(l) ? [
|
|
261
|
+
n,
|
|
262
|
+
c,
|
|
263
|
+
l
|
|
264
|
+
] : [
|
|
265
|
+
-1,
|
|
266
|
+
-1,
|
|
267
|
+
-1
|
|
268
|
+
];
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
static bisectToSegment(e, n) {
|
|
272
|
+
let r = [
|
|
273
|
+
-1,
|
|
274
|
+
-1,
|
|
275
|
+
-1
|
|
276
|
+
], i = r, a = 0, o = 0, s = !1, c = !0;
|
|
277
|
+
for (let l = 0; l < 12; l++) {
|
|
278
|
+
let u = t.nthVertex(e, l);
|
|
279
|
+
if (u[0] < 0) continue;
|
|
280
|
+
let d = t.hueOf(u);
|
|
281
|
+
s ? (c || t.areInCyclicOrder(a, d, o)) && (c = !1, t.areInCyclicOrder(a, n, d) ? (i = u, o = d) : (r = u, a = d)) : (r = u, i = u, a = d, o = d, s = !0);
|
|
282
|
+
}
|
|
283
|
+
return [r, i];
|
|
284
|
+
}
|
|
285
|
+
static midpoint(e, t) {
|
|
286
|
+
return [
|
|
287
|
+
(e[0] + t[0]) / 2,
|
|
288
|
+
(e[1] + t[1]) / 2,
|
|
289
|
+
(e[2] + t[2]) / 2
|
|
290
|
+
];
|
|
291
|
+
}
|
|
292
|
+
static criticalPlaneBelow(e) {
|
|
293
|
+
return Math.floor(e - .5);
|
|
294
|
+
}
|
|
295
|
+
static criticalPlaneAbove(e) {
|
|
296
|
+
return Math.ceil(e - .5);
|
|
297
|
+
}
|
|
298
|
+
static bisectToLimit(e, n) {
|
|
299
|
+
let r = t.bisectToSegment(e, n), i = r[0], a = t.hueOf(i), o = r[1];
|
|
300
|
+
for (let e = 0; e < 3; e++) if (i[e] !== o[e]) {
|
|
301
|
+
let r = -1, s = 255;
|
|
302
|
+
i[e] < o[e] ? (r = t.criticalPlaneBelow(t.trueDelinearized(i[e])), s = t.criticalPlaneAbove(t.trueDelinearized(o[e]))) : (r = t.criticalPlaneAbove(t.trueDelinearized(i[e])), s = t.criticalPlaneBelow(t.trueDelinearized(o[e])));
|
|
303
|
+
for (let c = 0; c < 8 && !(Math.abs(s - r) <= 1); c++) {
|
|
304
|
+
let c = Math.floor((r + s) / 2), l = t.CRITICAL_PLANES[c], u = t.setCoordinate(i, l, o, e), d = t.hueOf(u);
|
|
305
|
+
t.areInCyclicOrder(a, n, d) ? (o = u, s = c) : (i = u, a = d, r = c);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return t.midpoint(i, o);
|
|
309
|
+
}
|
|
310
|
+
static inverseChromaticAdaptation(t) {
|
|
311
|
+
let n = Math.abs(t), r = Math.max(0, 27.13 * n / (400 - n));
|
|
312
|
+
return e(t) * r ** (1 / .42);
|
|
313
|
+
}
|
|
314
|
+
static findResultByJ(e, n, r) {
|
|
315
|
+
let i = Math.sqrt(r) * 11, o = T.DEFAULT, s = 1 / (1.64 - .29 ** o.n) ** .73, c = .25 * (Math.cos(e + 2) + 3.8) * (5e4 / 13) * o.nc * o.ncb, l = Math.sin(e), d = Math.cos(e);
|
|
316
|
+
for (let e = 0; e < 5; e++) {
|
|
317
|
+
let f = i / 100, p = ((n === 0 || i === 0 ? 0 : n / Math.sqrt(f)) * s) ** (1 / .9), m = o.aw * f ** (1 / o.c / o.z) / o.nbb, h = 23 * (m + .305) * p / (23 * c + 11 * p * d + 108 * p * l), g = h * d, _ = h * l, v = (460 * m + 451 * g + 288 * _) / 1403, y = (460 * m - 891 * g - 261 * _) / 1403, b = (460 * m - 220 * g - 6300 * _) / 1403, x = a([
|
|
318
|
+
t.inverseChromaticAdaptation(v),
|
|
319
|
+
t.inverseChromaticAdaptation(y),
|
|
320
|
+
t.inverseChromaticAdaptation(b)
|
|
321
|
+
], t.LINRGB_FROM_SCALED_DISCOUNT);
|
|
322
|
+
if (x[0] < 0 || x[1] < 0 || x[2] < 0) return 0;
|
|
323
|
+
let S = t.Y_FROM_LINRGB[0], C = t.Y_FROM_LINRGB[1], w = t.Y_FROM_LINRGB[2], T = S * x[0] + C * x[1] + w * x[2];
|
|
324
|
+
if (T <= 0) return 0;
|
|
325
|
+
if (e === 4 || Math.abs(T - r) < .002) return x[0] > 100.01 || x[1] > 100.01 || x[2] > 100.01 ? 0 : u(x);
|
|
326
|
+
i -= (T - r) * i / (2 * T);
|
|
327
|
+
}
|
|
328
|
+
return 0;
|
|
329
|
+
}
|
|
330
|
+
static solveToInt(e, n, r) {
|
|
331
|
+
if (n < 1e-4 || r < 1e-4 || r > 99.9999) return g(r);
|
|
332
|
+
e = i(e);
|
|
333
|
+
let a = e / 180 * Math.PI, o = v(r), s = t.findResultByJ(a, n, o);
|
|
334
|
+
return s === 0 ? u(t.bisectToLimit(o, a)) : s;
|
|
335
|
+
}
|
|
336
|
+
static solveToCam(e, n, r) {
|
|
337
|
+
return E.fromInt(t.solveToInt(e, n, r));
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
D.SCALED_DISCOUNT_FROM_LINRGB = [
|
|
341
|
+
[
|
|
342
|
+
.001200833568784504,
|
|
343
|
+
.002389694492170889,
|
|
344
|
+
.0002795742885861124
|
|
345
|
+
],
|
|
346
|
+
[
|
|
347
|
+
.0005891086651375999,
|
|
348
|
+
.0029785502573438758,
|
|
349
|
+
.0003270666104008398
|
|
350
|
+
],
|
|
351
|
+
[
|
|
352
|
+
.00010146692491640572,
|
|
353
|
+
.0005364214359186694,
|
|
354
|
+
.0032979401770712076
|
|
355
|
+
]
|
|
356
|
+
], D.LINRGB_FROM_SCALED_DISCOUNT = [
|
|
357
|
+
[
|
|
358
|
+
1373.2198709594231,
|
|
359
|
+
-1100.4251190754821,
|
|
360
|
+
-7.278681089101213
|
|
361
|
+
],
|
|
362
|
+
[
|
|
363
|
+
-271.815969077903,
|
|
364
|
+
559.6580465940733,
|
|
365
|
+
-32.46047482791194
|
|
366
|
+
],
|
|
367
|
+
[
|
|
368
|
+
1.9622899599665666,
|
|
369
|
+
-57.173814538844006,
|
|
370
|
+
308.7233197812385
|
|
371
|
+
]
|
|
372
|
+
], D.Y_FROM_LINRGB = [
|
|
373
|
+
.2126,
|
|
374
|
+
.7152,
|
|
375
|
+
.0722
|
|
376
|
+
], D.CRITICAL_PLANES = [
|
|
377
|
+
.015176349177441876,
|
|
378
|
+
.045529047532325624,
|
|
379
|
+
.07588174588720938,
|
|
380
|
+
.10623444424209313,
|
|
381
|
+
.13658714259697685,
|
|
382
|
+
.16693984095186062,
|
|
383
|
+
.19729253930674434,
|
|
384
|
+
.2276452376616281,
|
|
385
|
+
.2579979360165119,
|
|
386
|
+
.28835063437139563,
|
|
387
|
+
.3188300904430532,
|
|
388
|
+
.350925934958123,
|
|
389
|
+
.3848314933096426,
|
|
390
|
+
.42057480301049466,
|
|
391
|
+
.458183274052838,
|
|
392
|
+
.4976837250274023,
|
|
393
|
+
.5391024159806381,
|
|
394
|
+
.5824650784040898,
|
|
395
|
+
.6277969426914107,
|
|
396
|
+
.6751227633498623,
|
|
397
|
+
.7244668422128921,
|
|
398
|
+
.775853049866786,
|
|
399
|
+
.829304845476233,
|
|
400
|
+
.8848452951698498,
|
|
401
|
+
.942497089126609,
|
|
402
|
+
1.0022825574869039,
|
|
403
|
+
1.0642236851973577,
|
|
404
|
+
1.1283421258858297,
|
|
405
|
+
1.1946592148522128,
|
|
406
|
+
1.2631959812511864,
|
|
407
|
+
1.3339731595349034,
|
|
408
|
+
1.407011200216447,
|
|
409
|
+
1.4823302800086415,
|
|
410
|
+
1.5599503113873272,
|
|
411
|
+
1.6398909516233677,
|
|
412
|
+
1.7221716113234105,
|
|
413
|
+
1.8068114625156377,
|
|
414
|
+
1.8938294463134073,
|
|
415
|
+
1.9832442801866852,
|
|
416
|
+
2.075074464868551,
|
|
417
|
+
2.1693382909216234,
|
|
418
|
+
2.2660538449872063,
|
|
419
|
+
2.36523901573795,
|
|
420
|
+
2.4669114995532007,
|
|
421
|
+
2.5710888059345764,
|
|
422
|
+
2.6777882626779785,
|
|
423
|
+
2.7870270208169257,
|
|
424
|
+
2.898822059350997,
|
|
425
|
+
3.0131901897720907,
|
|
426
|
+
3.1301480604002863,
|
|
427
|
+
3.2497121605402226,
|
|
428
|
+
3.3718988244681087,
|
|
429
|
+
3.4967242352587946,
|
|
430
|
+
3.624204428461639,
|
|
431
|
+
3.754355295633311,
|
|
432
|
+
3.887192587735158,
|
|
433
|
+
4.022731918402185,
|
|
434
|
+
4.160988767090289,
|
|
435
|
+
4.301978482107941,
|
|
436
|
+
4.445716283538092,
|
|
437
|
+
4.592217266055746,
|
|
438
|
+
4.741496401646282,
|
|
439
|
+
4.893568542229298,
|
|
440
|
+
5.048448422192488,
|
|
441
|
+
5.20615066083972,
|
|
442
|
+
5.3666897647573375,
|
|
443
|
+
5.5300801301023865,
|
|
444
|
+
5.696336044816294,
|
|
445
|
+
5.865471690767354,
|
|
446
|
+
6.037501145825082,
|
|
447
|
+
6.212438385869475,
|
|
448
|
+
6.390297286737924,
|
|
449
|
+
6.571091626112461,
|
|
450
|
+
6.7548350853498045,
|
|
451
|
+
6.941541251256611,
|
|
452
|
+
7.131223617812143,
|
|
453
|
+
7.323895587840543,
|
|
454
|
+
7.5195704746346665,
|
|
455
|
+
7.7182615035334345,
|
|
456
|
+
7.919981813454504,
|
|
457
|
+
8.124744458384042,
|
|
458
|
+
8.332562408825165,
|
|
459
|
+
8.543448553206703,
|
|
460
|
+
8.757415699253682,
|
|
461
|
+
8.974476575321063,
|
|
462
|
+
9.194643831691977,
|
|
463
|
+
9.417930041841839,
|
|
464
|
+
9.644347703669503,
|
|
465
|
+
9.873909240696694,
|
|
466
|
+
10.106627003236781,
|
|
467
|
+
10.342513269534024,
|
|
468
|
+
10.58158024687427,
|
|
469
|
+
10.8238400726681,
|
|
470
|
+
11.069304815507364,
|
|
471
|
+
11.317986476196008,
|
|
472
|
+
11.569896988756009,
|
|
473
|
+
11.825048221409341,
|
|
474
|
+
12.083451977536606,
|
|
475
|
+
12.345119996613247,
|
|
476
|
+
12.610063955123938,
|
|
477
|
+
12.878295467455942,
|
|
478
|
+
13.149826086772048,
|
|
479
|
+
13.42466730586372,
|
|
480
|
+
13.702830557985108,
|
|
481
|
+
13.984327217668513,
|
|
482
|
+
14.269168601521828,
|
|
483
|
+
14.55736596900856,
|
|
484
|
+
14.848930523210871,
|
|
485
|
+
15.143873411576273,
|
|
486
|
+
15.44220572664832,
|
|
487
|
+
15.743938506781891,
|
|
488
|
+
16.04908273684337,
|
|
489
|
+
16.35764934889634,
|
|
490
|
+
16.66964922287304,
|
|
491
|
+
16.985093187232053,
|
|
492
|
+
17.30399201960269,
|
|
493
|
+
17.62635644741625,
|
|
494
|
+
17.95219714852476,
|
|
495
|
+
18.281524751807332,
|
|
496
|
+
18.614349837764564,
|
|
497
|
+
18.95068293910138,
|
|
498
|
+
19.290534541298456,
|
|
499
|
+
19.633915083172692,
|
|
500
|
+
19.98083495742689,
|
|
501
|
+
20.331304511189067,
|
|
502
|
+
20.685334046541502,
|
|
503
|
+
21.042933821039977,
|
|
504
|
+
21.404114048223256,
|
|
505
|
+
21.76888489811322,
|
|
506
|
+
22.137256497705877,
|
|
507
|
+
22.50923893145328,
|
|
508
|
+
22.884842241736916,
|
|
509
|
+
23.264076429332462,
|
|
510
|
+
23.6469514538663,
|
|
511
|
+
24.033477234264016,
|
|
512
|
+
24.42366364919083,
|
|
513
|
+
24.817520537484558,
|
|
514
|
+
25.21505769858089,
|
|
515
|
+
25.61628489293138,
|
|
516
|
+
26.021211842414342,
|
|
517
|
+
26.429848230738664,
|
|
518
|
+
26.842203703840827,
|
|
519
|
+
27.258287870275353,
|
|
520
|
+
27.678110301598522,
|
|
521
|
+
28.10168053274597,
|
|
522
|
+
28.529008062403893,
|
|
523
|
+
28.96010235337422,
|
|
524
|
+
29.39497283293396,
|
|
525
|
+
29.83362889318845,
|
|
526
|
+
30.276079891419332,
|
|
527
|
+
30.722335150426627,
|
|
528
|
+
31.172403958865512,
|
|
529
|
+
31.62629557157785,
|
|
530
|
+
32.08401920991837,
|
|
531
|
+
32.54558406207592,
|
|
532
|
+
33.010999283389665,
|
|
533
|
+
33.4802739966603,
|
|
534
|
+
33.953417292456834,
|
|
535
|
+
34.430438229418264,
|
|
536
|
+
34.911345834551085,
|
|
537
|
+
35.39614910352207,
|
|
538
|
+
35.88485700094671,
|
|
539
|
+
36.37747846067349,
|
|
540
|
+
36.87402238606382,
|
|
541
|
+
37.37449765026789,
|
|
542
|
+
37.87891309649659,
|
|
543
|
+
38.38727753828926,
|
|
544
|
+
38.89959975977785,
|
|
545
|
+
39.41588851594697,
|
|
546
|
+
39.93615253289054,
|
|
547
|
+
40.460400508064545,
|
|
548
|
+
40.98864111053629,
|
|
549
|
+
41.520882981230194,
|
|
550
|
+
42.05713473317016,
|
|
551
|
+
42.597404951718396,
|
|
552
|
+
43.141702194811224,
|
|
553
|
+
43.6900349931913,
|
|
554
|
+
44.24241185063697,
|
|
555
|
+
44.798841244188324,
|
|
556
|
+
45.35933162437017,
|
|
557
|
+
45.92389141541209,
|
|
558
|
+
46.49252901546552,
|
|
559
|
+
47.065252796817916,
|
|
560
|
+
47.64207110610409,
|
|
561
|
+
48.22299226451468,
|
|
562
|
+
48.808024568002054,
|
|
563
|
+
49.3971762874833,
|
|
564
|
+
49.9904556690408,
|
|
565
|
+
50.587870934119984,
|
|
566
|
+
51.189430279724725,
|
|
567
|
+
51.79514187861014,
|
|
568
|
+
52.40501387947288,
|
|
569
|
+
53.0190544071392,
|
|
570
|
+
53.637271562750364,
|
|
571
|
+
54.259673423945976,
|
|
572
|
+
54.88626804504493,
|
|
573
|
+
55.517063457223934,
|
|
574
|
+
56.15206766869424,
|
|
575
|
+
56.79128866487574,
|
|
576
|
+
57.43473440856916,
|
|
577
|
+
58.08241284012621,
|
|
578
|
+
58.734331877617365,
|
|
579
|
+
59.39049941699807,
|
|
580
|
+
60.05092333227251,
|
|
581
|
+
60.715611475655585,
|
|
582
|
+
61.38457167773311,
|
|
583
|
+
62.057811747619894,
|
|
584
|
+
62.7353394731159,
|
|
585
|
+
63.417162620860914,
|
|
586
|
+
64.10328893648692,
|
|
587
|
+
64.79372614476921,
|
|
588
|
+
65.48848194977529,
|
|
589
|
+
66.18756403501224,
|
|
590
|
+
66.89098006357258,
|
|
591
|
+
67.59873767827808,
|
|
592
|
+
68.31084450182222,
|
|
593
|
+
69.02730813691093,
|
|
594
|
+
69.74813616640164,
|
|
595
|
+
70.47333615344107,
|
|
596
|
+
71.20291564160104,
|
|
597
|
+
71.93688215501312,
|
|
598
|
+
72.67524319850172,
|
|
599
|
+
73.41800625771542,
|
|
600
|
+
74.16517879925733,
|
|
601
|
+
74.9167682708136,
|
|
602
|
+
75.67278210128072,
|
|
603
|
+
76.43322770089146,
|
|
604
|
+
77.1981124613393,
|
|
605
|
+
77.96744375590167,
|
|
606
|
+
78.74122893956174,
|
|
607
|
+
79.51947534912904,
|
|
608
|
+
80.30219030335869,
|
|
609
|
+
81.08938110306934,
|
|
610
|
+
81.88105503125999,
|
|
611
|
+
82.67721935322541,
|
|
612
|
+
83.4778813166706,
|
|
613
|
+
84.28304815182372,
|
|
614
|
+
85.09272707154808,
|
|
615
|
+
85.90692527145302,
|
|
616
|
+
86.72564993000343,
|
|
617
|
+
87.54890820862819,
|
|
618
|
+
88.3767072518277,
|
|
619
|
+
89.2090541872801,
|
|
620
|
+
90.04595612594655,
|
|
621
|
+
90.88742016217518,
|
|
622
|
+
91.73345337380438,
|
|
623
|
+
92.58406282226491,
|
|
624
|
+
93.43925555268066,
|
|
625
|
+
94.29903859396902,
|
|
626
|
+
95.16341895893969,
|
|
627
|
+
96.03240364439274,
|
|
628
|
+
96.9059996312159,
|
|
629
|
+
97.78421388448044,
|
|
630
|
+
98.6670533535366,
|
|
631
|
+
99.55452497210776
|
|
632
|
+
];
|
|
633
|
+
// node_modules/.pnpm/@material+material-color-utilities@0.3.0/node_modules/@material/material-color-utilities/hct/hct.js
|
|
634
|
+
var O = class e {
|
|
635
|
+
static from(t, n, r) {
|
|
636
|
+
return new e(D.solveToInt(t, n, r));
|
|
637
|
+
}
|
|
638
|
+
static fromInt(t) {
|
|
639
|
+
return new e(t);
|
|
640
|
+
}
|
|
641
|
+
toInt() {
|
|
642
|
+
return this.argb;
|
|
643
|
+
}
|
|
644
|
+
get hue() {
|
|
645
|
+
return this.internalHue;
|
|
646
|
+
}
|
|
647
|
+
set hue(e) {
|
|
648
|
+
this.setInternalState(D.solveToInt(e, this.internalChroma, this.internalTone));
|
|
649
|
+
}
|
|
650
|
+
get chroma() {
|
|
651
|
+
return this.internalChroma;
|
|
652
|
+
}
|
|
653
|
+
set chroma(e) {
|
|
654
|
+
this.setInternalState(D.solveToInt(this.internalHue, e, this.internalTone));
|
|
655
|
+
}
|
|
656
|
+
get tone() {
|
|
657
|
+
return this.internalTone;
|
|
658
|
+
}
|
|
659
|
+
set tone(e) {
|
|
660
|
+
this.setInternalState(D.solveToInt(this.internalHue, this.internalChroma, e));
|
|
661
|
+
}
|
|
662
|
+
constructor(e) {
|
|
663
|
+
this.argb = e;
|
|
664
|
+
let t = E.fromInt(e);
|
|
665
|
+
this.internalHue = t.hue, this.internalChroma = t.chroma, this.internalTone = _(e), this.argb = e;
|
|
666
|
+
}
|
|
667
|
+
setInternalState(e) {
|
|
668
|
+
let t = E.fromInt(e);
|
|
669
|
+
this.internalHue = t.hue, this.internalChroma = t.chroma, this.internalTone = _(e), this.argb = e;
|
|
670
|
+
}
|
|
671
|
+
inViewingConditions(t) {
|
|
672
|
+
let n = E.fromInt(this.toInt()).xyzInViewingConditions(t), r = E.fromXyzInViewingConditions(n[0], n[1], n[2], T.make());
|
|
673
|
+
return e.from(r.hue, r.chroma, y(n[1]));
|
|
674
|
+
}
|
|
675
|
+
}, k = class e {
|
|
676
|
+
static ratioOfTones(t, n) {
|
|
677
|
+
return t = r(0, 100, t), n = r(0, 100, n), e.ratioOfYs(v(t), v(n));
|
|
678
|
+
}
|
|
679
|
+
static ratioOfYs(e, t) {
|
|
680
|
+
let n = e > t ? e : t, r = n === t ? e : t;
|
|
681
|
+
return (n + 5) / (r + 5);
|
|
682
|
+
}
|
|
683
|
+
static lighter(t, n) {
|
|
684
|
+
if (t < 0 || t > 100) return -1;
|
|
685
|
+
let r = v(t), i = n * (r + 5) - 5, a = e.ratioOfYs(i, r), o = Math.abs(a - n);
|
|
686
|
+
if (a < n && o > .04) return -1;
|
|
687
|
+
let s = y(i) + .4;
|
|
688
|
+
return s < 0 || s > 100 ? -1 : s;
|
|
689
|
+
}
|
|
690
|
+
static darker(t, n) {
|
|
691
|
+
if (t < 0 || t > 100) return -1;
|
|
692
|
+
let r = v(t), i = (r + 5) / n - 5, a = e.ratioOfYs(r, i), o = Math.abs(a - n);
|
|
693
|
+
if (a < n && o > .04) return -1;
|
|
694
|
+
let s = y(i) - .4;
|
|
695
|
+
return s < 0 || s > 100 ? -1 : s;
|
|
696
|
+
}
|
|
697
|
+
static lighterUnsafe(t, n) {
|
|
698
|
+
let r = e.lighter(t, n);
|
|
699
|
+
return r < 0 ? 100 : r;
|
|
700
|
+
}
|
|
701
|
+
static darkerUnsafe(t, n) {
|
|
702
|
+
let r = e.darker(t, n);
|
|
703
|
+
return r < 0 ? 0 : r;
|
|
704
|
+
}
|
|
705
|
+
}, A = class e {
|
|
706
|
+
static isDisliked(e) {
|
|
707
|
+
let t = Math.round(e.hue) >= 90 && Math.round(e.hue) <= 111, n = Math.round(e.chroma) > 16, r = Math.round(e.tone) < 65;
|
|
708
|
+
return t && n && r;
|
|
709
|
+
}
|
|
710
|
+
static fixIfDisliked(t) {
|
|
711
|
+
return e.isDisliked(t) ? O.from(t.hue, t.chroma, 70) : t;
|
|
712
|
+
}
|
|
713
|
+
}, j = class e {
|
|
714
|
+
static fromPalette(t) {
|
|
715
|
+
return new e(t.name ?? "", t.palette, t.tone, t.isBackground ?? !1, t.background, t.secondBackground, t.contrastCurve, t.toneDeltaPair);
|
|
716
|
+
}
|
|
717
|
+
constructor(e, t, n, r, i, a, o, s) {
|
|
718
|
+
if (this.name = e, this.palette = t, this.tone = n, this.isBackground = r, this.background = i, this.secondBackground = a, this.contrastCurve = o, this.toneDeltaPair = s, this.hctCache = /* @__PURE__ */ new Map(), !i && a) throw Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);
|
|
719
|
+
if (!i && o) throw Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);
|
|
720
|
+
if (i && !o) throw Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`);
|
|
721
|
+
}
|
|
722
|
+
getArgb(e) {
|
|
723
|
+
return this.getHct(e).toInt();
|
|
724
|
+
}
|
|
725
|
+
getHct(e) {
|
|
726
|
+
let t = this.hctCache.get(e);
|
|
727
|
+
if (t != null) return t;
|
|
728
|
+
let n = this.getTone(e), r = this.palette(e).getHct(n);
|
|
729
|
+
return this.hctCache.size > 4 && this.hctCache.clear(), this.hctCache.set(e, r), r;
|
|
730
|
+
}
|
|
731
|
+
getTone(t) {
|
|
732
|
+
let n = t.contrastLevel < 0;
|
|
733
|
+
if (this.toneDeltaPair) {
|
|
734
|
+
let i = this.toneDeltaPair(t), a = i.roleA, o = i.roleB, s = i.delta, c = i.polarity, l = i.stayTogether, u = this.background(t).getTone(t), d = c === "nearer" || c === "lighter" && !t.isDark || c === "darker" && t.isDark, f = d ? a : o, p = d ? o : a, m = this.name === f.name, h = t.isDark ? 1 : -1, g = f.contrastCurve.get(t.contrastLevel), _ = p.contrastCurve.get(t.contrastLevel), v = f.tone(t), y = k.ratioOfTones(u, v) >= g ? v : e.foregroundTone(u, g), b = p.tone(t), x = k.ratioOfTones(u, b) >= _ ? b : e.foregroundTone(u, _);
|
|
735
|
+
return n && (y = e.foregroundTone(u, g), x = e.foregroundTone(u, _)), (x - y) * h >= s || (x = r(0, 100, y + s * h), (x - y) * h >= s || (y = r(0, 100, x - s * h))), 50 <= y && y < 60 ? h > 0 ? (y = 60, x = Math.max(x, y + s * h)) : (y = 49, x = Math.min(x, y + s * h)) : 50 <= x && x < 60 && (l ? h > 0 ? (y = 60, x = Math.max(x, y + s * h)) : (y = 49, x = Math.min(x, y + s * h)) : x = h > 0 ? 60 : 49), m ? y : x;
|
|
736
|
+
}
|
|
737
|
+
{
|
|
738
|
+
let r = this.tone(t);
|
|
739
|
+
if (this.background == null) return r;
|
|
740
|
+
let i = this.background(t).getTone(t), a = this.contrastCurve.get(t.contrastLevel);
|
|
741
|
+
if (k.ratioOfTones(i, r) >= a || (r = e.foregroundTone(i, a)), n && (r = e.foregroundTone(i, a)), this.isBackground && 50 <= r && r < 60 && (r = k.ratioOfTones(49, i) >= a ? 49 : 60), this.secondBackground) {
|
|
742
|
+
let [n, i] = [this.background, this.secondBackground], [o, s] = [n(t).getTone(t), i(t).getTone(t)], [c, l] = [Math.max(o, s), Math.min(o, s)];
|
|
743
|
+
if (k.ratioOfTones(c, r) >= a && k.ratioOfTones(l, r) >= a) return r;
|
|
744
|
+
let u = k.lighter(c, a), d = k.darker(l, a), f = [];
|
|
745
|
+
return u !== -1 && f.push(u), d !== -1 && f.push(d), e.tonePrefersLightForeground(o) || e.tonePrefersLightForeground(s) ? u < 0 ? 100 : u : f.length === 1 ? f[0] : d < 0 ? 0 : d;
|
|
746
|
+
}
|
|
747
|
+
return r;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
static foregroundTone(t, n) {
|
|
751
|
+
let r = k.lighterUnsafe(t, n), i = k.darkerUnsafe(t, n), a = k.ratioOfTones(r, t), o = k.ratioOfTones(i, t);
|
|
752
|
+
if (e.tonePrefersLightForeground(t)) {
|
|
753
|
+
let e = Math.abs(a - o) < .1 && a < n && o < n;
|
|
754
|
+
return a >= n || a >= o || e ? r : i;
|
|
755
|
+
}
|
|
756
|
+
return o >= n || o >= a ? i : r;
|
|
757
|
+
}
|
|
758
|
+
static tonePrefersLightForeground(e) {
|
|
759
|
+
return Math.round(e) < 60;
|
|
760
|
+
}
|
|
761
|
+
static toneAllowsLightForeground(e) {
|
|
762
|
+
return Math.round(e) <= 49;
|
|
763
|
+
}
|
|
764
|
+
static enableLightForeground(t) {
|
|
765
|
+
return e.tonePrefersLightForeground(t) && !e.toneAllowsLightForeground(t) ? 49 : t;
|
|
766
|
+
}
|
|
767
|
+
}, M = class e {
|
|
768
|
+
static fromInt(t) {
|
|
769
|
+
let n = O.fromInt(t);
|
|
770
|
+
return e.fromHct(n);
|
|
771
|
+
}
|
|
772
|
+
static fromHct(t) {
|
|
773
|
+
return new e(t.hue, t.chroma, t);
|
|
774
|
+
}
|
|
775
|
+
static fromHueAndChroma(t, n) {
|
|
776
|
+
let r = new N(t, n).create();
|
|
777
|
+
return new e(t, n, r);
|
|
778
|
+
}
|
|
779
|
+
constructor(e, t, n) {
|
|
780
|
+
this.hue = e, this.chroma = t, this.keyColor = n, this.cache = /* @__PURE__ */ new Map();
|
|
781
|
+
}
|
|
782
|
+
tone(e) {
|
|
783
|
+
let t = this.cache.get(e);
|
|
784
|
+
return t === void 0 && (t = O.from(this.hue, this.chroma, e).toInt(), this.cache.set(e, t)), t;
|
|
785
|
+
}
|
|
786
|
+
getHct(e) {
|
|
787
|
+
return O.fromInt(this.tone(e));
|
|
788
|
+
}
|
|
789
|
+
}, N = class {
|
|
790
|
+
constructor(e, t) {
|
|
791
|
+
this.hue = e, this.requestedChroma = t, this.chromaCache = /* @__PURE__ */ new Map(), this.maxChromaValue = 200;
|
|
792
|
+
}
|
|
793
|
+
create() {
|
|
794
|
+
let e = 0, t = 100;
|
|
795
|
+
for (; e < t;) {
|
|
796
|
+
let n = Math.floor((e + t) / 2), r = this.maxChroma(n) < this.maxChroma(n + 1);
|
|
797
|
+
if (this.maxChroma(n) >= this.requestedChroma - .01) {
|
|
798
|
+
if (Math.abs(e - 50) < Math.abs(t - 50)) t = n;
|
|
799
|
+
else {
|
|
800
|
+
if (e === n) return O.from(this.hue, this.requestedChroma, e);
|
|
801
|
+
e = n;
|
|
802
|
+
}
|
|
803
|
+
} else r ? e = n + 1 : t = n;
|
|
804
|
+
}
|
|
805
|
+
return O.from(this.hue, this.requestedChroma, e);
|
|
806
|
+
}
|
|
807
|
+
maxChroma(e) {
|
|
808
|
+
if (this.chromaCache.has(e)) return this.chromaCache.get(e);
|
|
809
|
+
let t = O.from(this.hue, this.maxChromaValue, e).chroma;
|
|
810
|
+
return this.chromaCache.set(e, t), t;
|
|
811
|
+
}
|
|
812
|
+
}, P = class {
|
|
813
|
+
constructor(e, t, n, r) {
|
|
814
|
+
this.low = e, this.normal = t, this.medium = n, this.high = r;
|
|
815
|
+
}
|
|
816
|
+
get(e) {
|
|
817
|
+
return e <= -1 ? this.low : e < 0 ? t(this.low, this.normal, (e - -1) / 1) : e < .5 ? t(this.normal, this.medium, (e - 0) / .5) : e < 1 ? t(this.medium, this.high, (e - .5) / .5) : this.high;
|
|
818
|
+
}
|
|
819
|
+
}, F = class {
|
|
820
|
+
constructor(e, t, n, r, i) {
|
|
821
|
+
this.roleA = e, this.roleB = t, this.delta = n, this.polarity = r, this.stayTogether = i;
|
|
822
|
+
}
|
|
823
|
+
}, I;
|
|
824
|
+
(function(e) {
|
|
825
|
+
e[e.MONOCHROME = 0] = "MONOCHROME", e[e.NEUTRAL = 1] = "NEUTRAL", e[e.TONAL_SPOT = 2] = "TONAL_SPOT", e[e.VIBRANT = 3] = "VIBRANT", e[e.EXPRESSIVE = 4] = "EXPRESSIVE", e[e.FIDELITY = 5] = "FIDELITY", e[e.CONTENT = 6] = "CONTENT", e[e.RAINBOW = 7] = "RAINBOW", e[e.FRUIT_SALAD = 8] = "FRUIT_SALAD";
|
|
826
|
+
})(I ||= {});
|
|
827
|
+
// node_modules/.pnpm/@material+material-color-utilities@0.3.0/node_modules/@material/material-color-utilities/dynamiccolor/material_dynamic_colors.js
|
|
828
|
+
function L(e) {
|
|
829
|
+
return e.variant === I.FIDELITY || e.variant === I.CONTENT;
|
|
830
|
+
}
|
|
831
|
+
function R(e) {
|
|
832
|
+
return e.variant === I.MONOCHROME;
|
|
833
|
+
}
|
|
834
|
+
function z(e, t, n, r) {
|
|
835
|
+
let i = n, a = O.from(e, t, n);
|
|
836
|
+
if (a.chroma < t) {
|
|
837
|
+
let n = a.chroma;
|
|
838
|
+
for (; a.chroma < t;) {
|
|
839
|
+
i += r ? -1 : 1;
|
|
840
|
+
let o = O.from(e, t, i);
|
|
841
|
+
if (n > o.chroma || Math.abs(o.chroma - t) < .4) break;
|
|
842
|
+
Math.abs(o.chroma - t) < Math.abs(a.chroma - t) && (a = o), n = Math.max(n, o.chroma);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
return i;
|
|
846
|
+
}
|
|
847
|
+
var B = class e {
|
|
848
|
+
static highestSurface(t) {
|
|
849
|
+
return t.isDark ? e.surfaceBright : e.surfaceDim;
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
B.contentAccentToneDelta = 15, B.primaryPaletteKeyColor = j.fromPalette({
|
|
853
|
+
name: "primary_palette_key_color",
|
|
854
|
+
palette: (e) => e.primaryPalette,
|
|
855
|
+
tone: (e) => e.primaryPalette.keyColor.tone
|
|
856
|
+
}), B.secondaryPaletteKeyColor = j.fromPalette({
|
|
857
|
+
name: "secondary_palette_key_color",
|
|
858
|
+
palette: (e) => e.secondaryPalette,
|
|
859
|
+
tone: (e) => e.secondaryPalette.keyColor.tone
|
|
860
|
+
}), B.tertiaryPaletteKeyColor = j.fromPalette({
|
|
861
|
+
name: "tertiary_palette_key_color",
|
|
862
|
+
palette: (e) => e.tertiaryPalette,
|
|
863
|
+
tone: (e) => e.tertiaryPalette.keyColor.tone
|
|
864
|
+
}), B.neutralPaletteKeyColor = j.fromPalette({
|
|
865
|
+
name: "neutral_palette_key_color",
|
|
866
|
+
palette: (e) => e.neutralPalette,
|
|
867
|
+
tone: (e) => e.neutralPalette.keyColor.tone
|
|
868
|
+
}), B.neutralVariantPaletteKeyColor = j.fromPalette({
|
|
869
|
+
name: "neutral_variant_palette_key_color",
|
|
870
|
+
palette: (e) => e.neutralVariantPalette,
|
|
871
|
+
tone: (e) => e.neutralVariantPalette.keyColor.tone
|
|
872
|
+
}), B.background = j.fromPalette({
|
|
873
|
+
name: "background",
|
|
874
|
+
palette: (e) => e.neutralPalette,
|
|
875
|
+
tone: (e) => e.isDark ? 6 : 98,
|
|
876
|
+
isBackground: !0
|
|
877
|
+
}), B.onBackground = j.fromPalette({
|
|
878
|
+
name: "on_background",
|
|
879
|
+
palette: (e) => e.neutralPalette,
|
|
880
|
+
tone: (e) => e.isDark ? 90 : 10,
|
|
881
|
+
background: (e) => B.background,
|
|
882
|
+
contrastCurve: new P(3, 3, 4.5, 7)
|
|
883
|
+
}), B.surface = j.fromPalette({
|
|
884
|
+
name: "surface",
|
|
885
|
+
palette: (e) => e.neutralPalette,
|
|
886
|
+
tone: (e) => e.isDark ? 6 : 98,
|
|
887
|
+
isBackground: !0
|
|
888
|
+
}), B.surfaceDim = j.fromPalette({
|
|
889
|
+
name: "surface_dim",
|
|
890
|
+
palette: (e) => e.neutralPalette,
|
|
891
|
+
tone: (e) => e.isDark ? 6 : new P(87, 87, 80, 75).get(e.contrastLevel),
|
|
892
|
+
isBackground: !0
|
|
893
|
+
}), B.surfaceBright = j.fromPalette({
|
|
894
|
+
name: "surface_bright",
|
|
895
|
+
palette: (e) => e.neutralPalette,
|
|
896
|
+
tone: (e) => e.isDark ? new P(24, 24, 29, 34).get(e.contrastLevel) : 98,
|
|
897
|
+
isBackground: !0
|
|
898
|
+
}), B.surfaceContainerLowest = j.fromPalette({
|
|
899
|
+
name: "surface_container_lowest",
|
|
900
|
+
palette: (e) => e.neutralPalette,
|
|
901
|
+
tone: (e) => e.isDark ? new P(4, 4, 2, 0).get(e.contrastLevel) : 100,
|
|
902
|
+
isBackground: !0
|
|
903
|
+
}), B.surfaceContainerLow = j.fromPalette({
|
|
904
|
+
name: "surface_container_low",
|
|
905
|
+
palette: (e) => e.neutralPalette,
|
|
906
|
+
tone: (e) => e.isDark ? new P(10, 10, 11, 12).get(e.contrastLevel) : new P(96, 96, 96, 95).get(e.contrastLevel),
|
|
907
|
+
isBackground: !0
|
|
908
|
+
}), B.surfaceContainer = j.fromPalette({
|
|
909
|
+
name: "surface_container",
|
|
910
|
+
palette: (e) => e.neutralPalette,
|
|
911
|
+
tone: (e) => e.isDark ? new P(12, 12, 16, 20).get(e.contrastLevel) : new P(94, 94, 92, 90).get(e.contrastLevel),
|
|
912
|
+
isBackground: !0
|
|
913
|
+
}), B.surfaceContainerHigh = j.fromPalette({
|
|
914
|
+
name: "surface_container_high",
|
|
915
|
+
palette: (e) => e.neutralPalette,
|
|
916
|
+
tone: (e) => e.isDark ? new P(17, 17, 21, 25).get(e.contrastLevel) : new P(92, 92, 88, 85).get(e.contrastLevel),
|
|
917
|
+
isBackground: !0
|
|
918
|
+
}), B.surfaceContainerHighest = j.fromPalette({
|
|
919
|
+
name: "surface_container_highest",
|
|
920
|
+
palette: (e) => e.neutralPalette,
|
|
921
|
+
tone: (e) => e.isDark ? new P(22, 22, 26, 30).get(e.contrastLevel) : new P(90, 90, 84, 80).get(e.contrastLevel),
|
|
922
|
+
isBackground: !0
|
|
923
|
+
}), B.onSurface = j.fromPalette({
|
|
924
|
+
name: "on_surface",
|
|
925
|
+
palette: (e) => e.neutralPalette,
|
|
926
|
+
tone: (e) => e.isDark ? 90 : 10,
|
|
927
|
+
background: (e) => B.highestSurface(e),
|
|
928
|
+
contrastCurve: new P(4.5, 7, 11, 21)
|
|
929
|
+
}), B.surfaceVariant = j.fromPalette({
|
|
930
|
+
name: "surface_variant",
|
|
931
|
+
palette: (e) => e.neutralVariantPalette,
|
|
932
|
+
tone: (e) => e.isDark ? 30 : 90,
|
|
933
|
+
isBackground: !0
|
|
934
|
+
}), B.onSurfaceVariant = j.fromPalette({
|
|
935
|
+
name: "on_surface_variant",
|
|
936
|
+
palette: (e) => e.neutralVariantPalette,
|
|
937
|
+
tone: (e) => e.isDark ? 80 : 30,
|
|
938
|
+
background: (e) => B.highestSurface(e),
|
|
939
|
+
contrastCurve: new P(3, 4.5, 7, 11)
|
|
940
|
+
}), B.inverseSurface = j.fromPalette({
|
|
941
|
+
name: "inverse_surface",
|
|
942
|
+
palette: (e) => e.neutralPalette,
|
|
943
|
+
tone: (e) => e.isDark ? 90 : 20
|
|
944
|
+
}), B.inverseOnSurface = j.fromPalette({
|
|
945
|
+
name: "inverse_on_surface",
|
|
946
|
+
palette: (e) => e.neutralPalette,
|
|
947
|
+
tone: (e) => e.isDark ? 20 : 95,
|
|
948
|
+
background: (e) => B.inverseSurface,
|
|
949
|
+
contrastCurve: new P(4.5, 7, 11, 21)
|
|
950
|
+
}), B.outline = j.fromPalette({
|
|
951
|
+
name: "outline",
|
|
952
|
+
palette: (e) => e.neutralVariantPalette,
|
|
953
|
+
tone: (e) => e.isDark ? 60 : 50,
|
|
954
|
+
background: (e) => B.highestSurface(e),
|
|
955
|
+
contrastCurve: new P(1.5, 3, 4.5, 7)
|
|
956
|
+
}), B.outlineVariant = j.fromPalette({
|
|
957
|
+
name: "outline_variant",
|
|
958
|
+
palette: (e) => e.neutralVariantPalette,
|
|
959
|
+
tone: (e) => e.isDark ? 30 : 80,
|
|
960
|
+
background: (e) => B.highestSurface(e),
|
|
961
|
+
contrastCurve: new P(1, 1, 3, 4.5)
|
|
962
|
+
}), B.shadow = j.fromPalette({
|
|
963
|
+
name: "shadow",
|
|
964
|
+
palette: (e) => e.neutralPalette,
|
|
965
|
+
tone: (e) => 0
|
|
966
|
+
}), B.scrim = j.fromPalette({
|
|
967
|
+
name: "scrim",
|
|
968
|
+
palette: (e) => e.neutralPalette,
|
|
969
|
+
tone: (e) => 0
|
|
970
|
+
}), B.surfaceTint = j.fromPalette({
|
|
971
|
+
name: "surface_tint",
|
|
972
|
+
palette: (e) => e.primaryPalette,
|
|
973
|
+
tone: (e) => e.isDark ? 80 : 40,
|
|
974
|
+
isBackground: !0
|
|
975
|
+
}), B.primary = j.fromPalette({
|
|
976
|
+
name: "primary",
|
|
977
|
+
palette: (e) => e.primaryPalette,
|
|
978
|
+
tone: (e) => R(e) ? e.isDark ? 100 : 0 : e.isDark ? 80 : 40,
|
|
979
|
+
isBackground: !0,
|
|
980
|
+
background: (e) => B.highestSurface(e),
|
|
981
|
+
contrastCurve: new P(3, 4.5, 7, 7),
|
|
982
|
+
toneDeltaPair: (e) => new F(B.primaryContainer, B.primary, 10, "nearer", !1)
|
|
983
|
+
}), B.onPrimary = j.fromPalette({
|
|
984
|
+
name: "on_primary",
|
|
985
|
+
palette: (e) => e.primaryPalette,
|
|
986
|
+
tone: (e) => R(e) ? e.isDark ? 10 : 90 : e.isDark ? 20 : 100,
|
|
987
|
+
background: (e) => B.primary,
|
|
988
|
+
contrastCurve: new P(4.5, 7, 11, 21)
|
|
989
|
+
}), B.primaryContainer = j.fromPalette({
|
|
990
|
+
name: "primary_container",
|
|
991
|
+
palette: (e) => e.primaryPalette,
|
|
992
|
+
tone: (e) => L(e) ? e.sourceColorHct.tone : R(e) ? e.isDark ? 85 : 25 : e.isDark ? 30 : 90,
|
|
993
|
+
isBackground: !0,
|
|
994
|
+
background: (e) => B.highestSurface(e),
|
|
995
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
996
|
+
toneDeltaPair: (e) => new F(B.primaryContainer, B.primary, 10, "nearer", !1)
|
|
997
|
+
}), B.onPrimaryContainer = j.fromPalette({
|
|
998
|
+
name: "on_primary_container",
|
|
999
|
+
palette: (e) => e.primaryPalette,
|
|
1000
|
+
tone: (e) => L(e) ? j.foregroundTone(B.primaryContainer.tone(e), 4.5) : R(e) ? e.isDark ? 0 : 100 : e.isDark ? 90 : 30,
|
|
1001
|
+
background: (e) => B.primaryContainer,
|
|
1002
|
+
contrastCurve: new P(3, 4.5, 7, 11)
|
|
1003
|
+
}), B.inversePrimary = j.fromPalette({
|
|
1004
|
+
name: "inverse_primary",
|
|
1005
|
+
palette: (e) => e.primaryPalette,
|
|
1006
|
+
tone: (e) => e.isDark ? 40 : 80,
|
|
1007
|
+
background: (e) => B.inverseSurface,
|
|
1008
|
+
contrastCurve: new P(3, 4.5, 7, 7)
|
|
1009
|
+
}), B.secondary = j.fromPalette({
|
|
1010
|
+
name: "secondary",
|
|
1011
|
+
palette: (e) => e.secondaryPalette,
|
|
1012
|
+
tone: (e) => e.isDark ? 80 : 40,
|
|
1013
|
+
isBackground: !0,
|
|
1014
|
+
background: (e) => B.highestSurface(e),
|
|
1015
|
+
contrastCurve: new P(3, 4.5, 7, 7),
|
|
1016
|
+
toneDeltaPair: (e) => new F(B.secondaryContainer, B.secondary, 10, "nearer", !1)
|
|
1017
|
+
}), B.onSecondary = j.fromPalette({
|
|
1018
|
+
name: "on_secondary",
|
|
1019
|
+
palette: (e) => e.secondaryPalette,
|
|
1020
|
+
tone: (e) => R(e) ? e.isDark ? 10 : 100 : e.isDark ? 20 : 100,
|
|
1021
|
+
background: (e) => B.secondary,
|
|
1022
|
+
contrastCurve: new P(4.5, 7, 11, 21)
|
|
1023
|
+
}), B.secondaryContainer = j.fromPalette({
|
|
1024
|
+
name: "secondary_container",
|
|
1025
|
+
palette: (e) => e.secondaryPalette,
|
|
1026
|
+
tone: (e) => {
|
|
1027
|
+
let t = e.isDark ? 30 : 90;
|
|
1028
|
+
return R(e) ? e.isDark ? 30 : 85 : L(e) ? z(e.secondaryPalette.hue, e.secondaryPalette.chroma, t, !e.isDark) : t;
|
|
1029
|
+
},
|
|
1030
|
+
isBackground: !0,
|
|
1031
|
+
background: (e) => B.highestSurface(e),
|
|
1032
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
1033
|
+
toneDeltaPair: (e) => new F(B.secondaryContainer, B.secondary, 10, "nearer", !1)
|
|
1034
|
+
}), B.onSecondaryContainer = j.fromPalette({
|
|
1035
|
+
name: "on_secondary_container",
|
|
1036
|
+
palette: (e) => e.secondaryPalette,
|
|
1037
|
+
tone: (e) => R(e) ? e.isDark ? 90 : 10 : L(e) ? j.foregroundTone(B.secondaryContainer.tone(e), 4.5) : e.isDark ? 90 : 30,
|
|
1038
|
+
background: (e) => B.secondaryContainer,
|
|
1039
|
+
contrastCurve: new P(3, 4.5, 7, 11)
|
|
1040
|
+
}), B.tertiary = j.fromPalette({
|
|
1041
|
+
name: "tertiary",
|
|
1042
|
+
palette: (e) => e.tertiaryPalette,
|
|
1043
|
+
tone: (e) => R(e) ? e.isDark ? 90 : 25 : e.isDark ? 80 : 40,
|
|
1044
|
+
isBackground: !0,
|
|
1045
|
+
background: (e) => B.highestSurface(e),
|
|
1046
|
+
contrastCurve: new P(3, 4.5, 7, 7),
|
|
1047
|
+
toneDeltaPair: (e) => new F(B.tertiaryContainer, B.tertiary, 10, "nearer", !1)
|
|
1048
|
+
}), B.onTertiary = j.fromPalette({
|
|
1049
|
+
name: "on_tertiary",
|
|
1050
|
+
palette: (e) => e.tertiaryPalette,
|
|
1051
|
+
tone: (e) => R(e) ? e.isDark ? 10 : 90 : e.isDark ? 20 : 100,
|
|
1052
|
+
background: (e) => B.tertiary,
|
|
1053
|
+
contrastCurve: new P(4.5, 7, 11, 21)
|
|
1054
|
+
}), B.tertiaryContainer = j.fromPalette({
|
|
1055
|
+
name: "tertiary_container",
|
|
1056
|
+
palette: (e) => e.tertiaryPalette,
|
|
1057
|
+
tone: (e) => {
|
|
1058
|
+
if (R(e)) return e.isDark ? 60 : 49;
|
|
1059
|
+
if (!L(e)) return e.isDark ? 30 : 90;
|
|
1060
|
+
let t = e.tertiaryPalette.getHct(e.sourceColorHct.tone);
|
|
1061
|
+
return A.fixIfDisliked(t).tone;
|
|
1062
|
+
},
|
|
1063
|
+
isBackground: !0,
|
|
1064
|
+
background: (e) => B.highestSurface(e),
|
|
1065
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
1066
|
+
toneDeltaPair: (e) => new F(B.tertiaryContainer, B.tertiary, 10, "nearer", !1)
|
|
1067
|
+
}), B.onTertiaryContainer = j.fromPalette({
|
|
1068
|
+
name: "on_tertiary_container",
|
|
1069
|
+
palette: (e) => e.tertiaryPalette,
|
|
1070
|
+
tone: (e) => R(e) ? e.isDark ? 0 : 100 : L(e) ? j.foregroundTone(B.tertiaryContainer.tone(e), 4.5) : e.isDark ? 90 : 30,
|
|
1071
|
+
background: (e) => B.tertiaryContainer,
|
|
1072
|
+
contrastCurve: new P(3, 4.5, 7, 11)
|
|
1073
|
+
}), B.error = j.fromPalette({
|
|
1074
|
+
name: "error",
|
|
1075
|
+
palette: (e) => e.errorPalette,
|
|
1076
|
+
tone: (e) => e.isDark ? 80 : 40,
|
|
1077
|
+
isBackground: !0,
|
|
1078
|
+
background: (e) => B.highestSurface(e),
|
|
1079
|
+
contrastCurve: new P(3, 4.5, 7, 7),
|
|
1080
|
+
toneDeltaPair: (e) => new F(B.errorContainer, B.error, 10, "nearer", !1)
|
|
1081
|
+
}), B.onError = j.fromPalette({
|
|
1082
|
+
name: "on_error",
|
|
1083
|
+
palette: (e) => e.errorPalette,
|
|
1084
|
+
tone: (e) => e.isDark ? 20 : 100,
|
|
1085
|
+
background: (e) => B.error,
|
|
1086
|
+
contrastCurve: new P(4.5, 7, 11, 21)
|
|
1087
|
+
}), B.errorContainer = j.fromPalette({
|
|
1088
|
+
name: "error_container",
|
|
1089
|
+
palette: (e) => e.errorPalette,
|
|
1090
|
+
tone: (e) => e.isDark ? 30 : 90,
|
|
1091
|
+
isBackground: !0,
|
|
1092
|
+
background: (e) => B.highestSurface(e),
|
|
1093
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
1094
|
+
toneDeltaPair: (e) => new F(B.errorContainer, B.error, 10, "nearer", !1)
|
|
1095
|
+
}), B.onErrorContainer = j.fromPalette({
|
|
1096
|
+
name: "on_error_container",
|
|
1097
|
+
palette: (e) => e.errorPalette,
|
|
1098
|
+
tone: (e) => R(e) ? e.isDark ? 90 : 10 : e.isDark ? 90 : 30,
|
|
1099
|
+
background: (e) => B.errorContainer,
|
|
1100
|
+
contrastCurve: new P(3, 4.5, 7, 11)
|
|
1101
|
+
}), B.primaryFixed = j.fromPalette({
|
|
1102
|
+
name: "primary_fixed",
|
|
1103
|
+
palette: (e) => e.primaryPalette,
|
|
1104
|
+
tone: (e) => R(e) ? 40 : 90,
|
|
1105
|
+
isBackground: !0,
|
|
1106
|
+
background: (e) => B.highestSurface(e),
|
|
1107
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
1108
|
+
toneDeltaPair: (e) => new F(B.primaryFixed, B.primaryFixedDim, 10, "lighter", !0)
|
|
1109
|
+
}), B.primaryFixedDim = j.fromPalette({
|
|
1110
|
+
name: "primary_fixed_dim",
|
|
1111
|
+
palette: (e) => e.primaryPalette,
|
|
1112
|
+
tone: (e) => R(e) ? 30 : 80,
|
|
1113
|
+
isBackground: !0,
|
|
1114
|
+
background: (e) => B.highestSurface(e),
|
|
1115
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
1116
|
+
toneDeltaPair: (e) => new F(B.primaryFixed, B.primaryFixedDim, 10, "lighter", !0)
|
|
1117
|
+
}), B.onPrimaryFixed = j.fromPalette({
|
|
1118
|
+
name: "on_primary_fixed",
|
|
1119
|
+
palette: (e) => e.primaryPalette,
|
|
1120
|
+
tone: (e) => R(e) ? 100 : 10,
|
|
1121
|
+
background: (e) => B.primaryFixedDim,
|
|
1122
|
+
secondBackground: (e) => B.primaryFixed,
|
|
1123
|
+
contrastCurve: new P(4.5, 7, 11, 21)
|
|
1124
|
+
}), B.onPrimaryFixedVariant = j.fromPalette({
|
|
1125
|
+
name: "on_primary_fixed_variant",
|
|
1126
|
+
palette: (e) => e.primaryPalette,
|
|
1127
|
+
tone: (e) => R(e) ? 90 : 30,
|
|
1128
|
+
background: (e) => B.primaryFixedDim,
|
|
1129
|
+
secondBackground: (e) => B.primaryFixed,
|
|
1130
|
+
contrastCurve: new P(3, 4.5, 7, 11)
|
|
1131
|
+
}), B.secondaryFixed = j.fromPalette({
|
|
1132
|
+
name: "secondary_fixed",
|
|
1133
|
+
palette: (e) => e.secondaryPalette,
|
|
1134
|
+
tone: (e) => R(e) ? 80 : 90,
|
|
1135
|
+
isBackground: !0,
|
|
1136
|
+
background: (e) => B.highestSurface(e),
|
|
1137
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
1138
|
+
toneDeltaPair: (e) => new F(B.secondaryFixed, B.secondaryFixedDim, 10, "lighter", !0)
|
|
1139
|
+
}), B.secondaryFixedDim = j.fromPalette({
|
|
1140
|
+
name: "secondary_fixed_dim",
|
|
1141
|
+
palette: (e) => e.secondaryPalette,
|
|
1142
|
+
tone: (e) => R(e) ? 70 : 80,
|
|
1143
|
+
isBackground: !0,
|
|
1144
|
+
background: (e) => B.highestSurface(e),
|
|
1145
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
1146
|
+
toneDeltaPair: (e) => new F(B.secondaryFixed, B.secondaryFixedDim, 10, "lighter", !0)
|
|
1147
|
+
}), B.onSecondaryFixed = j.fromPalette({
|
|
1148
|
+
name: "on_secondary_fixed",
|
|
1149
|
+
palette: (e) => e.secondaryPalette,
|
|
1150
|
+
tone: (e) => 10,
|
|
1151
|
+
background: (e) => B.secondaryFixedDim,
|
|
1152
|
+
secondBackground: (e) => B.secondaryFixed,
|
|
1153
|
+
contrastCurve: new P(4.5, 7, 11, 21)
|
|
1154
|
+
}), B.onSecondaryFixedVariant = j.fromPalette({
|
|
1155
|
+
name: "on_secondary_fixed_variant",
|
|
1156
|
+
palette: (e) => e.secondaryPalette,
|
|
1157
|
+
tone: (e) => R(e) ? 25 : 30,
|
|
1158
|
+
background: (e) => B.secondaryFixedDim,
|
|
1159
|
+
secondBackground: (e) => B.secondaryFixed,
|
|
1160
|
+
contrastCurve: new P(3, 4.5, 7, 11)
|
|
1161
|
+
}), B.tertiaryFixed = j.fromPalette({
|
|
1162
|
+
name: "tertiary_fixed",
|
|
1163
|
+
palette: (e) => e.tertiaryPalette,
|
|
1164
|
+
tone: (e) => R(e) ? 40 : 90,
|
|
1165
|
+
isBackground: !0,
|
|
1166
|
+
background: (e) => B.highestSurface(e),
|
|
1167
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
1168
|
+
toneDeltaPair: (e) => new F(B.tertiaryFixed, B.tertiaryFixedDim, 10, "lighter", !0)
|
|
1169
|
+
}), B.tertiaryFixedDim = j.fromPalette({
|
|
1170
|
+
name: "tertiary_fixed_dim",
|
|
1171
|
+
palette: (e) => e.tertiaryPalette,
|
|
1172
|
+
tone: (e) => R(e) ? 30 : 80,
|
|
1173
|
+
isBackground: !0,
|
|
1174
|
+
background: (e) => B.highestSurface(e),
|
|
1175
|
+
contrastCurve: new P(1, 1, 3, 4.5),
|
|
1176
|
+
toneDeltaPair: (e) => new F(B.tertiaryFixed, B.tertiaryFixedDim, 10, "lighter", !0)
|
|
1177
|
+
}), B.onTertiaryFixed = j.fromPalette({
|
|
1178
|
+
name: "on_tertiary_fixed",
|
|
1179
|
+
palette: (e) => e.tertiaryPalette,
|
|
1180
|
+
tone: (e) => R(e) ? 100 : 10,
|
|
1181
|
+
background: (e) => B.tertiaryFixedDim,
|
|
1182
|
+
secondBackground: (e) => B.tertiaryFixed,
|
|
1183
|
+
contrastCurve: new P(4.5, 7, 11, 21)
|
|
1184
|
+
}), B.onTertiaryFixedVariant = j.fromPalette({
|
|
1185
|
+
name: "on_tertiary_fixed_variant",
|
|
1186
|
+
palette: (e) => e.tertiaryPalette,
|
|
1187
|
+
tone: (e) => R(e) ? 90 : 30,
|
|
1188
|
+
background: (e) => B.tertiaryFixedDim,
|
|
1189
|
+
secondBackground: (e) => B.tertiaryFixed,
|
|
1190
|
+
contrastCurve: new P(3, 4.5, 7, 11)
|
|
1191
|
+
});
|
|
1192
|
+
// node_modules/.pnpm/@material+material-color-utilities@0.3.0/node_modules/@material/material-color-utilities/dynamiccolor/dynamic_scheme.js
|
|
1193
|
+
var V = class {
|
|
1194
|
+
constructor(e) {
|
|
1195
|
+
this.sourceColorArgb = e.sourceColorArgb, this.variant = e.variant, this.contrastLevel = e.contrastLevel, this.isDark = e.isDark, this.sourceColorHct = O.fromInt(e.sourceColorArgb), this.primaryPalette = e.primaryPalette, this.secondaryPalette = e.secondaryPalette, this.tertiaryPalette = e.tertiaryPalette, this.neutralPalette = e.neutralPalette, this.neutralVariantPalette = e.neutralVariantPalette, this.errorPalette = M.fromHueAndChroma(25, 84);
|
|
1196
|
+
}
|
|
1197
|
+
static getRotatedHue(e, t, n) {
|
|
1198
|
+
let r = e.hue;
|
|
1199
|
+
if (t.length !== n.length) throw Error(`mismatch between hue length ${t.length} & rotations ${n.length}`);
|
|
1200
|
+
if (n.length === 1) return i(e.hue + n[0]);
|
|
1201
|
+
let a = t.length;
|
|
1202
|
+
for (let e = 0; e <= a - 2; e++) {
|
|
1203
|
+
let a = t[e], o = t[e + 1];
|
|
1204
|
+
if (a < r && r < o) return i(r + n[e]);
|
|
1205
|
+
}
|
|
1206
|
+
return r;
|
|
1207
|
+
}
|
|
1208
|
+
getArgb(e) {
|
|
1209
|
+
return e.getArgb(this);
|
|
1210
|
+
}
|
|
1211
|
+
getHct(e) {
|
|
1212
|
+
return e.getHct(this);
|
|
1213
|
+
}
|
|
1214
|
+
get primaryPaletteKeyColor() {
|
|
1215
|
+
return this.getArgb(B.primaryPaletteKeyColor);
|
|
1216
|
+
}
|
|
1217
|
+
get secondaryPaletteKeyColor() {
|
|
1218
|
+
return this.getArgb(B.secondaryPaletteKeyColor);
|
|
1219
|
+
}
|
|
1220
|
+
get tertiaryPaletteKeyColor() {
|
|
1221
|
+
return this.getArgb(B.tertiaryPaletteKeyColor);
|
|
1222
|
+
}
|
|
1223
|
+
get neutralPaletteKeyColor() {
|
|
1224
|
+
return this.getArgb(B.neutralPaletteKeyColor);
|
|
1225
|
+
}
|
|
1226
|
+
get neutralVariantPaletteKeyColor() {
|
|
1227
|
+
return this.getArgb(B.neutralVariantPaletteKeyColor);
|
|
1228
|
+
}
|
|
1229
|
+
get background() {
|
|
1230
|
+
return this.getArgb(B.background);
|
|
1231
|
+
}
|
|
1232
|
+
get onBackground() {
|
|
1233
|
+
return this.getArgb(B.onBackground);
|
|
1234
|
+
}
|
|
1235
|
+
get surface() {
|
|
1236
|
+
return this.getArgb(B.surface);
|
|
1237
|
+
}
|
|
1238
|
+
get surfaceDim() {
|
|
1239
|
+
return this.getArgb(B.surfaceDim);
|
|
1240
|
+
}
|
|
1241
|
+
get surfaceBright() {
|
|
1242
|
+
return this.getArgb(B.surfaceBright);
|
|
1243
|
+
}
|
|
1244
|
+
get surfaceContainerLowest() {
|
|
1245
|
+
return this.getArgb(B.surfaceContainerLowest);
|
|
1246
|
+
}
|
|
1247
|
+
get surfaceContainerLow() {
|
|
1248
|
+
return this.getArgb(B.surfaceContainerLow);
|
|
1249
|
+
}
|
|
1250
|
+
get surfaceContainer() {
|
|
1251
|
+
return this.getArgb(B.surfaceContainer);
|
|
1252
|
+
}
|
|
1253
|
+
get surfaceContainerHigh() {
|
|
1254
|
+
return this.getArgb(B.surfaceContainerHigh);
|
|
1255
|
+
}
|
|
1256
|
+
get surfaceContainerHighest() {
|
|
1257
|
+
return this.getArgb(B.surfaceContainerHighest);
|
|
1258
|
+
}
|
|
1259
|
+
get onSurface() {
|
|
1260
|
+
return this.getArgb(B.onSurface);
|
|
1261
|
+
}
|
|
1262
|
+
get surfaceVariant() {
|
|
1263
|
+
return this.getArgb(B.surfaceVariant);
|
|
1264
|
+
}
|
|
1265
|
+
get onSurfaceVariant() {
|
|
1266
|
+
return this.getArgb(B.onSurfaceVariant);
|
|
1267
|
+
}
|
|
1268
|
+
get inverseSurface() {
|
|
1269
|
+
return this.getArgb(B.inverseSurface);
|
|
1270
|
+
}
|
|
1271
|
+
get inverseOnSurface() {
|
|
1272
|
+
return this.getArgb(B.inverseOnSurface);
|
|
1273
|
+
}
|
|
1274
|
+
get outline() {
|
|
1275
|
+
return this.getArgb(B.outline);
|
|
1276
|
+
}
|
|
1277
|
+
get outlineVariant() {
|
|
1278
|
+
return this.getArgb(B.outlineVariant);
|
|
1279
|
+
}
|
|
1280
|
+
get shadow() {
|
|
1281
|
+
return this.getArgb(B.shadow);
|
|
1282
|
+
}
|
|
1283
|
+
get scrim() {
|
|
1284
|
+
return this.getArgb(B.scrim);
|
|
1285
|
+
}
|
|
1286
|
+
get surfaceTint() {
|
|
1287
|
+
return this.getArgb(B.surfaceTint);
|
|
1288
|
+
}
|
|
1289
|
+
get primary() {
|
|
1290
|
+
return this.getArgb(B.primary);
|
|
1291
|
+
}
|
|
1292
|
+
get onPrimary() {
|
|
1293
|
+
return this.getArgb(B.onPrimary);
|
|
1294
|
+
}
|
|
1295
|
+
get primaryContainer() {
|
|
1296
|
+
return this.getArgb(B.primaryContainer);
|
|
1297
|
+
}
|
|
1298
|
+
get onPrimaryContainer() {
|
|
1299
|
+
return this.getArgb(B.onPrimaryContainer);
|
|
1300
|
+
}
|
|
1301
|
+
get inversePrimary() {
|
|
1302
|
+
return this.getArgb(B.inversePrimary);
|
|
1303
|
+
}
|
|
1304
|
+
get secondary() {
|
|
1305
|
+
return this.getArgb(B.secondary);
|
|
1306
|
+
}
|
|
1307
|
+
get onSecondary() {
|
|
1308
|
+
return this.getArgb(B.onSecondary);
|
|
1309
|
+
}
|
|
1310
|
+
get secondaryContainer() {
|
|
1311
|
+
return this.getArgb(B.secondaryContainer);
|
|
1312
|
+
}
|
|
1313
|
+
get onSecondaryContainer() {
|
|
1314
|
+
return this.getArgb(B.onSecondaryContainer);
|
|
1315
|
+
}
|
|
1316
|
+
get tertiary() {
|
|
1317
|
+
return this.getArgb(B.tertiary);
|
|
1318
|
+
}
|
|
1319
|
+
get onTertiary() {
|
|
1320
|
+
return this.getArgb(B.onTertiary);
|
|
1321
|
+
}
|
|
1322
|
+
get tertiaryContainer() {
|
|
1323
|
+
return this.getArgb(B.tertiaryContainer);
|
|
1324
|
+
}
|
|
1325
|
+
get onTertiaryContainer() {
|
|
1326
|
+
return this.getArgb(B.onTertiaryContainer);
|
|
1327
|
+
}
|
|
1328
|
+
get error() {
|
|
1329
|
+
return this.getArgb(B.error);
|
|
1330
|
+
}
|
|
1331
|
+
get onError() {
|
|
1332
|
+
return this.getArgb(B.onError);
|
|
1333
|
+
}
|
|
1334
|
+
get errorContainer() {
|
|
1335
|
+
return this.getArgb(B.errorContainer);
|
|
1336
|
+
}
|
|
1337
|
+
get onErrorContainer() {
|
|
1338
|
+
return this.getArgb(B.onErrorContainer);
|
|
1339
|
+
}
|
|
1340
|
+
get primaryFixed() {
|
|
1341
|
+
return this.getArgb(B.primaryFixed);
|
|
1342
|
+
}
|
|
1343
|
+
get primaryFixedDim() {
|
|
1344
|
+
return this.getArgb(B.primaryFixedDim);
|
|
1345
|
+
}
|
|
1346
|
+
get onPrimaryFixed() {
|
|
1347
|
+
return this.getArgb(B.onPrimaryFixed);
|
|
1348
|
+
}
|
|
1349
|
+
get onPrimaryFixedVariant() {
|
|
1350
|
+
return this.getArgb(B.onPrimaryFixedVariant);
|
|
1351
|
+
}
|
|
1352
|
+
get secondaryFixed() {
|
|
1353
|
+
return this.getArgb(B.secondaryFixed);
|
|
1354
|
+
}
|
|
1355
|
+
get secondaryFixedDim() {
|
|
1356
|
+
return this.getArgb(B.secondaryFixedDim);
|
|
1357
|
+
}
|
|
1358
|
+
get onSecondaryFixed() {
|
|
1359
|
+
return this.getArgb(B.onSecondaryFixed);
|
|
1360
|
+
}
|
|
1361
|
+
get onSecondaryFixedVariant() {
|
|
1362
|
+
return this.getArgb(B.onSecondaryFixedVariant);
|
|
1363
|
+
}
|
|
1364
|
+
get tertiaryFixed() {
|
|
1365
|
+
return this.getArgb(B.tertiaryFixed);
|
|
1366
|
+
}
|
|
1367
|
+
get tertiaryFixedDim() {
|
|
1368
|
+
return this.getArgb(B.tertiaryFixedDim);
|
|
1369
|
+
}
|
|
1370
|
+
get onTertiaryFixed() {
|
|
1371
|
+
return this.getArgb(B.onTertiaryFixed);
|
|
1372
|
+
}
|
|
1373
|
+
get onTertiaryFixedVariant() {
|
|
1374
|
+
return this.getArgb(B.onTertiaryFixedVariant);
|
|
1375
|
+
}
|
|
1376
|
+
}, H = class e extends V {
|
|
1377
|
+
constructor(t, n, r) {
|
|
1378
|
+
super({
|
|
1379
|
+
sourceColorArgb: t.toInt(),
|
|
1380
|
+
variant: I.EXPRESSIVE,
|
|
1381
|
+
contrastLevel: r,
|
|
1382
|
+
isDark: n,
|
|
1383
|
+
primaryPalette: M.fromHueAndChroma(i(t.hue + 240), 40),
|
|
1384
|
+
secondaryPalette: M.fromHueAndChroma(V.getRotatedHue(t, e.hues, e.secondaryRotations), 24),
|
|
1385
|
+
tertiaryPalette: M.fromHueAndChroma(V.getRotatedHue(t, e.hues, e.tertiaryRotations), 32),
|
|
1386
|
+
neutralPalette: M.fromHueAndChroma(t.hue + 15, 8),
|
|
1387
|
+
neutralVariantPalette: M.fromHueAndChroma(t.hue + 15, 12)
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
};
|
|
1391
|
+
H.hues = [
|
|
1392
|
+
0,
|
|
1393
|
+
21,
|
|
1394
|
+
51,
|
|
1395
|
+
121,
|
|
1396
|
+
151,
|
|
1397
|
+
191,
|
|
1398
|
+
271,
|
|
1399
|
+
321,
|
|
1400
|
+
360
|
|
1401
|
+
], H.secondaryRotations = [
|
|
1402
|
+
45,
|
|
1403
|
+
95,
|
|
1404
|
+
45,
|
|
1405
|
+
20,
|
|
1406
|
+
45,
|
|
1407
|
+
90,
|
|
1408
|
+
45,
|
|
1409
|
+
45,
|
|
1410
|
+
45
|
|
1411
|
+
], H.tertiaryRotations = [
|
|
1412
|
+
120,
|
|
1413
|
+
120,
|
|
1414
|
+
20,
|
|
1415
|
+
45,
|
|
1416
|
+
20,
|
|
1417
|
+
15,
|
|
1418
|
+
20,
|
|
1419
|
+
120,
|
|
1420
|
+
120
|
|
1421
|
+
];
|
|
1422
|
+
// node_modules/.pnpm/@material+material-color-utilities@0.3.0/node_modules/@material/material-color-utilities/scheme/scheme_monochrome.js
|
|
1423
|
+
var U = class extends V {
|
|
1424
|
+
constructor(e, t, n) {
|
|
1425
|
+
super({
|
|
1426
|
+
sourceColorArgb: e.toInt(),
|
|
1427
|
+
variant: I.MONOCHROME,
|
|
1428
|
+
contrastLevel: n,
|
|
1429
|
+
isDark: t,
|
|
1430
|
+
primaryPalette: M.fromHueAndChroma(e.hue, 0),
|
|
1431
|
+
secondaryPalette: M.fromHueAndChroma(e.hue, 0),
|
|
1432
|
+
tertiaryPalette: M.fromHueAndChroma(e.hue, 0),
|
|
1433
|
+
neutralPalette: M.fromHueAndChroma(e.hue, 0),
|
|
1434
|
+
neutralVariantPalette: M.fromHueAndChroma(e.hue, 0)
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
}, W = class extends V {
|
|
1438
|
+
constructor(e, t, n) {
|
|
1439
|
+
super({
|
|
1440
|
+
sourceColorArgb: e.toInt(),
|
|
1441
|
+
variant: I.NEUTRAL,
|
|
1442
|
+
contrastLevel: n,
|
|
1443
|
+
isDark: t,
|
|
1444
|
+
primaryPalette: M.fromHueAndChroma(e.hue, 12),
|
|
1445
|
+
secondaryPalette: M.fromHueAndChroma(e.hue, 8),
|
|
1446
|
+
tertiaryPalette: M.fromHueAndChroma(e.hue, 16),
|
|
1447
|
+
neutralPalette: M.fromHueAndChroma(e.hue, 2),
|
|
1448
|
+
neutralVariantPalette: M.fromHueAndChroma(e.hue, 2)
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
}, G = class extends V {
|
|
1452
|
+
constructor(e, t, n) {
|
|
1453
|
+
super({
|
|
1454
|
+
sourceColorArgb: e.toInt(),
|
|
1455
|
+
variant: I.TONAL_SPOT,
|
|
1456
|
+
contrastLevel: n,
|
|
1457
|
+
isDark: t,
|
|
1458
|
+
primaryPalette: M.fromHueAndChroma(e.hue, 36),
|
|
1459
|
+
secondaryPalette: M.fromHueAndChroma(e.hue, 16),
|
|
1460
|
+
tertiaryPalette: M.fromHueAndChroma(i(e.hue + 60), 24),
|
|
1461
|
+
neutralPalette: M.fromHueAndChroma(e.hue, 6),
|
|
1462
|
+
neutralVariantPalette: M.fromHueAndChroma(e.hue, 8)
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
}, K = class e extends V {
|
|
1466
|
+
constructor(t, n, r) {
|
|
1467
|
+
super({
|
|
1468
|
+
sourceColorArgb: t.toInt(),
|
|
1469
|
+
variant: I.VIBRANT,
|
|
1470
|
+
contrastLevel: r,
|
|
1471
|
+
isDark: n,
|
|
1472
|
+
primaryPalette: M.fromHueAndChroma(t.hue, 200),
|
|
1473
|
+
secondaryPalette: M.fromHueAndChroma(V.getRotatedHue(t, e.hues, e.secondaryRotations), 24),
|
|
1474
|
+
tertiaryPalette: M.fromHueAndChroma(V.getRotatedHue(t, e.hues, e.tertiaryRotations), 32),
|
|
1475
|
+
neutralPalette: M.fromHueAndChroma(t.hue, 10),
|
|
1476
|
+
neutralVariantPalette: M.fromHueAndChroma(t.hue, 12)
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
};
|
|
1480
|
+
K.hues = [
|
|
1481
|
+
0,
|
|
1482
|
+
41,
|
|
1483
|
+
61,
|
|
1484
|
+
101,
|
|
1485
|
+
131,
|
|
1486
|
+
181,
|
|
1487
|
+
251,
|
|
1488
|
+
301,
|
|
1489
|
+
360
|
|
1490
|
+
], K.secondaryRotations = [
|
|
1491
|
+
18,
|
|
1492
|
+
15,
|
|
1493
|
+
10,
|
|
1494
|
+
12,
|
|
1495
|
+
15,
|
|
1496
|
+
18,
|
|
1497
|
+
15,
|
|
1498
|
+
12,
|
|
1499
|
+
12
|
|
1500
|
+
], K.tertiaryRotations = [
|
|
1501
|
+
35,
|
|
1502
|
+
30,
|
|
1503
|
+
20,
|
|
1504
|
+
25,
|
|
1505
|
+
30,
|
|
1506
|
+
35,
|
|
1507
|
+
30,
|
|
1508
|
+
25,
|
|
1509
|
+
25
|
|
1510
|
+
];
|
|
1511
|
+
// node_modules/.pnpm/@material+material-color-utilities@0.3.0/node_modules/@material/material-color-utilities/utils/string_utils.js
|
|
1512
|
+
function q(e) {
|
|
1513
|
+
let t = d(e), n = f(e), r = p(e), i = [
|
|
1514
|
+
t.toString(16),
|
|
1515
|
+
n.toString(16),
|
|
1516
|
+
r.toString(16)
|
|
1517
|
+
];
|
|
1518
|
+
for (let [e, t] of i.entries()) t.length === 1 && (i[e] = "0" + t);
|
|
1519
|
+
return "#" + i.join("");
|
|
1520
|
+
}
|
|
1521
|
+
function J(e) {
|
|
1522
|
+
e = e.replace("#", "");
|
|
1523
|
+
let t = e.length === 3, n = e.length === 6, r = e.length === 8;
|
|
1524
|
+
if (!t && !n && !r) throw Error("unexpected hex " + e);
|
|
1525
|
+
let i = 0, a = 0, o = 0;
|
|
1526
|
+
return t ? (i = Y(e.slice(0, 1).repeat(2)), a = Y(e.slice(1, 2).repeat(2)), o = Y(e.slice(2, 3).repeat(2))) : n ? (i = Y(e.slice(0, 2)), a = Y(e.slice(2, 4)), o = Y(e.slice(4, 6))) : r && (i = Y(e.slice(2, 4)), a = Y(e.slice(4, 6)), o = Y(e.slice(6, 8))), (255 << 24 | (i & 255) << 16 | (a & 255) << 8 | o & 255) >>> 0;
|
|
1527
|
+
}
|
|
1528
|
+
function Y(e) {
|
|
1529
|
+
return parseInt(e, 16);
|
|
1530
|
+
}
|
|
1531
|
+
// src/utils/theme.js
|
|
1532
|
+
var ee = "#61afef", X = "tonal-spot", Z = [
|
|
1533
|
+
["surface", "页面背景"],
|
|
1534
|
+
["surfaceContainerLowest", "最低层容器"],
|
|
1535
|
+
["surfaceContainerLow", "低层容器"],
|
|
1536
|
+
["surfaceContainer", "主容器"],
|
|
1537
|
+
["surfaceContainerHigh", "高层容器"],
|
|
1538
|
+
["surfaceContainerHighest", "最高层容器"],
|
|
1539
|
+
["onSurface", "主文字"],
|
|
1540
|
+
["onSurfaceVariant", "次要文字"],
|
|
1541
|
+
["outline", "强描边"],
|
|
1542
|
+
["outlineVariant", "弱描边"],
|
|
1543
|
+
["primary", "主操作"],
|
|
1544
|
+
["onPrimary", "主操作上的文字"],
|
|
1545
|
+
["primaryContainer", "柔和主操作"],
|
|
1546
|
+
["onPrimaryContainer", "柔和主操作上的文字"],
|
|
1547
|
+
["secondaryContainer", "次操作"],
|
|
1548
|
+
["onSecondaryContainer", "次操作上的文字"],
|
|
1549
|
+
["tertiaryContainer", "强调色"],
|
|
1550
|
+
["onTertiaryContainer", "强调色上的文字"],
|
|
1551
|
+
["error", "危险操作"],
|
|
1552
|
+
["onError", "危险操作上的文字"],
|
|
1553
|
+
["errorContainer", "危险柔和"],
|
|
1554
|
+
["onErrorContainer", "危险柔和上的文字"],
|
|
1555
|
+
["inverseSurface", "反色表面(提示条)"],
|
|
1556
|
+
["inverseOnSurface", "反色表面上的文字"],
|
|
1557
|
+
["scrim", "抽屉背后的遮罩"]
|
|
1558
|
+
], te = {
|
|
1559
|
+
"tonal-spot": G,
|
|
1560
|
+
monochrome: U,
|
|
1561
|
+
neutral: W
|
|
1562
|
+
};
|
|
1563
|
+
function Q(e) {
|
|
1564
|
+
return e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
1565
|
+
}
|
|
1566
|
+
function $(e, { isDark: t = !0, variant: n = X } = {}) {
|
|
1567
|
+
let r = new (te[n] || G)(O.fromInt(J(e)), t, 0), i = {};
|
|
1568
|
+
for (let [e] of Z) i[Q(e)] = q(B[e].getArgb(r));
|
|
1569
|
+
return i;
|
|
1570
|
+
}
|
|
1571
|
+
function ne(e, { isDark: t = !0, variant: n = X, target: r } = {}) {
|
|
1572
|
+
let i = $(e, {
|
|
1573
|
+
isDark: t,
|
|
1574
|
+
variant: n
|
|
1575
|
+
}), a = r || document.documentElement;
|
|
1576
|
+
for (let [e, t] of Object.entries(i)) a.style.setProperty(`--kima-color-${e}`, t);
|
|
1577
|
+
return i;
|
|
1578
|
+
}
|
|
1579
|
+
function re(e) {
|
|
1580
|
+
let t = e || document.documentElement;
|
|
1581
|
+
for (let [e] of Z) t.style.removeProperty(`--kima-color-${Q(e)}`);
|
|
1582
|
+
}
|
|
1583
|
+
export { ne as applyPalette, Q as cssName, ee as defaultSeed, X as defaultVariant, $ as generatePalette, Z as paletteRoles, re as resetPalette };
|