@mhmo91/schmancy 0.1.3 → 0.2.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/{animated-text-CXWL8BLX.js → animated-text-B9SdI5HG.js} +3 -3
- package/dist/{animated-text-CXWL8BLX.js.map → animated-text-B9SdI5HG.js.map} +1 -1
- package/dist/{animated-text-Be1GRrxM.cjs → animated-text-nDP_F5VC.cjs} +2 -2
- package/dist/{animated-text-Be1GRrxM.cjs.map → animated-text-nDP_F5VC.cjs.map} +1 -1
- package/dist/animated-text.cjs +1 -1
- package/dist/animated-text.js +1 -1
- package/dist/area.cjs +1 -1
- package/dist/{area.component-lv5p1JAi.js → area.component-AMUgdMqi.js} +3 -3
- package/dist/{area.component-lv5p1JAi.js.map → area.component-AMUgdMqi.js.map} +1 -1
- package/dist/{area.component-BdOz0QVI.cjs → area.component-DpO04rGR.cjs} +2 -2
- package/dist/{area.component-BdOz0QVI.cjs.map → area.component-DpO04rGR.cjs.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-DUasFfQd.cjs → autocomplete-DRBBs-YO.cjs} +2 -2
- package/dist/{autocomplete-DUasFfQd.cjs.map → autocomplete-DRBBs-YO.cjs.map} +1 -1
- package/dist/{autocomplete-IIohssup.js → autocomplete-S7nz-gls.js} +3 -3
- package/dist/{autocomplete-IIohssup.js.map → autocomplete-S7nz-gls.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-rX1ai5aE.js → checkbox-DNbOp9CO.js} +2 -2
- package/dist/{checkbox-rX1ai5aE.js.map → checkbox-DNbOp9CO.js.map} +1 -1
- package/dist/{checkbox-UGSiC4-7.cjs → checkbox-DV_o7EFp.cjs} +2 -2
- package/dist/{checkbox-UGSiC4-7.cjs.map → checkbox-DV_o7EFp.cjs.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-DKyOFX0b.js → chips-B1DqsDUN.js} +3 -3
- package/dist/{chips-DKyOFX0b.js.map → chips-B1DqsDUN.js.map} +1 -1
- package/dist/{chips-42rqq7eR.cjs → chips-Cv0qcGHx.cjs} +2 -2
- package/dist/{chips-42rqq7eR.cjs.map → chips-Cv0qcGHx.cjs.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{date-range-Cv7J4zqk.js → date-range-BRkCPAff.js} +3 -3
- package/dist/{date-range-Cv7J4zqk.js.map → date-range-BRkCPAff.js.map} +1 -1
- package/dist/{date-range-Dx0X9XkD.cjs → date-range-CY-DT-VU.cjs} +2 -2
- package/dist/{date-range-Dx0X9XkD.cjs.map → date-range-CY-DT-VU.cjs.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-DDTFbzUT.js → delay-B7VUwnDz.js} +2 -2
- package/dist/{delay-DDTFbzUT.js.map → delay-B7VUwnDz.js.map} +1 -1
- package/dist/{delay-BknG_sX0.cjs → delay-BPyG3Kp9.cjs} +2 -2
- package/dist/{delay-BknG_sX0.cjs.map → delay-BPyG3Kp9.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{divider-CA2cFFcc.cjs → divider-B_ON7uf5.cjs} +2 -2
- package/dist/{divider-CA2cFFcc.cjs.map → divider-B_ON7uf5.cjs.map} +1 -1
- package/dist/{divider-LocxHBJv.js → divider-DpHFBFrA.js} +3 -3
- package/dist/{divider-LocxHBJv.js.map → divider-DpHFBFrA.js.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/{form-BV79BLFu.js → form-DD-SYyrx.js} +2 -2
- package/dist/{form-BV79BLFu.js.map → form-DD-SYyrx.js.map} +1 -1
- package/dist/{form-RAgk2SSz.cjs → form-jopPseAf.cjs} +2 -2
- package/dist/{form-RAgk2SSz.cjs.map → form-jopPseAf.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-DBIGGdxd.cjs → icon-C_FPBlRN.cjs} +2 -2
- package/dist/{icon-DBIGGdxd.cjs.map → icon-C_FPBlRN.cjs.map} +1 -1
- package/dist/{icon-DMom-EmW.js → icon-Dl79Z-46.js} +3 -3
- package/dist/{icon-DMom-EmW.js.map → icon-Dl79Z-46.js.map} +1 -1
- package/dist/{icon-button-B1siCgt2.js → icon-button-BkcXisF4.js} +3 -3
- package/dist/{icon-button-B1siCgt2.js.map → icon-button-BkcXisF4.js.map} +1 -1
- package/dist/{icon-button-cP-S-rgo.cjs → icon-button-C5VXKLyn.cjs} +2 -2
- package/dist/{icon-button-cP-S-rgo.cjs.map → icon-button-C5VXKLyn.cjs.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +92 -92
- package/dist/index.js.map +1 -1
- package/dist/{input-JeE5xI6K.js → input-Dv_d3Ube.js} +2 -2
- package/dist/{input-JeE5xI6K.js.map → input-Dv_d3Ube.js.map} +1 -1
- package/dist/{input-BE2Nmifh.cjs → input-DzOE-efI.cjs} +2 -2
- package/dist/{input-BE2Nmifh.cjs.map → input-DzOE-efI.cjs.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-BQQ8SViR.js → litElement.mixin-BcBF7FRS.js} +2 -2
- package/dist/{litElement.mixin-BQQ8SViR.js.map → litElement.mixin-BcBF7FRS.js.map} +1 -1
- package/dist/{litElement.mixin-T2hfvva-.cjs → litElement.mixin-IGVWivq2.cjs} +2 -2
- package/dist/{litElement.mixin-T2hfvva-.cjs.map → litElement.mixin-IGVWivq2.cjs.map} +1 -1
- package/dist/{menu-CcoCzR8e.cjs → menu-BMJZsO7u.cjs} +2 -2
- package/dist/{menu-CcoCzR8e.cjs.map → menu-BMJZsO7u.cjs.map} +1 -1
- package/dist/{menu-HLuts8V3.js → menu-CDsJkpu5.js} +3 -3
- package/dist/{menu-HLuts8V3.js.map → menu-CDsJkpu5.js.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/mixins/tailwind.css +392 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-Bzi4aanD.cjs → option-1bQVbrEt.cjs} +2 -2
- package/dist/{option-Bzi4aanD.cjs.map → option-1bQVbrEt.cjs.map} +1 -1
- package/dist/{option-C5egpChO.js → option-DIpHfpFS.js} +2 -2
- package/dist/{option-C5egpChO.js.map → option-DIpHfpFS.js.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{outlet-CQ6YXEen.cjs → outlet-BvAT4m3r.cjs} +2 -2
- package/dist/{outlet-CQ6YXEen.cjs.map → outlet-BvAT4m3r.cjs.map} +1 -1
- package/dist/{outlet-CXxpQ37y.js → outlet-Ci9xMSJ0.js} +2 -2
- package/dist/{outlet-CXxpQ37y.js.map → outlet-Ci9xMSJ0.js.map} +1 -1
- package/dist/{payment-card-form-DNI4IjK7.cjs → payment-card-form-Cd66MCeM.cjs} +2 -2
- package/dist/{payment-card-form-DNI4IjK7.cjs.map → payment-card-form-Cd66MCeM.cjs.map} +1 -1
- package/dist/{payment-card-form-BNCVkn4A.js → payment-card-form-DrWyUhkX.js} +3 -3
- package/dist/{payment-card-form-BNCVkn4A.js.map → payment-card-form-DrWyUhkX.js.map} +1 -1
- package/dist/{radio-group-CPmdicYZ.js → radio-group-DwAtByja.js} +2 -2
- package/dist/{radio-group-CPmdicYZ.js.map → radio-group-DwAtByja.js.map} +1 -1
- package/dist/{radio-group-DiecmCUy.cjs → radio-group-SlWpazT2.cjs} +2 -2
- package/dist/{radio-group-DiecmCUy.cjs.map → radio-group-SlWpazT2.cjs.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{scroll-C2AdiqOm.js → scroll-BFAm-L6v.js} +2 -2
- package/dist/{scroll-C2AdiqOm.js.map → scroll-BFAm-L6v.js.map} +1 -1
- package/dist/{scroll-CmQioZO_.cjs → scroll-CFfZT7gH.cjs} +2 -2
- package/dist/{scroll-CmQioZO_.cjs.map → scroll-CFfZT7gH.cjs.map} +1 -1
- package/dist/{select-BPPcWB35.cjs → select-Bq3rx22N.cjs} +2 -2
- package/dist/{select-BPPcWB35.cjs.map → select-Bq3rx22N.cjs.map} +1 -1
- package/dist/{select-CHqzliGG.js → select-D1iuS17j.js} +3 -3
- package/dist/{select-CHqzliGG.js.map → select-D1iuS17j.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/{sheet-KV0oZtrR.cjs → sheet-CiWmylhJ.cjs} +2 -2
- package/dist/{sheet-KV0oZtrR.cjs.map → sheet-CiWmylhJ.cjs.map} +1 -1
- package/dist/{sheet-CGmu7xn7.js → sheet-DRevGqjY.js} +3 -3
- package/dist/{sheet-CGmu7xn7.js.map → sheet-DRevGqjY.js.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-D8zKzxgN.cjs → slider-CR1AnZQy.cjs} +2 -2
- package/dist/{slider-D8zKzxgN.cjs.map → slider-CR1AnZQy.cjs.map} +1 -1
- package/dist/{slider-D-M3pFtn.js → slider-Dqe5E2F9.js} +3 -3
- package/dist/{slider-D-M3pFtn.js.map → slider-Dqe5E2F9.js.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-C-2I7yH9.cjs → spinner-gZpHGbro.cjs} +2 -2
- package/dist/{spinner-C-2I7yH9.cjs.map → spinner-gZpHGbro.cjs.map} +1 -1
- package/dist/{spinner-Bxpq8jN0.js → spinner-tOzccpuH.js} +3 -3
- package/dist/{spinner-Bxpq8jN0.js.map → spinner-tOzccpuH.js.map} +1 -1
- package/dist/{surface-B0Wpttcp.js → surface-PcBZIgVN.js} +2 -2
- package/dist/{surface-B0Wpttcp.js.map → surface-PcBZIgVN.js.map} +1 -1
- package/dist/{surface-K6V6QGZ7.cjs → surface-teeIR4jt.cjs} +2 -2
- package/dist/{surface-K6V6QGZ7.cjs.map → surface-teeIR4jt.cjs.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-CNa5CVCb.cjs → table-D0scRpUa.cjs} +2 -2
- package/dist/{table-CNa5CVCb.cjs.map → table-D0scRpUa.cjs.map} +1 -1
- package/dist/{table-DXYjwhsS.js → table-Dfip6wRe.js} +2 -2
- package/dist/{table-DXYjwhsS.js.map → table-Dfip6wRe.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-group-jVXSw4vO.js → tabs-group-BUtko5gD.js} +2 -2
- package/dist/{tabs-group-jVXSw4vO.js.map → tabs-group-BUtko5gD.js.map} +1 -1
- package/dist/{tabs-group-B6L2cvkm.cjs → tabs-group-D469QufO.cjs} +2 -2
- package/dist/{tabs-group-B6L2cvkm.cjs.map → tabs-group-D469QufO.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-Cwk3HTxV.js +43 -0
- package/dist/{tailwind.mixin-DZctuRzi.js.map → tailwind.mixin-Cwk3HTxV.js.map} +1 -1
- package/dist/tailwind.mixin-TcrSCY6e.cjs +2 -0
- package/dist/{tailwind.mixin-BXsGUMQ1.cjs.map → tailwind.mixin-TcrSCY6e.cjs.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.component-CJ1tlZZL.cjs +173 -0
- package/dist/teleport.component-CJ1tlZZL.cjs.map +1 -0
- package/dist/{theme-button-BQZkb1t4.js → teleport.component-CgNOwz49.js} +177 -188
- package/dist/teleport.component-CgNOwz49.js.map +1 -0
- package/dist/teleport.js +1 -1
- package/dist/{textarea-Buxkp6z0.js → textarea-BRE-ZxNE.js} +2 -2
- package/dist/{textarea-Buxkp6z0.js.map → textarea-BRE-ZxNE.js.map} +1 -1
- package/dist/{textarea-B6Pl8Y2D.cjs → textarea-Dd0cdn5f.cjs} +2 -2
- package/dist/{textarea-B6Pl8Y2D.cjs.map → textarea-Dd0cdn5f.cjs.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/theme-button-B3n5iZsE.js +26 -0
- package/dist/theme-button-B3n5iZsE.js.map +1 -0
- package/dist/theme-button-BYxPN54_.cjs +9 -0
- package/dist/theme-button-BYxPN54_.cjs.map +1 -0
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.component-CqFcwW_5.cjs +3 -0
- package/dist/theme.component-CqFcwW_5.cjs.map +1 -0
- package/dist/theme.component-DELqRYyh.js +725 -0
- package/dist/theme.component-DELqRYyh.js.map +1 -0
- package/dist/theme.js +4 -5
- package/dist/{tree-7PVEhRCU.js → tree-C-rEmlo4.js} +2 -2
- package/dist/{tree-7PVEhRCU.js.map → tree-C-rEmlo4.js.map} +1 -1
- package/dist/{tree-nmdWfp9I.cjs → tree-C38O9nQ9.cjs} +2 -2
- package/dist/{tree-nmdWfp9I.cjs.map → tree-C38O9nQ9.cjs.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-ZnPAe8JA.js → typewriter-BJW4ypAk.js} +4 -4
- package/dist/{typewriter-ZnPAe8JA.js.map → typewriter-BJW4ypAk.js.map} +1 -1
- package/dist/{typewriter-DnGkvyDG.cjs → typewriter-BdsCux99.cjs} +2 -2
- package/dist/{typewriter-DnGkvyDG.cjs.map → typewriter-BdsCux99.cjs.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-oGjgh4qJ.cjs → typography-BAI6fEiW.cjs} +2 -2
- package/dist/{typography-oGjgh4qJ.cjs.map → typography-BAI6fEiW.cjs.map} +1 -1
- package/dist/{typography-L0ZKDX-X.js → typography-BFPivXLr.js} +2 -2
- package/dist/{typography-L0ZKDX-X.js.map → typography-BFPivXLr.js.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +1 -1
- package/types/src/nav-drawer/navbar.d.ts +3 -1
- package/types/src/theme/index.d.ts +1 -2
- package/types/src/theme/theme.component.d.ts +18 -0
- package/dist/dynamicTheme-BYlTubq6.cjs +0 -3
- package/dist/dynamicTheme-BYlTubq6.cjs.map +0 -1
- package/dist/dynamicTheme-DYtQDYE_.js +0 -721
- package/dist/dynamicTheme-DYtQDYE_.js.map +0 -1
- package/dist/tailwind.mixin-BXsGUMQ1.cjs +0 -2
- package/dist/tailwind.mixin-DZctuRzi.js +0 -43
- package/dist/theme-button-BQZkb1t4.js.map +0 -1
- package/dist/theme-button-CWM-0CJh.cjs +0 -180
- package/dist/theme-button-CWM-0CJh.cjs.map +0 -1
|
@@ -1,721 +0,0 @@
|
|
|
1
|
-
import { Subject as xe, Observable as Ie, startWith as Te, map as ne, catchError as Se, of as Fe, tap as Le, combineLatestWith as Be } from "rxjs";
|
|
2
|
-
function Pe(e = "schmancy", r, t) {
|
|
3
|
-
return typeof t == "object" ? Object.keys(t).map((a) => Pe(e, r + (r ? "-" : "") + a, t[a])).join(`
|
|
4
|
-
`) : void document.documentElement.style.setProperty(`--${e}-${r}`, t);
|
|
5
|
-
}
|
|
6
|
-
const Oe = new xe(), we = new xe();
|
|
7
|
-
function N(e) {
|
|
8
|
-
return e < 0 ? -1 : e === 0 ? 0 : 1;
|
|
9
|
-
}
|
|
10
|
-
function Z(e, r, t) {
|
|
11
|
-
return (1 - t) * e + t * r;
|
|
12
|
-
}
|
|
13
|
-
function oe(e, r, t) {
|
|
14
|
-
return t < e ? e : t > r ? r : t;
|
|
15
|
-
}
|
|
16
|
-
function ce(e) {
|
|
17
|
-
return (e %= 360) < 0 && (e += 360), e;
|
|
18
|
-
}
|
|
19
|
-
function ue(e, r) {
|
|
20
|
-
return [e[0] * r[0][0] + e[1] * r[0][1] + e[2] * r[0][2], e[0] * r[1][0] + e[1] * r[1][1] + e[2] * r[1][2], e[0] * r[2][0] + e[1] * r[2][1] + e[2] * r[2][2]];
|
|
21
|
-
}
|
|
22
|
-
we.pipe().subscribe((e) => {
|
|
23
|
-
Pe("schmancy", "", e);
|
|
24
|
-
});
|
|
25
|
-
const Ae = [[0.41233895, 0.35762064, 0.18051042], [0.2126, 0.7152, 0.0722], [0.01932141, 0.11916382, 0.95034478]], Re = [[3.2413774792388685, -1.5376652402851851, -0.49885366846268053], [-0.9691452513005321, 1.8758853451067872, 0.04156585616912061], [0.05562093689691305, -0.20395524564742123, 1.0571799111220335]], He = [95.047, 100, 108.883];
|
|
26
|
-
function me(e, r, t) {
|
|
27
|
-
return (255 << 24 | (255 & e) << 16 | (255 & r) << 8 | 255 & t) >>> 0;
|
|
28
|
-
}
|
|
29
|
-
function ye(e) {
|
|
30
|
-
return me(J(e[0]), J(e[1]), J(e[2]));
|
|
31
|
-
}
|
|
32
|
-
function he(e) {
|
|
33
|
-
const r = function(t) {
|
|
34
|
-
const a = W(function(s) {
|
|
35
|
-
return s >> 16 & 255;
|
|
36
|
-
}(t)), n = W(function(s) {
|
|
37
|
-
return s >> 8 & 255;
|
|
38
|
-
}(t)), i = W(function(s) {
|
|
39
|
-
return 255 & s;
|
|
40
|
-
}(t));
|
|
41
|
-
return ue([a, n, i], Ae);
|
|
42
|
-
}(e)[1];
|
|
43
|
-
return 116 * ke(r / 100) - 16;
|
|
44
|
-
}
|
|
45
|
-
function G(e) {
|
|
46
|
-
return 100 * function(r) {
|
|
47
|
-
const t = 903.2962962962963, a = r * r * r;
|
|
48
|
-
return a > 216 / 24389 ? a : (116 * r - 16) / t;
|
|
49
|
-
}((e + 16) / 116);
|
|
50
|
-
}
|
|
51
|
-
function le(e) {
|
|
52
|
-
return 116 * ke(e / 100) - 16;
|
|
53
|
-
}
|
|
54
|
-
function W(e) {
|
|
55
|
-
const r = e / 255;
|
|
56
|
-
return r <= 0.040449936 ? r / 12.92 * 100 : 100 * Math.pow((r + 0.055) / 1.055, 2.4);
|
|
57
|
-
}
|
|
58
|
-
function J(e) {
|
|
59
|
-
const r = e / 100;
|
|
60
|
-
let t = 0;
|
|
61
|
-
return t = r <= 31308e-7 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - 0.055, a = 0, n = 255, (i = Math.round(255 * t)) < a ? a : i > n ? n : i;
|
|
62
|
-
var a, n, i;
|
|
63
|
-
}
|
|
64
|
-
function ke(e) {
|
|
65
|
-
return e > 216 / 24389 ? Math.pow(e, 1 / 3) : (903.2962962962963 * e + 16) / 116;
|
|
66
|
-
}
|
|
67
|
-
class V {
|
|
68
|
-
static make(r = /* @__PURE__ */ function() {
|
|
69
|
-
return He;
|
|
70
|
-
}(), t = 200 / Math.PI * G(50) / 100, a = 50, n = 2, i = !1) {
|
|
71
|
-
const s = r, c = 0.401288 * s[0] + 0.650173 * s[1] + -0.051461 * s[2], u = -0.250268 * s[0] + 1.204414 * s[1] + 0.045854 * s[2], h = -2079e-6 * s[0] + 0.048952 * s[1] + 0.953127 * s[2], m = 0.8 + n / 10, g = m >= 0.9 ? Z(0.59, 0.69, 10 * (m - 0.9)) : Z(0.525, 0.59, 10 * (m - 0.8));
|
|
72
|
-
let y = i ? 1 : m * (1 - 1 / 3.6 * Math.exp((-t - 42) / 92));
|
|
73
|
-
y = y > 1 ? 1 : y < 0 ? 0 : y;
|
|
74
|
-
const P = m, f = [y * (100 / c) + 1 - y, y * (100 / u) + 1 - y, y * (100 / h) + 1 - y], k = 1 / (5 * t + 1), M = k * k * k * k, v = 1 - M, C = M * t + 0.1 * v * v * Math.cbrt(5 * t), O = G(a) / r[1], x = 1.48 + Math.sqrt(O), w = 0.725 / Math.pow(O, 0.2), S = w, b = [Math.pow(C * f[0] * c / 100, 0.42), Math.pow(C * f[1] * u / 100, 0.42), Math.pow(C * f[2] * h / 100, 0.42)], T = [400 * b[0] / (b[0] + 27.13), 400 * b[1] / (b[1] + 27.13), 400 * b[2] / (b[2] + 27.13)];
|
|
75
|
-
return new V(O, (2 * T[0] + T[1] + 0.05 * T[2]) * w, w, S, g, P, f, C, Math.pow(C, 0.25), x);
|
|
76
|
-
}
|
|
77
|
-
constructor(r, t, a, n, i, s, c, u, h, m) {
|
|
78
|
-
this.n = r, this.aw = t, this.nbb = a, this.ncb = n, this.c = i, this.nc = s, this.rgbD = c, this.fl = u, this.fLRoot = h, this.z = m;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
V.DEFAULT = V.make();
|
|
82
|
-
class L {
|
|
83
|
-
constructor(r, t, a, n, i, s, c, u, h) {
|
|
84
|
-
this.hue = r, this.chroma = t, this.j = a, this.q = n, this.m = i, this.s = s, this.jstar = c, this.astar = u, this.bstar = h;
|
|
85
|
-
}
|
|
86
|
-
distance(r) {
|
|
87
|
-
const t = this.jstar - r.jstar, a = this.astar - r.astar, n = this.bstar - r.bstar, i = Math.sqrt(t * t + a * a + n * n);
|
|
88
|
-
return 1.41 * Math.pow(i, 0.63);
|
|
89
|
-
}
|
|
90
|
-
static fromInt(r) {
|
|
91
|
-
return L.fromIntInViewingConditions(r, V.DEFAULT);
|
|
92
|
-
}
|
|
93
|
-
static fromIntInViewingConditions(r, t) {
|
|
94
|
-
const a = (65280 & r) >> 8, n = 255 & r, i = W((16711680 & r) >> 16), s = W(a), c = W(n), u = 0.41233895 * i + 0.35762064 * s + 0.18051042 * c, h = 0.2126 * i + 0.7152 * s + 0.0722 * c, m = 0.01932141 * i + 0.11916382 * s + 0.95034478 * c, g = 0.401288 * u + 0.650173 * h - 0.051461 * m, y = -0.250268 * u + 1.204414 * h + 0.045854 * m, P = -2079e-6 * u + 0.048952 * h + 0.953127 * m, f = t.rgbD[0] * g, k = t.rgbD[1] * y, M = t.rgbD[2] * P, v = Math.pow(t.fl * Math.abs(f) / 100, 0.42), C = Math.pow(t.fl * Math.abs(k) / 100, 0.42), O = Math.pow(t.fl * Math.abs(M) / 100, 0.42), x = 400 * N(f) * v / (v + 27.13), w = 400 * N(k) * C / (C + 27.13), S = 400 * N(M) * O / (O + 27.13), b = (11 * x + -12 * w + S) / 11, T = (x + w - 2 * S) / 9, I = (20 * x + 20 * w + 21 * S) / 20, ee = (40 * x + 20 * w + S) / 20, U = 180 * Math.atan2(T, b) / Math.PI, q = U < 0 ? U + 360 : U >= 360 ? U - 360 : U, j = q * Math.PI / 180, H = ee * t.nbb, _ = 100 * Math.pow(H / t.aw, t.c * t.z), X = 4 / t.c * Math.sqrt(_ / 100) * (t.aw + 4) * t.fLRoot, Q = q < 20.14 ? q + 360 : q, re = 5e4 / 13 * (0.25 * (Math.cos(Q * Math.PI / 180 + 2) + 3.8)) * t.nc * t.ncb * Math.sqrt(b * b + T * T) / (I + 0.305), te = Math.pow(re, 0.9) * Math.pow(1.64 - Math.pow(0.29, t.n), 0.73), ae = te * Math.sqrt(_ / 100), fe = ae * t.fLRoot, Me = 50 * Math.sqrt(te * t.c / (t.aw + 4)), be = (1 + 100 * 7e-3) * _ / (1 + 7e-3 * _), ge = 1 / 0.0228 * Math.log(1 + 0.0228 * fe), De = ge * Math.cos(j), ve = ge * Math.sin(j);
|
|
95
|
-
return new L(q, ae, _, X, fe, Me, be, De, ve);
|
|
96
|
-
}
|
|
97
|
-
static fromJch(r, t, a) {
|
|
98
|
-
return L.fromJchInViewingConditions(r, t, a, V.DEFAULT);
|
|
99
|
-
}
|
|
100
|
-
static fromJchInViewingConditions(r, t, a, n) {
|
|
101
|
-
const i = 4 / n.c * Math.sqrt(r / 100) * (n.aw + 4) * n.fLRoot, s = t * n.fLRoot, c = t / Math.sqrt(r / 100), u = 50 * Math.sqrt(c * n.c / (n.aw + 4)), h = a * Math.PI / 180, m = (1 + 100 * 7e-3) * r / (1 + 7e-3 * r), g = 1 / 0.0228 * Math.log(1 + 0.0228 * s), y = g * Math.cos(h), P = g * Math.sin(h);
|
|
102
|
-
return new L(a, t, r, i, s, u, m, y, P);
|
|
103
|
-
}
|
|
104
|
-
static fromUcs(r, t, a) {
|
|
105
|
-
return L.fromUcsInViewingConditions(r, t, a, V.DEFAULT);
|
|
106
|
-
}
|
|
107
|
-
static fromUcsInViewingConditions(r, t, a, n) {
|
|
108
|
-
const i = t, s = a, c = Math.sqrt(i * i + s * s), u = (Math.exp(0.0228 * c) - 1) / 0.0228 / n.fLRoot;
|
|
109
|
-
let h = Math.atan2(s, i) * (180 / Math.PI);
|
|
110
|
-
h < 0 && (h += 360);
|
|
111
|
-
const m = r / (1 - 7e-3 * (r - 100));
|
|
112
|
-
return L.fromJchInViewingConditions(m, u, h, n);
|
|
113
|
-
}
|
|
114
|
-
toInt() {
|
|
115
|
-
return this.viewed(V.DEFAULT);
|
|
116
|
-
}
|
|
117
|
-
viewed(r) {
|
|
118
|
-
const t = this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100), a = Math.pow(t / Math.pow(1.64 - Math.pow(0.29, r.n), 0.73), 1 / 0.9), n = this.hue * Math.PI / 180, i = 0.25 * (Math.cos(n + 2) + 3.8), s = r.aw * Math.pow(this.j / 100, 1 / r.c / r.z), c = i * (5e4 / 13) * r.nc * r.ncb, u = s / r.nbb, h = Math.sin(n), m = Math.cos(n), g = 23 * (u + 0.305) * a / (23 * c + 11 * a * m + 108 * a * h), y = g * m, P = g * h, f = (460 * u + 451 * y + 288 * P) / 1403, k = (460 * u - 891 * y - 261 * P) / 1403, M = (460 * u - 220 * y - 6300 * P) / 1403, v = Math.max(0, 27.13 * Math.abs(f) / (400 - Math.abs(f))), C = N(f) * (100 / r.fl) * Math.pow(v, 1 / 0.42), O = Math.max(0, 27.13 * Math.abs(k) / (400 - Math.abs(k))), x = N(k) * (100 / r.fl) * Math.pow(O, 1 / 0.42), w = Math.max(0, 27.13 * Math.abs(M) / (400 - Math.abs(M))), S = N(M) * (100 / r.fl) * Math.pow(w, 1 / 0.42), b = C / r.rgbD[0], T = x / r.rgbD[1], I = S / r.rgbD[2];
|
|
119
|
-
return function(U, q, j) {
|
|
120
|
-
const H = Re, _ = H[0][0] * U + H[0][1] * q + H[0][2] * j, X = H[1][0] * U + H[1][1] * q + H[1][2] * j, Q = H[2][0] * U + H[2][1] * q + H[2][2] * j;
|
|
121
|
-
return me(J(_), J(X), J(Q));
|
|
122
|
-
}(1.86206786 * b - 1.01125463 * T + 0.14918677 * I, 0.38752654 * b + 0.62144744 * T - 897398e-8 * I, -0.0158415 * b - 0.03412294 * T + 1.04996444 * I);
|
|
123
|
-
}
|
|
124
|
-
static fromXyzInViewingConditions(r, t, a, n) {
|
|
125
|
-
const i = 0.401288 * r + 0.650173 * t - 0.051461 * a, s = -0.250268 * r + 1.204414 * t + 0.045854 * a, c = -2079e-6 * r + 0.048952 * t + 0.953127 * a, u = n.rgbD[0] * i, h = n.rgbD[1] * s, m = n.rgbD[2] * c, g = Math.pow(n.fl * Math.abs(u) / 100, 0.42), y = Math.pow(n.fl * Math.abs(h) / 100, 0.42), P = Math.pow(n.fl * Math.abs(m) / 100, 0.42), f = 400 * N(u) * g / (g + 27.13), k = 400 * N(h) * y / (y + 27.13), M = 400 * N(m) * P / (P + 27.13), v = (11 * f + -12 * k + M) / 11, C = (f + k - 2 * M) / 9, O = (20 * f + 20 * k + 21 * M) / 20, x = (40 * f + 20 * k + M) / 20, w = 180 * Math.atan2(C, v) / Math.PI, S = w < 0 ? w + 360 : w >= 360 ? w - 360 : w, b = S * Math.PI / 180, T = x * n.nbb, I = 100 * Math.pow(T / n.aw, n.c * n.z), ee = 4 / n.c * Math.sqrt(I / 100) * (n.aw + 4) * n.fLRoot, U = S < 20.14 ? S + 360 : S, q = 5e4 / 13 * (1 / 4 * (Math.cos(U * Math.PI / 180 + 2) + 3.8)) * n.nc * n.ncb * Math.sqrt(v * v + C * C) / (O + 0.305), j = Math.pow(q, 0.9) * Math.pow(1.64 - Math.pow(0.29, n.n), 0.73), H = j * Math.sqrt(I / 100), _ = H * n.fLRoot, X = 50 * Math.sqrt(j * n.c / (n.aw + 4)), Q = (1 + 100 * 7e-3) * I / (1 + 7e-3 * I), re = Math.log(1 + 0.0228 * _) / 0.0228, te = re * Math.cos(b), ae = re * Math.sin(b);
|
|
126
|
-
return new L(S, H, I, ee, _, X, Q, te, ae);
|
|
127
|
-
}
|
|
128
|
-
xyzInViewingConditions(r) {
|
|
129
|
-
const t = this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100), a = Math.pow(t / Math.pow(1.64 - Math.pow(0.29, r.n), 0.73), 1 / 0.9), n = this.hue * Math.PI / 180, i = 0.25 * (Math.cos(n + 2) + 3.8), s = r.aw * Math.pow(this.j / 100, 1 / r.c / r.z), c = i * (5e4 / 13) * r.nc * r.ncb, u = s / r.nbb, h = Math.sin(n), m = Math.cos(n), g = 23 * (u + 0.305) * a / (23 * c + 11 * a * m + 108 * a * h), y = g * m, P = g * h, f = (460 * u + 451 * y + 288 * P) / 1403, k = (460 * u - 891 * y - 261 * P) / 1403, M = (460 * u - 220 * y - 6300 * P) / 1403, v = Math.max(0, 27.13 * Math.abs(f) / (400 - Math.abs(f))), C = N(f) * (100 / r.fl) * Math.pow(v, 1 / 0.42), O = Math.max(0, 27.13 * Math.abs(k) / (400 - Math.abs(k))), x = N(k) * (100 / r.fl) * Math.pow(O, 1 / 0.42), w = Math.max(0, 27.13 * Math.abs(M) / (400 - Math.abs(M))), S = N(M) * (100 / r.fl) * Math.pow(w, 1 / 0.42), b = C / r.rgbD[0], T = x / r.rgbD[1], I = S / r.rgbD[2];
|
|
130
|
-
return [1.86206786 * b - 1.01125463 * T + 0.14918677 * I, 0.38752654 * b + 0.62144744 * T - 897398e-8 * I, -0.0158415 * b - 0.03412294 * T + 1.04996444 * I];
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
class p {
|
|
134
|
-
static sanitizeRadians(r) {
|
|
135
|
-
return (r + 8 * Math.PI) % (2 * Math.PI);
|
|
136
|
-
}
|
|
137
|
-
static trueDelinearized(r) {
|
|
138
|
-
const t = r / 100;
|
|
139
|
-
let a = 0;
|
|
140
|
-
return a = t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055, 255 * a;
|
|
141
|
-
}
|
|
142
|
-
static chromaticAdaptation(r) {
|
|
143
|
-
const t = Math.pow(Math.abs(r), 0.42);
|
|
144
|
-
return 400 * N(r) * t / (t + 27.13);
|
|
145
|
-
}
|
|
146
|
-
static hueOf(r) {
|
|
147
|
-
const t = ue(r, p.SCALED_DISCOUNT_FROM_LINRGB), a = p.chromaticAdaptation(t[0]), n = p.chromaticAdaptation(t[1]), i = p.chromaticAdaptation(t[2]), s = (11 * a + -12 * n + i) / 11, c = (a + n - 2 * i) / 9;
|
|
148
|
-
return Math.atan2(c, s);
|
|
149
|
-
}
|
|
150
|
-
static areInCyclicOrder(r, t, a) {
|
|
151
|
-
return p.sanitizeRadians(t - r) < p.sanitizeRadians(a - r);
|
|
152
|
-
}
|
|
153
|
-
static intercept(r, t, a) {
|
|
154
|
-
return (t - r) / (a - r);
|
|
155
|
-
}
|
|
156
|
-
static lerpPoint(r, t, a) {
|
|
157
|
-
return [r[0] + (a[0] - r[0]) * t, r[1] + (a[1] - r[1]) * t, r[2] + (a[2] - r[2]) * t];
|
|
158
|
-
}
|
|
159
|
-
static setCoordinate(r, t, a, n) {
|
|
160
|
-
const i = p.intercept(r[n], t, a[n]);
|
|
161
|
-
return p.lerpPoint(r, i, a);
|
|
162
|
-
}
|
|
163
|
-
static isBounded(r) {
|
|
164
|
-
return 0 <= r && r <= 100;
|
|
165
|
-
}
|
|
166
|
-
static nthVertex(r, t) {
|
|
167
|
-
const a = p.Y_FROM_LINRGB[0], n = p.Y_FROM_LINRGB[1], i = p.Y_FROM_LINRGB[2], s = t % 4 <= 1 ? 0 : 100, c = t % 2 == 0 ? 0 : 100;
|
|
168
|
-
if (t < 4) {
|
|
169
|
-
const u = s, h = c, m = (r - u * n - h * i) / a;
|
|
170
|
-
return p.isBounded(m) ? [m, u, h] : [-1, -1, -1];
|
|
171
|
-
}
|
|
172
|
-
if (t < 8) {
|
|
173
|
-
const u = s, h = c, m = (r - h * a - u * i) / n;
|
|
174
|
-
return p.isBounded(m) ? [h, m, u] : [-1, -1, -1];
|
|
175
|
-
}
|
|
176
|
-
{
|
|
177
|
-
const u = s, h = c, m = (r - u * a - h * n) / i;
|
|
178
|
-
return p.isBounded(m) ? [u, h, m] : [-1, -1, -1];
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
static bisectToSegment(r, t) {
|
|
182
|
-
let a = [-1, -1, -1], n = a, i = 0, s = 0, c = !1, u = !0;
|
|
183
|
-
for (let h = 0; h < 12; h++) {
|
|
184
|
-
const m = p.nthVertex(r, h);
|
|
185
|
-
if (m[0] < 0) continue;
|
|
186
|
-
const g = p.hueOf(m);
|
|
187
|
-
c ? (u || p.areInCyclicOrder(i, g, s)) && (u = !1, p.areInCyclicOrder(i, t, g) ? (n = m, s = g) : (a = m, i = g)) : (a = m, n = m, i = g, s = g, c = !0);
|
|
188
|
-
}
|
|
189
|
-
return [a, n];
|
|
190
|
-
}
|
|
191
|
-
static midpoint(r, t) {
|
|
192
|
-
return [(r[0] + t[0]) / 2, (r[1] + t[1]) / 2, (r[2] + t[2]) / 2];
|
|
193
|
-
}
|
|
194
|
-
static criticalPlaneBelow(r) {
|
|
195
|
-
return Math.floor(r - 0.5);
|
|
196
|
-
}
|
|
197
|
-
static criticalPlaneAbove(r) {
|
|
198
|
-
return Math.ceil(r - 0.5);
|
|
199
|
-
}
|
|
200
|
-
static bisectToLimit(r, t) {
|
|
201
|
-
const a = p.bisectToSegment(r, t);
|
|
202
|
-
let n = a[0], i = p.hueOf(n), s = a[1];
|
|
203
|
-
for (let c = 0; c < 3; c++) if (n[c] !== s[c]) {
|
|
204
|
-
let u = -1, h = 255;
|
|
205
|
-
n[c] < s[c] ? (u = p.criticalPlaneBelow(p.trueDelinearized(n[c])), h = p.criticalPlaneAbove(p.trueDelinearized(s[c]))) : (u = p.criticalPlaneAbove(p.trueDelinearized(n[c])), h = p.criticalPlaneBelow(p.trueDelinearized(s[c])));
|
|
206
|
-
for (let m = 0; m < 8 && !(Math.abs(h - u) <= 1); m++) {
|
|
207
|
-
const g = Math.floor((u + h) / 2), y = p.CRITICAL_PLANES[g], P = p.setCoordinate(n, y, s, c), f = p.hueOf(P);
|
|
208
|
-
p.areInCyclicOrder(i, t, f) ? (s = P, h = g) : (n = P, i = f, u = g);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return p.midpoint(n, s);
|
|
212
|
-
}
|
|
213
|
-
static inverseChromaticAdaptation(r) {
|
|
214
|
-
const t = Math.abs(r), a = Math.max(0, 27.13 * t / (400 - t));
|
|
215
|
-
return N(r) * Math.pow(a, 1 / 0.42);
|
|
216
|
-
}
|
|
217
|
-
static findResultByJ(r, t, a) {
|
|
218
|
-
let n = 11 * Math.sqrt(a);
|
|
219
|
-
const i = V.DEFAULT, s = 1 / Math.pow(1.64 - Math.pow(0.29, i.n), 0.73), c = 0.25 * (Math.cos(r + 2) + 3.8) * (5e4 / 13) * i.nc * i.ncb, u = Math.sin(r), h = Math.cos(r);
|
|
220
|
-
for (let m = 0; m < 5; m++) {
|
|
221
|
-
const g = n / 100, y = t === 0 || n === 0 ? 0 : t / Math.sqrt(g), P = Math.pow(y * s, 1 / 0.9), f = i.aw * Math.pow(g, 1 / i.c / i.z) / i.nbb, k = 23 * (f + 0.305) * P / (23 * c + 11 * P * h + 108 * P * u), M = k * h, v = k * u, C = (460 * f + 451 * M + 288 * v) / 1403, O = (460 * f - 891 * M - 261 * v) / 1403, x = (460 * f - 220 * M - 6300 * v) / 1403, w = ue([p.inverseChromaticAdaptation(C), p.inverseChromaticAdaptation(O), p.inverseChromaticAdaptation(x)], p.LINRGB_FROM_SCALED_DISCOUNT);
|
|
222
|
-
if (w[0] < 0 || w[1] < 0 || w[2] < 0) return 0;
|
|
223
|
-
const S = p.Y_FROM_LINRGB[0], b = p.Y_FROM_LINRGB[1], T = p.Y_FROM_LINRGB[2], I = S * w[0] + b * w[1] + T * w[2];
|
|
224
|
-
if (I <= 0) return 0;
|
|
225
|
-
if (m === 4 || Math.abs(I - a) < 2e-3) return w[0] > 100.01 || w[1] > 100.01 || w[2] > 100.01 ? 0 : ye(w);
|
|
226
|
-
n -= (I - a) * n / (2 * I);
|
|
227
|
-
}
|
|
228
|
-
return 0;
|
|
229
|
-
}
|
|
230
|
-
static solveToInt(r, t, a) {
|
|
231
|
-
if (t < 1e-4 || a < 1e-4 || a > 99.9999) return function(c) {
|
|
232
|
-
const u = J(G(c));
|
|
233
|
-
return me(u, u, u);
|
|
234
|
-
}(a);
|
|
235
|
-
const n = (r = ce(r)) / 180 * Math.PI, i = G(a), s = p.findResultByJ(n, t, i);
|
|
236
|
-
return s !== 0 ? s : ye(p.bisectToLimit(i, n));
|
|
237
|
-
}
|
|
238
|
-
static solveToCam(r, t, a) {
|
|
239
|
-
return L.fromInt(p.solveToInt(r, t, a));
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
p.SCALED_DISCOUNT_FROM_LINRGB = [[0.001200833568784504, 0.002389694492170889, 2795742885861124e-19], [5891086651375999e-19, 0.0029785502573438758, 3270666104008398e-19], [10146692491640572e-20, 5364214359186694e-19, 0.0032979401770712076]], p.LINRGB_FROM_SCALED_DISCOUNT = [[1373.2198709594231, -1100.4251190754821, -7.278681089101213], [-271.815969077903, 559.6580465940733, -32.46047482791194], [1.9622899599665666, -57.173814538844006, 308.7233197812385]], p.Y_FROM_LINRGB = [0.2126, 0.7152, 0.0722], p.CRITICAL_PLANES = [0.015176349177441876, 0.045529047532325624, 0.07588174588720938, 0.10623444424209313, 0.13658714259697685, 0.16693984095186062, 0.19729253930674434, 0.2276452376616281, 0.2579979360165119, 0.28835063437139563, 0.3188300904430532, 0.350925934958123, 0.3848314933096426, 0.42057480301049466, 0.458183274052838, 0.4976837250274023, 0.5391024159806381, 0.5824650784040898, 0.6277969426914107, 0.6751227633498623, 0.7244668422128921, 0.775853049866786, 0.829304845476233, 0.8848452951698498, 0.942497089126609, 1.0022825574869039, 1.0642236851973577, 1.1283421258858297, 1.1946592148522128, 1.2631959812511864, 1.3339731595349034, 1.407011200216447, 1.4823302800086415, 1.5599503113873272, 1.6398909516233677, 1.7221716113234105, 1.8068114625156377, 1.8938294463134073, 1.9832442801866852, 2.075074464868551, 2.1693382909216234, 2.2660538449872063, 2.36523901573795, 2.4669114995532007, 2.5710888059345764, 2.6777882626779785, 2.7870270208169257, 2.898822059350997, 3.0131901897720907, 3.1301480604002863, 3.2497121605402226, 3.3718988244681087, 3.4967242352587946, 3.624204428461639, 3.754355295633311, 3.887192587735158, 4.022731918402185, 4.160988767090289, 4.301978482107941, 4.445716283538092, 4.592217266055746, 4.741496401646282, 4.893568542229298, 5.048448422192488, 5.20615066083972, 5.3666897647573375, 5.5300801301023865, 5.696336044816294, 5.865471690767354, 6.037501145825082, 6.212438385869475, 6.390297286737924, 6.571091626112461, 6.7548350853498045, 6.941541251256611, 7.131223617812143, 7.323895587840543, 7.5195704746346665, 7.7182615035334345, 7.919981813454504, 8.124744458384042, 8.332562408825165, 8.543448553206703, 8.757415699253682, 8.974476575321063, 9.194643831691977, 9.417930041841839, 9.644347703669503, 9.873909240696694, 10.106627003236781, 10.342513269534024, 10.58158024687427, 10.8238400726681, 11.069304815507364, 11.317986476196008, 11.569896988756009, 11.825048221409341, 12.083451977536606, 12.345119996613247, 12.610063955123938, 12.878295467455942, 13.149826086772048, 13.42466730586372, 13.702830557985108, 13.984327217668513, 14.269168601521828, 14.55736596900856, 14.848930523210871, 15.143873411576273, 15.44220572664832, 15.743938506781891, 16.04908273684337, 16.35764934889634, 16.66964922287304, 16.985093187232053, 17.30399201960269, 17.62635644741625, 17.95219714852476, 18.281524751807332, 18.614349837764564, 18.95068293910138, 19.290534541298456, 19.633915083172692, 19.98083495742689, 20.331304511189067, 20.685334046541502, 21.042933821039977, 21.404114048223256, 21.76888489811322, 22.137256497705877, 22.50923893145328, 22.884842241736916, 23.264076429332462, 23.6469514538663, 24.033477234264016, 24.42366364919083, 24.817520537484558, 25.21505769858089, 25.61628489293138, 26.021211842414342, 26.429848230738664, 26.842203703840827, 27.258287870275353, 27.678110301598522, 28.10168053274597, 28.529008062403893, 28.96010235337422, 29.39497283293396, 29.83362889318845, 30.276079891419332, 30.722335150426627, 31.172403958865512, 31.62629557157785, 32.08401920991837, 32.54558406207592, 33.010999283389665, 33.4802739966603, 33.953417292456834, 34.430438229418264, 34.911345834551085, 35.39614910352207, 35.88485700094671, 36.37747846067349, 36.87402238606382, 37.37449765026789, 37.87891309649659, 38.38727753828926, 38.89959975977785, 39.41588851594697, 39.93615253289054, 40.460400508064545, 40.98864111053629, 41.520882981230194, 42.05713473317016, 42.597404951718396, 43.141702194811224, 43.6900349931913, 44.24241185063697, 44.798841244188324, 45.35933162437017, 45.92389141541209, 46.49252901546552, 47.065252796817916, 47.64207110610409, 48.22299226451468, 48.808024568002054, 49.3971762874833, 49.9904556690408, 50.587870934119984, 51.189430279724725, 51.79514187861014, 52.40501387947288, 53.0190544071392, 53.637271562750364, 54.259673423945976, 54.88626804504493, 55.517063457223934, 56.15206766869424, 56.79128866487574, 57.43473440856916, 58.08241284012621, 58.734331877617365, 59.39049941699807, 60.05092333227251, 60.715611475655585, 61.38457167773311, 62.057811747619894, 62.7353394731159, 63.417162620860914, 64.10328893648692, 64.79372614476921, 65.48848194977529, 66.18756403501224, 66.89098006357258, 67.59873767827808, 68.31084450182222, 69.02730813691093, 69.74813616640164, 70.47333615344107, 71.20291564160104, 71.93688215501312, 72.67524319850172, 73.41800625771542, 74.16517879925733, 74.9167682708136, 75.67278210128072, 76.43322770089146, 77.1981124613393, 77.96744375590167, 78.74122893956174, 79.51947534912904, 80.30219030335869, 81.08938110306934, 81.88105503125999, 82.67721935322541, 83.4778813166706, 84.28304815182372, 85.09272707154808, 85.90692527145302, 86.72564993000343, 87.54890820862819, 88.3767072518277, 89.2090541872801, 90.04595612594655, 90.88742016217518, 91.73345337380438, 92.58406282226491, 93.43925555268066, 94.29903859396902, 95.16341895893969, 96.03240364439274, 96.9059996312159, 97.78421388448044, 98.6670533535366, 99.55452497210776];
|
|
243
|
-
class B {
|
|
244
|
-
static from(r, t, a) {
|
|
245
|
-
return new B(p.solveToInt(r, t, a));
|
|
246
|
-
}
|
|
247
|
-
static fromInt(r) {
|
|
248
|
-
return new B(r);
|
|
249
|
-
}
|
|
250
|
-
toInt() {
|
|
251
|
-
return this.argb;
|
|
252
|
-
}
|
|
253
|
-
get hue() {
|
|
254
|
-
return this.internalHue;
|
|
255
|
-
}
|
|
256
|
-
set hue(r) {
|
|
257
|
-
this.setInternalState(p.solveToInt(r, this.internalChroma, this.internalTone));
|
|
258
|
-
}
|
|
259
|
-
get chroma() {
|
|
260
|
-
return this.internalChroma;
|
|
261
|
-
}
|
|
262
|
-
set chroma(r) {
|
|
263
|
-
this.setInternalState(p.solveToInt(this.internalHue, r, this.internalTone));
|
|
264
|
-
}
|
|
265
|
-
get tone() {
|
|
266
|
-
return this.internalTone;
|
|
267
|
-
}
|
|
268
|
-
set tone(r) {
|
|
269
|
-
this.setInternalState(p.solveToInt(this.internalHue, this.internalChroma, r));
|
|
270
|
-
}
|
|
271
|
-
constructor(r) {
|
|
272
|
-
this.argb = r;
|
|
273
|
-
const t = L.fromInt(r);
|
|
274
|
-
this.internalHue = t.hue, this.internalChroma = t.chroma, this.internalTone = he(r), this.argb = r;
|
|
275
|
-
}
|
|
276
|
-
setInternalState(r) {
|
|
277
|
-
const t = L.fromInt(r);
|
|
278
|
-
this.internalHue = t.hue, this.internalChroma = t.chroma, this.internalTone = he(r), this.argb = r;
|
|
279
|
-
}
|
|
280
|
-
inViewingConditions(r) {
|
|
281
|
-
const t = L.fromInt(this.toInt()).xyzInViewingConditions(r), a = L.fromXyzInViewingConditions(t[0], t[1], t[2], V.make());
|
|
282
|
-
return B.from(a.hue, a.chroma, le(t[1]));
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
class pe {
|
|
286
|
-
static harmonize(r, t) {
|
|
287
|
-
const a = B.fromInt(r), n = B.fromInt(t), i = (s = a.hue, c = n.hue, 180 - Math.abs(Math.abs(s - c) - 180));
|
|
288
|
-
var s, c;
|
|
289
|
-
const u = Math.min(0.5 * i, 15), h = ce(a.hue + u * (m = a.hue, ce(n.hue - m) <= 180 ? 1 : -1));
|
|
290
|
-
var m;
|
|
291
|
-
return B.from(h, a.chroma, a.tone).toInt();
|
|
292
|
-
}
|
|
293
|
-
static hctHue(r, t, a) {
|
|
294
|
-
const n = pe.cam16Ucs(r, t, a), i = L.fromInt(n), s = L.fromInt(r);
|
|
295
|
-
return B.from(i.hue, s.chroma, he(r)).toInt();
|
|
296
|
-
}
|
|
297
|
-
static cam16Ucs(r, t, a) {
|
|
298
|
-
const n = L.fromInt(r), i = L.fromInt(t), s = n.jstar, c = n.astar, u = n.bstar, h = s + (i.jstar - s) * a, m = c + (i.astar - c) * a, g = u + (i.bstar - u) * a;
|
|
299
|
-
return L.fromUcs(h, m, g).toInt();
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
class F {
|
|
303
|
-
static ratioOfTones(r, t) {
|
|
304
|
-
return r = oe(0, 100, r), t = oe(0, 100, t), F.ratioOfYs(G(r), G(t));
|
|
305
|
-
}
|
|
306
|
-
static ratioOfYs(r, t) {
|
|
307
|
-
const a = r > t ? r : t;
|
|
308
|
-
return (a + 5) / ((a === t ? r : t) + 5);
|
|
309
|
-
}
|
|
310
|
-
static lighter(r, t) {
|
|
311
|
-
if (r < 0 || r > 100) return -1;
|
|
312
|
-
const a = G(r), n = t * (a + 5) - 5, i = F.ratioOfYs(n, a), s = Math.abs(i - t);
|
|
313
|
-
if (i < t && s > 0.04) return -1;
|
|
314
|
-
const c = le(n) + 0.4;
|
|
315
|
-
return c < 0 || c > 100 ? -1 : c;
|
|
316
|
-
}
|
|
317
|
-
static darker(r, t) {
|
|
318
|
-
if (r < 0 || r > 100) return -1;
|
|
319
|
-
const a = G(r), n = (a + 5) / t - 5, i = F.ratioOfYs(a, n), s = Math.abs(i - t);
|
|
320
|
-
if (i < t && s > 0.04) return -1;
|
|
321
|
-
const c = le(n) - 0.4;
|
|
322
|
-
return c < 0 || c > 100 ? -1 : c;
|
|
323
|
-
}
|
|
324
|
-
static lighterUnsafe(r, t) {
|
|
325
|
-
const a = F.lighter(r, t);
|
|
326
|
-
return a < 0 ? 100 : a;
|
|
327
|
-
}
|
|
328
|
-
static darkerUnsafe(r, t) {
|
|
329
|
-
const a = F.darker(r, t);
|
|
330
|
-
return a < 0 ? 0 : a;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
class de {
|
|
334
|
-
static isDisliked(r) {
|
|
335
|
-
const t = Math.round(r.hue) >= 90 && Math.round(r.hue) <= 111, a = Math.round(r.chroma) > 16, n = Math.round(r.tone) < 65;
|
|
336
|
-
return t && a && n;
|
|
337
|
-
}
|
|
338
|
-
static fixIfDisliked(r) {
|
|
339
|
-
return de.isDisliked(r) ? B.from(r.hue, r.chroma, 70) : r;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
class l {
|
|
343
|
-
static fromPalette(r) {
|
|
344
|
-
return new l(r.name ?? "", r.palette, r.tone, r.isBackground ?? !1, r.background, r.secondBackground, r.contrastCurve, r.toneDeltaPair);
|
|
345
|
-
}
|
|
346
|
-
constructor(r, t, a, n, i, s, c, u) {
|
|
347
|
-
if (this.name = r, this.palette = t, this.tone = a, this.isBackground = n, this.background = i, this.secondBackground = s, this.contrastCurve = c, this.toneDeltaPair = u, this.hctCache = /* @__PURE__ */ new Map(), !i && s) throw new Error(`Color ${r} has secondBackgrounddefined, but background is not defined.`);
|
|
348
|
-
if (!i && c) throw new Error(`Color ${r} has contrastCurvedefined, but background is not defined.`);
|
|
349
|
-
if (i && !c) throw new Error(`Color ${r} has backgrounddefined, but contrastCurve is not defined.`);
|
|
350
|
-
}
|
|
351
|
-
getArgb(r) {
|
|
352
|
-
return this.getHct(r).toInt();
|
|
353
|
-
}
|
|
354
|
-
getHct(r) {
|
|
355
|
-
const t = this.hctCache.get(r);
|
|
356
|
-
if (t != null) return t;
|
|
357
|
-
const a = this.getTone(r), n = this.palette(r).getHct(a);
|
|
358
|
-
return this.hctCache.size > 4 && this.hctCache.clear(), this.hctCache.set(r, n), n;
|
|
359
|
-
}
|
|
360
|
-
getTone(r) {
|
|
361
|
-
const t = r.contrastLevel < 0;
|
|
362
|
-
if (this.toneDeltaPair) {
|
|
363
|
-
const a = this.toneDeltaPair(r), n = a.roleA, i = a.roleB, s = a.delta, c = a.polarity, u = a.stayTogether, h = this.background(r).getTone(r), m = c === "nearer" || c === "lighter" && !r.isDark || c === "darker" && r.isDark, g = m ? n : i, y = m ? i : n, P = this.name === g.name, f = r.isDark ? 1 : -1, k = g.contrastCurve.get(r.contrastLevel), M = y.contrastCurve.get(r.contrastLevel), v = g.tone(r);
|
|
364
|
-
let C = F.ratioOfTones(h, v) >= k ? v : l.foregroundTone(h, k);
|
|
365
|
-
const O = y.tone(r);
|
|
366
|
-
let x = F.ratioOfTones(h, O) >= M ? O : l.foregroundTone(h, M);
|
|
367
|
-
return t && (C = l.foregroundTone(h, k), x = l.foregroundTone(h, M)), (x - C) * f >= s || (x = oe(0, 100, C + s * f), (x - C) * f >= s || (C = oe(0, 100, x - s * f))), 50 <= C && C < 60 ? f > 0 ? (C = 60, x = Math.max(x, C + s * f)) : (C = 49, x = Math.min(x, C + s * f)) : 50 <= x && x < 60 && (u ? f > 0 ? (C = 60, x = Math.max(x, C + s * f)) : (C = 49, x = Math.min(x, C + s * f)) : x = f > 0 ? 60 : 49), P ? C : x;
|
|
368
|
-
}
|
|
369
|
-
{
|
|
370
|
-
let a = this.tone(r);
|
|
371
|
-
if (this.background == null) return a;
|
|
372
|
-
const n = this.background(r).getTone(r), i = this.contrastCurve.get(r.contrastLevel);
|
|
373
|
-
if (F.ratioOfTones(n, a) >= i || (a = l.foregroundTone(n, i)), t && (a = l.foregroundTone(n, i)), this.isBackground && 50 <= a && a < 60 && (a = F.ratioOfTones(49, n) >= i ? 49 : 60), this.secondBackground) {
|
|
374
|
-
const [s, c] = [this.background, this.secondBackground], [u, h] = [s(r).getTone(r), c(r).getTone(r)], [m, g] = [Math.max(u, h), Math.min(u, h)];
|
|
375
|
-
if (F.ratioOfTones(m, a) >= i && F.ratioOfTones(g, a) >= i) return a;
|
|
376
|
-
const y = F.lighter(m, i), P = F.darker(g, i), f = [];
|
|
377
|
-
return y !== -1 && f.push(y), P !== -1 && f.push(P), l.tonePrefersLightForeground(u) || l.tonePrefersLightForeground(h) ? y < 0 ? 100 : y : f.length === 1 ? f[0] : P < 0 ? 0 : P;
|
|
378
|
-
}
|
|
379
|
-
return a;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
static foregroundTone(r, t) {
|
|
383
|
-
const a = F.lighterUnsafe(r, t), n = F.darkerUnsafe(r, t), i = F.ratioOfTones(a, r), s = F.ratioOfTones(n, r);
|
|
384
|
-
if (l.tonePrefersLightForeground(r)) {
|
|
385
|
-
const c = Math.abs(i - s) < 0.1 && i < t && s < t;
|
|
386
|
-
return i >= t || i >= s || c ? a : n;
|
|
387
|
-
}
|
|
388
|
-
return s >= t || s >= i ? n : a;
|
|
389
|
-
}
|
|
390
|
-
static tonePrefersLightForeground(r) {
|
|
391
|
-
return Math.round(r) < 60;
|
|
392
|
-
}
|
|
393
|
-
static toneAllowsLightForeground(r) {
|
|
394
|
-
return Math.round(r) <= 49;
|
|
395
|
-
}
|
|
396
|
-
static enableLightForeground(r) {
|
|
397
|
-
return l.tonePrefersLightForeground(r) && !l.toneAllowsLightForeground(r) ? 49 : r;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
class A {
|
|
401
|
-
static fromInt(r) {
|
|
402
|
-
const t = B.fromInt(r);
|
|
403
|
-
return A.fromHct(t);
|
|
404
|
-
}
|
|
405
|
-
static fromHct(r) {
|
|
406
|
-
return new A(r.hue, r.chroma, r);
|
|
407
|
-
}
|
|
408
|
-
static fromHueAndChroma(r, t) {
|
|
409
|
-
const a = new Ee(r, t).create();
|
|
410
|
-
return new A(r, t, a);
|
|
411
|
-
}
|
|
412
|
-
constructor(r, t, a) {
|
|
413
|
-
this.hue = r, this.chroma = t, this.keyColor = a, this.cache = /* @__PURE__ */ new Map();
|
|
414
|
-
}
|
|
415
|
-
tone(r) {
|
|
416
|
-
let t = this.cache.get(r);
|
|
417
|
-
return t === void 0 && (t = B.from(this.hue, this.chroma, r).toInt(), this.cache.set(r, t)), t;
|
|
418
|
-
}
|
|
419
|
-
getHct(r) {
|
|
420
|
-
return B.fromInt(this.tone(r));
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
class Ee {
|
|
424
|
-
constructor(r, t) {
|
|
425
|
-
this.hue = r, this.requestedChroma = t, this.chromaCache = /* @__PURE__ */ new Map(), this.maxChromaValue = 200;
|
|
426
|
-
}
|
|
427
|
-
create() {
|
|
428
|
-
let r = 0, t = 100;
|
|
429
|
-
for (; r < t; ) {
|
|
430
|
-
const a = Math.floor((r + t) / 2), n = this.maxChroma(a) < this.maxChroma(a + 1);
|
|
431
|
-
if (this.maxChroma(a) >= this.requestedChroma - 0.01) if (Math.abs(r - 50) < Math.abs(t - 50)) t = a;
|
|
432
|
-
else {
|
|
433
|
-
if (r === a) return B.from(this.hue, this.requestedChroma, r);
|
|
434
|
-
r = a;
|
|
435
|
-
}
|
|
436
|
-
else n ? r = a + 1 : t = a;
|
|
437
|
-
}
|
|
438
|
-
return B.from(this.hue, this.requestedChroma, r);
|
|
439
|
-
}
|
|
440
|
-
maxChroma(r) {
|
|
441
|
-
if (this.chromaCache.has(r)) return this.chromaCache.get(r);
|
|
442
|
-
const t = B.from(this.hue, this.maxChromaValue, r).chroma;
|
|
443
|
-
return this.chromaCache.set(r, t), t;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
class d {
|
|
447
|
-
constructor(r, t, a, n) {
|
|
448
|
-
this.low = r, this.normal = t, this.medium = a, this.high = n;
|
|
449
|
-
}
|
|
450
|
-
get(r) {
|
|
451
|
-
return r <= -1 ? this.low : r < 0 ? Z(this.low, this.normal, (r - -1) / 1) : r < 0.5 ? Z(this.normal, this.medium, (r - 0) / 0.5) : r < 1 ? Z(this.medium, this.high, (r - 0.5) / 0.5) : this.high;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
class E {
|
|
455
|
-
constructor(r, t, a, n, i) {
|
|
456
|
-
this.roleA = r, this.roleB = t, this.delta = a, this.polarity = n, this.stayTogether = i;
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
var $;
|
|
460
|
-
function K(e) {
|
|
461
|
-
return e.variant === $.FIDELITY || e.variant === $.CONTENT;
|
|
462
|
-
}
|
|
463
|
-
function D(e) {
|
|
464
|
-
return e.variant === $.MONOCHROME;
|
|
465
|
-
}
|
|
466
|
-
(function(e) {
|
|
467
|
-
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";
|
|
468
|
-
})($ || ($ = {}));
|
|
469
|
-
class o {
|
|
470
|
-
static highestSurface(r) {
|
|
471
|
-
return r.isDark ? o.surfaceBright : o.surfaceDim;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
o.contentAccentToneDelta = 15, o.primaryPaletteKeyColor = l.fromPalette({ name: "primary_palette_key_color", palette: (e) => e.primaryPalette, tone: (e) => e.primaryPalette.keyColor.tone }), o.secondaryPaletteKeyColor = l.fromPalette({ name: "secondary_palette_key_color", palette: (e) => e.secondaryPalette, tone: (e) => e.secondaryPalette.keyColor.tone }), o.tertiaryPaletteKeyColor = l.fromPalette({ name: "tertiary_palette_key_color", palette: (e) => e.tertiaryPalette, tone: (e) => e.tertiaryPalette.keyColor.tone }), o.neutralPaletteKeyColor = l.fromPalette({ name: "neutral_palette_key_color", palette: (e) => e.neutralPalette, tone: (e) => e.neutralPalette.keyColor.tone }), o.neutralVariantPaletteKeyColor = l.fromPalette({ name: "neutral_variant_palette_key_color", palette: (e) => e.neutralVariantPalette, tone: (e) => e.neutralVariantPalette.keyColor.tone }), o.background = l.fromPalette({ name: "background", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? 6 : 98, isBackground: !0 }), o.onBackground = l.fromPalette({ name: "on_background", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? 90 : 10, background: (e) => o.background, contrastCurve: new d(3, 3, 4.5, 7) }), o.surface = l.fromPalette({ name: "surface", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? 6 : 98, isBackground: !0 }), o.surfaceDim = l.fromPalette({ name: "surface_dim", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? 6 : new d(87, 87, 80, 75).get(e.contrastLevel), isBackground: !0 }), o.surfaceBright = l.fromPalette({ name: "surface_bright", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? new d(24, 24, 29, 34).get(e.contrastLevel) : 98, isBackground: !0 }), o.surfaceContainerLowest = l.fromPalette({ name: "surface_container_lowest", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? new d(4, 4, 2, 0).get(e.contrastLevel) : 100, isBackground: !0 }), o.surfaceContainerLow = l.fromPalette({ name: "surface_container_low", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? new d(10, 10, 11, 12).get(e.contrastLevel) : new d(96, 96, 96, 95).get(e.contrastLevel), isBackground: !0 }), o.surfaceContainer = l.fromPalette({ name: "surface_container", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? new d(12, 12, 16, 20).get(e.contrastLevel) : new d(94, 94, 92, 90).get(e.contrastLevel), isBackground: !0 }), o.surfaceContainerHigh = l.fromPalette({ name: "surface_container_high", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? new d(17, 17, 21, 25).get(e.contrastLevel) : new d(92, 92, 88, 85).get(e.contrastLevel), isBackground: !0 }), o.surfaceContainerHighest = l.fromPalette({ name: "surface_container_highest", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? new d(22, 22, 26, 30).get(e.contrastLevel) : new d(90, 90, 84, 80).get(e.contrastLevel), isBackground: !0 }), o.onSurface = l.fromPalette({ name: "on_surface", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? 90 : 10, background: (e) => o.highestSurface(e), contrastCurve: new d(4.5, 7, 11, 21) }), o.surfaceVariant = l.fromPalette({ name: "surface_variant", palette: (e) => e.neutralVariantPalette, tone: (e) => e.isDark ? 30 : 90, isBackground: !0 }), o.onSurfaceVariant = l.fromPalette({ name: "on_surface_variant", palette: (e) => e.neutralVariantPalette, tone: (e) => e.isDark ? 80 : 30, background: (e) => o.highestSurface(e), contrastCurve: new d(3, 4.5, 7, 11) }), o.inverseSurface = l.fromPalette({ name: "inverse_surface", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? 90 : 20 }), o.inverseOnSurface = l.fromPalette({ name: "inverse_on_surface", palette: (e) => e.neutralPalette, tone: (e) => e.isDark ? 20 : 95, background: (e) => o.inverseSurface, contrastCurve: new d(4.5, 7, 11, 21) }), o.outline = l.fromPalette({ name: "outline", palette: (e) => e.neutralVariantPalette, tone: (e) => e.isDark ? 60 : 50, background: (e) => o.highestSurface(e), contrastCurve: new d(1.5, 3, 4.5, 7) }), o.outlineVariant = l.fromPalette({ name: "outline_variant", palette: (e) => e.neutralVariantPalette, tone: (e) => e.isDark ? 30 : 80, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5) }), o.shadow = l.fromPalette({ name: "shadow", palette: (e) => e.neutralPalette, tone: (e) => 0 }), o.scrim = l.fromPalette({ name: "scrim", palette: (e) => e.neutralPalette, tone: (e) => 0 }), o.surfaceTint = l.fromPalette({ name: "surface_tint", palette: (e) => e.primaryPalette, tone: (e) => e.isDark ? 80 : 40, isBackground: !0 }), o.primary = l.fromPalette({ name: "primary", palette: (e) => e.primaryPalette, tone: (e) => D(e) ? e.isDark ? 100 : 0 : e.isDark ? 80 : 40, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(3, 4.5, 7, 7), toneDeltaPair: (e) => new E(o.primaryContainer, o.primary, 10, "nearer", !1) }), o.onPrimary = l.fromPalette({ name: "on_primary", palette: (e) => e.primaryPalette, tone: (e) => D(e) ? e.isDark ? 10 : 90 : e.isDark ? 20 : 100, background: (e) => o.primary, contrastCurve: new d(4.5, 7, 11, 21) }), o.primaryContainer = l.fromPalette({ name: "primary_container", palette: (e) => e.primaryPalette, tone: (e) => K(e) ? e.sourceColorHct.tone : D(e) ? e.isDark ? 85 : 25 : e.isDark ? 30 : 90, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.primaryContainer, o.primary, 10, "nearer", !1) }), o.onPrimaryContainer = l.fromPalette({ name: "on_primary_container", palette: (e) => e.primaryPalette, tone: (e) => K(e) ? l.foregroundTone(o.primaryContainer.tone(e), 4.5) : D(e) ? e.isDark ? 0 : 100 : e.isDark ? 90 : 30, background: (e) => o.primaryContainer, contrastCurve: new d(3, 4.5, 7, 11) }), o.inversePrimary = l.fromPalette({ name: "inverse_primary", palette: (e) => e.primaryPalette, tone: (e) => e.isDark ? 40 : 80, background: (e) => o.inverseSurface, contrastCurve: new d(3, 4.5, 7, 7) }), o.secondary = l.fromPalette({ name: "secondary", palette: (e) => e.secondaryPalette, tone: (e) => e.isDark ? 80 : 40, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(3, 4.5, 7, 7), toneDeltaPair: (e) => new E(o.secondaryContainer, o.secondary, 10, "nearer", !1) }), o.onSecondary = l.fromPalette({ name: "on_secondary", palette: (e) => e.secondaryPalette, tone: (e) => D(e) ? e.isDark ? 10 : 100 : e.isDark ? 20 : 100, background: (e) => o.secondary, contrastCurve: new d(4.5, 7, 11, 21) }), o.secondaryContainer = l.fromPalette({ name: "secondary_container", palette: (e) => e.secondaryPalette, tone: (e) => {
|
|
475
|
-
const r = e.isDark ? 30 : 90;
|
|
476
|
-
return D(e) ? e.isDark ? 30 : 85 : K(e) ? function(t, a, n, i) {
|
|
477
|
-
let s = n, c = B.from(t, a, n);
|
|
478
|
-
if (c.chroma < a) {
|
|
479
|
-
let u = c.chroma;
|
|
480
|
-
for (; c.chroma < a; ) {
|
|
481
|
-
s += i ? -1 : 1;
|
|
482
|
-
const h = B.from(t, a, s);
|
|
483
|
-
if (u > h.chroma || Math.abs(h.chroma - a) < 0.4) break;
|
|
484
|
-
Math.abs(h.chroma - a) < Math.abs(c.chroma - a) && (c = h), u = Math.max(u, h.chroma);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
return s;
|
|
488
|
-
}(e.secondaryPalette.hue, e.secondaryPalette.chroma, r, !e.isDark) : r;
|
|
489
|
-
}, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.secondaryContainer, o.secondary, 10, "nearer", !1) }), o.onSecondaryContainer = l.fromPalette({ name: "on_secondary_container", palette: (e) => e.secondaryPalette, tone: (e) => D(e) ? e.isDark ? 90 : 10 : K(e) ? l.foregroundTone(o.secondaryContainer.tone(e), 4.5) : e.isDark ? 90 : 30, background: (e) => o.secondaryContainer, contrastCurve: new d(3, 4.5, 7, 11) }), o.tertiary = l.fromPalette({ name: "tertiary", palette: (e) => e.tertiaryPalette, tone: (e) => D(e) ? e.isDark ? 90 : 25 : e.isDark ? 80 : 40, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(3, 4.5, 7, 7), toneDeltaPair: (e) => new E(o.tertiaryContainer, o.tertiary, 10, "nearer", !1) }), o.onTertiary = l.fromPalette({ name: "on_tertiary", palette: (e) => e.tertiaryPalette, tone: (e) => D(e) ? e.isDark ? 10 : 90 : e.isDark ? 20 : 100, background: (e) => o.tertiary, contrastCurve: new d(4.5, 7, 11, 21) }), o.tertiaryContainer = l.fromPalette({ name: "tertiary_container", palette: (e) => e.tertiaryPalette, tone: (e) => {
|
|
490
|
-
if (D(e)) return e.isDark ? 60 : 49;
|
|
491
|
-
if (!K(e)) return e.isDark ? 30 : 90;
|
|
492
|
-
const r = e.tertiaryPalette.getHct(e.sourceColorHct.tone);
|
|
493
|
-
return de.fixIfDisliked(r).tone;
|
|
494
|
-
}, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.tertiaryContainer, o.tertiary, 10, "nearer", !1) }), o.onTertiaryContainer = l.fromPalette({ name: "on_tertiary_container", palette: (e) => e.tertiaryPalette, tone: (e) => D(e) ? e.isDark ? 0 : 100 : K(e) ? l.foregroundTone(o.tertiaryContainer.tone(e), 4.5) : e.isDark ? 90 : 30, background: (e) => o.tertiaryContainer, contrastCurve: new d(3, 4.5, 7, 11) }), o.error = l.fromPalette({ name: "error", palette: (e) => e.errorPalette, tone: (e) => e.isDark ? 80 : 40, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(3, 4.5, 7, 7), toneDeltaPair: (e) => new E(o.errorContainer, o.error, 10, "nearer", !1) }), o.onError = l.fromPalette({ name: "on_error", palette: (e) => e.errorPalette, tone: (e) => e.isDark ? 20 : 100, background: (e) => o.error, contrastCurve: new d(4.5, 7, 11, 21) }), o.errorContainer = l.fromPalette({ name: "error_container", palette: (e) => e.errorPalette, tone: (e) => e.isDark ? 30 : 90, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.errorContainer, o.error, 10, "nearer", !1) }), o.onErrorContainer = l.fromPalette({ name: "on_error_container", palette: (e) => e.errorPalette, tone: (e) => D(e) ? e.isDark ? 90 : 10 : e.isDark ? 90 : 30, background: (e) => o.errorContainer, contrastCurve: new d(3, 4.5, 7, 11) }), o.primaryFixed = l.fromPalette({ name: "primary_fixed", palette: (e) => e.primaryPalette, tone: (e) => D(e) ? 40 : 90, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.primaryFixed, o.primaryFixedDim, 10, "lighter", !0) }), o.primaryFixedDim = l.fromPalette({ name: "primary_fixed_dim", palette: (e) => e.primaryPalette, tone: (e) => D(e) ? 30 : 80, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.primaryFixed, o.primaryFixedDim, 10, "lighter", !0) }), o.onPrimaryFixed = l.fromPalette({ name: "on_primary_fixed", palette: (e) => e.primaryPalette, tone: (e) => D(e) ? 100 : 10, background: (e) => o.primaryFixedDim, secondBackground: (e) => o.primaryFixed, contrastCurve: new d(4.5, 7, 11, 21) }), o.onPrimaryFixedVariant = l.fromPalette({ name: "on_primary_fixed_variant", palette: (e) => e.primaryPalette, tone: (e) => D(e) ? 90 : 30, background: (e) => o.primaryFixedDim, secondBackground: (e) => o.primaryFixed, contrastCurve: new d(3, 4.5, 7, 11) }), o.secondaryFixed = l.fromPalette({ name: "secondary_fixed", palette: (e) => e.secondaryPalette, tone: (e) => D(e) ? 80 : 90, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.secondaryFixed, o.secondaryFixedDim, 10, "lighter", !0) }), o.secondaryFixedDim = l.fromPalette({ name: "secondary_fixed_dim", palette: (e) => e.secondaryPalette, tone: (e) => D(e) ? 70 : 80, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.secondaryFixed, o.secondaryFixedDim, 10, "lighter", !0) }), o.onSecondaryFixed = l.fromPalette({ name: "on_secondary_fixed", palette: (e) => e.secondaryPalette, tone: (e) => 10, background: (e) => o.secondaryFixedDim, secondBackground: (e) => o.secondaryFixed, contrastCurve: new d(4.5, 7, 11, 21) }), o.onSecondaryFixedVariant = l.fromPalette({ name: "on_secondary_fixed_variant", palette: (e) => e.secondaryPalette, tone: (e) => D(e) ? 25 : 30, background: (e) => o.secondaryFixedDim, secondBackground: (e) => o.secondaryFixed, contrastCurve: new d(3, 4.5, 7, 11) }), o.tertiaryFixed = l.fromPalette({ name: "tertiary_fixed", palette: (e) => e.tertiaryPalette, tone: (e) => D(e) ? 40 : 90, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.tertiaryFixed, o.tertiaryFixedDim, 10, "lighter", !0) }), o.tertiaryFixedDim = l.fromPalette({ name: "tertiary_fixed_dim", palette: (e) => e.tertiaryPalette, tone: (e) => D(e) ? 30 : 80, isBackground: !0, background: (e) => o.highestSurface(e), contrastCurve: new d(1, 1, 3, 4.5), toneDeltaPair: (e) => new E(o.tertiaryFixed, o.tertiaryFixedDim, 10, "lighter", !0) }), o.onTertiaryFixed = l.fromPalette({ name: "on_tertiary_fixed", palette: (e) => e.tertiaryPalette, tone: (e) => D(e) ? 100 : 10, background: (e) => o.tertiaryFixedDim, secondBackground: (e) => o.tertiaryFixed, contrastCurve: new d(4.5, 7, 11, 21) }), o.onTertiaryFixedVariant = l.fromPalette({ name: "on_tertiary_fixed_variant", palette: (e) => e.tertiaryPalette, tone: (e) => D(e) ? 90 : 30, background: (e) => o.tertiaryFixedDim, secondBackground: (e) => o.tertiaryFixed, contrastCurve: new d(3, 4.5, 7, 11) });
|
|
495
|
-
class R {
|
|
496
|
-
static of(r) {
|
|
497
|
-
return new R(r, !1);
|
|
498
|
-
}
|
|
499
|
-
static contentOf(r) {
|
|
500
|
-
return new R(r, !0);
|
|
501
|
-
}
|
|
502
|
-
static fromColors(r) {
|
|
503
|
-
return R.createPaletteFromColors(!1, r);
|
|
504
|
-
}
|
|
505
|
-
static contentFromColors(r) {
|
|
506
|
-
return R.createPaletteFromColors(!0, r);
|
|
507
|
-
}
|
|
508
|
-
static createPaletteFromColors(r, t) {
|
|
509
|
-
const a = new R(t.primary, r);
|
|
510
|
-
if (t.secondary) {
|
|
511
|
-
const n = new R(t.secondary, r);
|
|
512
|
-
a.a2 = n.a1;
|
|
513
|
-
}
|
|
514
|
-
if (t.tertiary) {
|
|
515
|
-
const n = new R(t.tertiary, r);
|
|
516
|
-
a.a3 = n.a1;
|
|
517
|
-
}
|
|
518
|
-
if (t.error) {
|
|
519
|
-
const n = new R(t.error, r);
|
|
520
|
-
a.error = n.a1;
|
|
521
|
-
}
|
|
522
|
-
if (t.neutral) {
|
|
523
|
-
const n = new R(t.neutral, r);
|
|
524
|
-
a.n1 = n.n1;
|
|
525
|
-
}
|
|
526
|
-
if (t.neutralVariant) {
|
|
527
|
-
const n = new R(t.neutralVariant, r);
|
|
528
|
-
a.n2 = n.n2;
|
|
529
|
-
}
|
|
530
|
-
return a;
|
|
531
|
-
}
|
|
532
|
-
constructor(r, t) {
|
|
533
|
-
const a = B.fromInt(r), n = a.hue, i = a.chroma;
|
|
534
|
-
t ? (this.a1 = A.fromHueAndChroma(n, i), this.a2 = A.fromHueAndChroma(n, i / 3), this.a3 = A.fromHueAndChroma(n + 60, i / 2), this.n1 = A.fromHueAndChroma(n, Math.min(i / 12, 4)), this.n2 = A.fromHueAndChroma(n, Math.min(i / 6, 8))) : (this.a1 = A.fromHueAndChroma(n, Math.max(48, i)), this.a2 = A.fromHueAndChroma(n, 16), this.a3 = A.fromHueAndChroma(n + 60, 24), this.n1 = A.fromHueAndChroma(n, 4), this.n2 = A.fromHueAndChroma(n, 8)), this.error = A.fromHueAndChroma(25, 84);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
class Y {
|
|
538
|
-
get primary() {
|
|
539
|
-
return this.props.primary;
|
|
540
|
-
}
|
|
541
|
-
get onPrimary() {
|
|
542
|
-
return this.props.onPrimary;
|
|
543
|
-
}
|
|
544
|
-
get primaryContainer() {
|
|
545
|
-
return this.props.primaryContainer;
|
|
546
|
-
}
|
|
547
|
-
get onPrimaryContainer() {
|
|
548
|
-
return this.props.onPrimaryContainer;
|
|
549
|
-
}
|
|
550
|
-
get secondary() {
|
|
551
|
-
return this.props.secondary;
|
|
552
|
-
}
|
|
553
|
-
get onSecondary() {
|
|
554
|
-
return this.props.onSecondary;
|
|
555
|
-
}
|
|
556
|
-
get secondaryContainer() {
|
|
557
|
-
return this.props.secondaryContainer;
|
|
558
|
-
}
|
|
559
|
-
get onSecondaryContainer() {
|
|
560
|
-
return this.props.onSecondaryContainer;
|
|
561
|
-
}
|
|
562
|
-
get tertiary() {
|
|
563
|
-
return this.props.tertiary;
|
|
564
|
-
}
|
|
565
|
-
get onTertiary() {
|
|
566
|
-
return this.props.onTertiary;
|
|
567
|
-
}
|
|
568
|
-
get tertiaryContainer() {
|
|
569
|
-
return this.props.tertiaryContainer;
|
|
570
|
-
}
|
|
571
|
-
get onTertiaryContainer() {
|
|
572
|
-
return this.props.onTertiaryContainer;
|
|
573
|
-
}
|
|
574
|
-
get error() {
|
|
575
|
-
return this.props.error;
|
|
576
|
-
}
|
|
577
|
-
get onError() {
|
|
578
|
-
return this.props.onError;
|
|
579
|
-
}
|
|
580
|
-
get errorContainer() {
|
|
581
|
-
return this.props.errorContainer;
|
|
582
|
-
}
|
|
583
|
-
get onErrorContainer() {
|
|
584
|
-
return this.props.onErrorContainer;
|
|
585
|
-
}
|
|
586
|
-
get background() {
|
|
587
|
-
return this.props.background;
|
|
588
|
-
}
|
|
589
|
-
get onBackground() {
|
|
590
|
-
return this.props.onBackground;
|
|
591
|
-
}
|
|
592
|
-
get surface() {
|
|
593
|
-
return this.props.surface;
|
|
594
|
-
}
|
|
595
|
-
get onSurface() {
|
|
596
|
-
return this.props.onSurface;
|
|
597
|
-
}
|
|
598
|
-
get surfaceVariant() {
|
|
599
|
-
return this.props.surfaceVariant;
|
|
600
|
-
}
|
|
601
|
-
get onSurfaceVariant() {
|
|
602
|
-
return this.props.onSurfaceVariant;
|
|
603
|
-
}
|
|
604
|
-
get outline() {
|
|
605
|
-
return this.props.outline;
|
|
606
|
-
}
|
|
607
|
-
get outlineVariant() {
|
|
608
|
-
return this.props.outlineVariant;
|
|
609
|
-
}
|
|
610
|
-
get shadow() {
|
|
611
|
-
return this.props.shadow;
|
|
612
|
-
}
|
|
613
|
-
get scrim() {
|
|
614
|
-
return this.props.scrim;
|
|
615
|
-
}
|
|
616
|
-
get inverseSurface() {
|
|
617
|
-
return this.props.inverseSurface;
|
|
618
|
-
}
|
|
619
|
-
get inverseOnSurface() {
|
|
620
|
-
return this.props.inverseOnSurface;
|
|
621
|
-
}
|
|
622
|
-
get inversePrimary() {
|
|
623
|
-
return this.props.inversePrimary;
|
|
624
|
-
}
|
|
625
|
-
static light(r) {
|
|
626
|
-
return Y.lightFromCorePalette(R.of(r));
|
|
627
|
-
}
|
|
628
|
-
static dark(r) {
|
|
629
|
-
return Y.darkFromCorePalette(R.of(r));
|
|
630
|
-
}
|
|
631
|
-
static lightContent(r) {
|
|
632
|
-
return Y.lightFromCorePalette(R.contentOf(r));
|
|
633
|
-
}
|
|
634
|
-
static darkContent(r) {
|
|
635
|
-
return Y.darkFromCorePalette(R.contentOf(r));
|
|
636
|
-
}
|
|
637
|
-
static lightFromCorePalette(r) {
|
|
638
|
-
return new Y({ primary: r.a1.tone(40), onPrimary: r.a1.tone(100), primaryContainer: r.a1.tone(90), onPrimaryContainer: r.a1.tone(10), secondary: r.a2.tone(40), onSecondary: r.a2.tone(100), secondaryContainer: r.a2.tone(90), onSecondaryContainer: r.a2.tone(10), tertiary: r.a3.tone(40), onTertiary: r.a3.tone(100), tertiaryContainer: r.a3.tone(90), onTertiaryContainer: r.a3.tone(10), error: r.error.tone(40), onError: r.error.tone(100), errorContainer: r.error.tone(90), onErrorContainer: r.error.tone(10), background: r.n1.tone(99), onBackground: r.n1.tone(10), surface: r.n1.tone(99), onSurface: r.n1.tone(10), surfaceVariant: r.n2.tone(90), onSurfaceVariant: r.n2.tone(30), outline: r.n2.tone(50), outlineVariant: r.n2.tone(80), shadow: r.n1.tone(0), scrim: r.n1.tone(0), inverseSurface: r.n1.tone(20), inverseOnSurface: r.n1.tone(95), inversePrimary: r.a1.tone(80) });
|
|
639
|
-
}
|
|
640
|
-
static darkFromCorePalette(r) {
|
|
641
|
-
return new Y({ primary: r.a1.tone(80), onPrimary: r.a1.tone(20), primaryContainer: r.a1.tone(30), onPrimaryContainer: r.a1.tone(90), secondary: r.a2.tone(80), onSecondary: r.a2.tone(20), secondaryContainer: r.a2.tone(30), onSecondaryContainer: r.a2.tone(90), tertiary: r.a3.tone(80), onTertiary: r.a3.tone(20), tertiaryContainer: r.a3.tone(30), onTertiaryContainer: r.a3.tone(90), error: r.error.tone(80), onError: r.error.tone(20), errorContainer: r.error.tone(30), onErrorContainer: r.error.tone(80), background: r.n1.tone(10), onBackground: r.n1.tone(90), surface: r.n1.tone(10), onSurface: r.n1.tone(90), surfaceVariant: r.n2.tone(30), onSurfaceVariant: r.n2.tone(80), outline: r.n2.tone(60), outlineVariant: r.n2.tone(30), shadow: r.n1.tone(0), scrim: r.n1.tone(0), inverseSurface: r.n1.tone(90), inverseOnSurface: r.n1.tone(20), inversePrimary: r.a1.tone(40) });
|
|
642
|
-
}
|
|
643
|
-
constructor(r) {
|
|
644
|
-
this.props = r;
|
|
645
|
-
}
|
|
646
|
-
toJSON() {
|
|
647
|
-
return { ...this.props };
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
function Ce(e) {
|
|
651
|
-
const r = (e = e.replace("#", "")).length === 3, t = e.length === 6, a = e.length === 8;
|
|
652
|
-
if (!r && !t && !a) throw new Error("unexpected hex " + e);
|
|
653
|
-
let n = 0, i = 0, s = 0;
|
|
654
|
-
return r ? (n = z(e.slice(0, 1).repeat(2)), i = z(e.slice(1, 2).repeat(2)), s = z(e.slice(2, 3).repeat(2))) : t ? (n = z(e.slice(0, 2)), i = z(e.slice(2, 4)), s = z(e.slice(4, 6))) : a && (n = z(e.slice(2, 4)), i = z(e.slice(4, 6)), s = z(e.slice(6, 8))), (255 << 24 | (255 & n) << 16 | (255 & i) << 8 | 255 & s) >>> 0;
|
|
655
|
-
}
|
|
656
|
-
function z(e) {
|
|
657
|
-
return parseInt(e, 16);
|
|
658
|
-
}
|
|
659
|
-
function Ne(e, r = []) {
|
|
660
|
-
const t = R.of(e);
|
|
661
|
-
return { source: e, schemes: { light: Y.light(e), dark: Y.dark(e) }, palettes: { primary: t.a1, secondary: t.a2, tertiary: t.a3, neutral: t.n1, neutralVariant: t.n2, error: t.error }, customColors: r.map((a) => function(n, i) {
|
|
662
|
-
let s = i.value;
|
|
663
|
-
const c = s, u = n;
|
|
664
|
-
i.blend && (s = pe.harmonize(c, u));
|
|
665
|
-
const h = R.of(s), m = h.a1;
|
|
666
|
-
return { color: i, value: s, light: { color: m.tone(40), onColor: m.tone(100), colorContainer: m.tone(90), onColorContainer: m.tone(10) }, dark: { color: m.tone(80), onColor: m.tone(20), colorContainer: m.tone(30), onColorContainer: m.tone(90) } };
|
|
667
|
-
}(e, a)) };
|
|
668
|
-
}
|
|
669
|
-
function Ue(e, r = !1) {
|
|
670
|
-
function t(a) {
|
|
671
|
-
return "#" + a.toString(16).slice(2);
|
|
672
|
-
}
|
|
673
|
-
if (r) {
|
|
674
|
-
const a = e.schemes.dark, n = function(i, s) {
|
|
675
|
-
const c = A.fromHueAndChroma(i, s);
|
|
676
|
-
return { cLowest: c.tone(4), cLow: c.tone(10), c: c.tone(12), cHigh: c.tone(17), cHighest: c.tone(22), sDim: c.tone(6), s: c.tone(6), sBright: c.tone(24) };
|
|
677
|
-
}(e.palettes.neutral.hue, e.palettes.neutral.chroma);
|
|
678
|
-
return { sys: { color: { scrim: t(a.scrim), outlineVariant: t(a.outlineVariant), outline: t(a.outline), surface: { default: t(a.surface), dim: t(n.sDim), bright: t(n.sBright), on: t(a.onSurface), onVariant: t(a.onSurfaceVariant), highest: t(n.cHighest), high: t(n.cHigh), container: t(n.c), low: t(n.cLow), lowest: t(n.cLowest) }, primary: { default: t(a.primary), on: t(a.onPrimary), container: t(a.primaryContainer), onContainer: t(a.onPrimaryContainer) }, secondary: { default: t(a.secondary), on: t(a.onSecondary), container: t(n.sBright), onContainer: t(a.onSecondaryContainer) }, tertiary: { default: t(a.tertiary), on: t(a.onTertiary), container: t(a.tertiaryContainer), onContainer: t(a.onTertiaryContainer) }, error: { default: t(a.error), on: t(a.onError), container: t(a.errorContainer), onContainer: t(a.onErrorContainer) }, success: { default: "#00FF00", on: "#000000", container: "#00FF00", onContainer: "#000000" } }, elevation: { 0: "0 0 0 0 rgba(0, 0, 0, 0)", 1: "rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px", 2: "rgba(0, 0, 0, 0.2) 0px 3px 3px -2px, rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px", 3: "rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px", 4: "rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px", 5: "rgba(0, 0, 0, 0.2) 0px 7px 8px -4px, rgba(0, 0, 0, 0.14) 0px 12px 17px 2px, rgba(0, 0, 0, 0.12) 0px 5px 22px 4px" }, outline: { 1: "1px" } } };
|
|
679
|
-
}
|
|
680
|
-
{
|
|
681
|
-
const a = e.schemes.light, n = function(i, s) {
|
|
682
|
-
const c = A.fromHueAndChroma(i, s);
|
|
683
|
-
return { cLowest: c.tone(100), cLow: c.tone(96), c: c.tone(94), cHigh: c.tone(92), cHighest: c.tone(90), sDim: c.tone(87), s: c.tone(98), sBright: c.tone(98) };
|
|
684
|
-
}(e.palettes.neutral.hue, e.palettes.neutral.chroma);
|
|
685
|
-
return { sys: { color: { scrim: t(a.scrim), outlineVariant: t(a.outlineVariant), outline: t(a.outline), surface: { default: t(a.surface), dim: t(n.sDim), bright: t(n.sBright), on: t(a.onSurface), onVariant: t(a.onSurfaceVariant), highest: t(n.cHighest), high: t(n.cHigh), container: t(n.c), low: t(n.cLow), lowest: t(n.cLowest) }, primary: { default: t(a.primary), on: t(a.onPrimary), container: t(a.primaryContainer), onContainer: t(a.onPrimaryContainer) }, secondary: { default: t(a.secondary), on: t(a.onSecondary), container: t(a.secondaryContainer), onContainer: t(a.onSecondaryContainer) }, tertiary: { default: t(a.tertiary), on: t(a.onTertiary), container: t(a.tertiaryContainer), onContainer: t(a.onTertiaryContainer) }, error: { default: t(a.error), on: t(a.onError), container: t(a.errorContainer), onContainer: t(a.onErrorContainer) }, success: { default: "#00FF00", on: "#000000", container: "#00FF00", onContainer: "#000000" } }, elevation: { 0: "0 0 0 0 rgba(0, 0, 0, 0)", 1: "rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px", 2: "rgba(0, 0, 0, 0.2) 0px 3px 3px -2px, rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px", 3: "rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px", 4: "rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px", 5: "rgba(0, 0, 0, 0.2) 0px 7px 8px -4px, rgba(0, 0, 0, 0.14) 0px 12px 17px 2px, rgba(0, 0, 0, 0.12) 0px 5px 22px 4px" }, outline: { 1: "1px" } } };
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
const ie = window.matchMedia("(prefers-color-scheme: dark)"), qe = new Ie((e) => {
|
|
689
|
-
const r = (a) => {
|
|
690
|
-
const n = a.matches ? "dark" : "light";
|
|
691
|
-
e.next(n);
|
|
692
|
-
};
|
|
693
|
-
ie.addEventListener("change", r);
|
|
694
|
-
const t = ie.matches ? "dark" : "light";
|
|
695
|
-
return e.next(t), () => ie.removeEventListener("change", r);
|
|
696
|
-
});
|
|
697
|
-
function se() {
|
|
698
|
-
return "#" + Math.floor(16777215 * Math.random()).toString(16).padStart(6, "0");
|
|
699
|
-
}
|
|
700
|
-
Oe.pipe(Te(function(e) {
|
|
701
|
-
try {
|
|
702
|
-
return JSON.parse(e);
|
|
703
|
-
} catch {
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
}(localStorage.getItem("schmancy-theme"))), ne((e) => {
|
|
707
|
-
try {
|
|
708
|
-
return Ce(e.color), e || { color: se(), scheme: "auto" };
|
|
709
|
-
} catch {
|
|
710
|
-
return { color: se(), scheme: "auto" };
|
|
711
|
-
}
|
|
712
|
-
}), Se(() => Fe({ color: se(), scheme: "auto" })), Le((e) => localStorage.setItem("schmancy-theme", JSON.stringify(e)))).pipe(Be(qe.pipe(ne((e) => e === "dark")))).pipe(ne(([e, r]) => ({ theme: Ne(Ce(e.color)), isDark: e.scheme === "dark" || e.scheme !== "light" && r })), ne((e) => Ue(e.theme, e.isDark))).subscribe((e) => {
|
|
713
|
-
we.next(e);
|
|
714
|
-
});
|
|
715
|
-
export {
|
|
716
|
-
Oe as $,
|
|
717
|
-
we as a,
|
|
718
|
-
Ue as f,
|
|
719
|
-
se as g
|
|
720
|
-
};
|
|
721
|
-
//# sourceMappingURL=dynamicTheme-DYtQDYE_.js.map
|