@gradient-ui/core 0.4.0 → 0.5.0-rc.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/README.md +58 -2
- package/dist/GLoading.vue_vue_type_style_index_0_lang-Bv3dWEq8.cjs +1 -0
- package/dist/GLoading.vue_vue_type_style_index_0_lang-CBB_GocW.js +466 -0
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BS6bb1XY.cjs +1 -0
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-UTBNFP5X.js +7015 -0
- package/dist/{default-585QCoXx.js → camelToKebabCase-6qY6WHvl.js} +987 -1194
- package/dist/camelToKebabCase-BQDotaQm.cjs +316 -0
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +56 -53
- package/dist/default-BhuY-A3o.cjs +4 -0
- package/dist/default-OTmCd0Aq.js +131 -0
- package/dist/directives.cjs +1 -1
- package/dist/directives.mjs +6 -5
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +183 -113
- package/dist/mask-BbofdFd4.cjs +1 -0
- package/dist/mask-CZX-I_iy.js +936 -0
- package/dist/material-Ca7ZZAiO.cjs +194 -0
- package/dist/material-okvXHenb.js +1162 -0
- package/dist/materialSurface-BBrP9ltj.js +591 -0
- package/dist/materialSurface-CK8LN_dU.cjs +1 -0
- package/dist/services.cjs +1 -1
- package/dist/services.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/surface-8z3gR7vF.cjs +1 -0
- package/dist/surface-BKu4KfkY.js +288 -0
- package/dist/theme.cjs +1 -1
- package/dist/theme.mjs +55 -9
- package/dist/types/components/index.d.ts +3 -1
- package/dist/types/components/ui/BaseOverlay/BaseOverlay.vue.d.ts +1 -1
- package/dist/types/components/ui/GAlert/GAlert.vue.d.ts +675 -9
- package/dist/types/components/ui/GAlert/types.d.ts +352 -4
- package/dist/types/components/ui/GAside/GAside.vue.d.ts +7 -5
- package/dist/types/components/ui/GAside/types.d.ts +17 -6
- package/dist/types/components/ui/GBadge/GBadge.vue.d.ts +679 -13
- package/dist/types/components/ui/GBadge/types.d.ts +350 -3
- package/dist/types/components/ui/GButton/GButton.vue.d.ts +295 -25
- package/dist/types/components/ui/GButton/types.d.ts +194 -49
- package/dist/types/components/ui/GCheckControl/GCheckControl.vue.d.ts +24 -24
- package/dist/types/components/ui/GCheckControl/GCheckGroup.vue.d.ts +24 -24
- package/dist/types/components/ui/GCheckbox/GCheckbox.vue.d.ts +24 -24
- package/dist/types/components/ui/GChip/GChip.vue.d.ts +295 -25
- package/dist/types/components/ui/GChip/types.d.ts +188 -43
- package/dist/types/components/ui/GDrawer/GDrawer.vue.d.ts +1 -1
- package/dist/types/components/ui/GExpansion/GExpansion.vue.d.ts +47 -13
- package/dist/types/components/ui/GExpansion/types.d.ts +284 -22
- package/dist/types/components/ui/GFAB/GFAB.vue.d.ts +220 -7
- package/dist/types/components/ui/GFAB/types.d.ts +122 -3
- package/dist/types/components/ui/GFieldBase/GFieldBase.vue.d.ts +15 -15
- package/dist/types/components/ui/GFieldBase/props.d.ts +10 -10
- package/dist/types/components/ui/GForm/GForm.vue.d.ts +156 -0
- package/dist/types/components/ui/GForm/index.d.ts +2 -0
- package/dist/types/components/ui/GForm/types.d.ts +107 -0
- package/dist/types/components/ui/GGradient/GGradient.vue.d.ts +165 -66
- package/dist/types/components/ui/GGradient/GGradientBorderLayer.vue.d.ts +11 -0
- package/dist/types/components/ui/GGradient/index.d.ts +1 -0
- package/dist/types/components/ui/GGradient/types.d.ts +10 -1
- package/dist/types/components/ui/GGradientMaterial/GGradientMaterial.vue.d.ts +257 -0
- package/dist/types/components/ui/GGradientMaterial/index.d.ts +2 -0
- package/dist/types/components/ui/GGradientMaterial/types.d.ts +140 -0
- package/dist/types/components/ui/GInput/GInput.vue.d.ts +15 -15
- package/dist/types/components/ui/GLoading/GLoading.vue.d.ts +5 -5
- package/dist/types/components/ui/GLoading/types.d.ts +3 -2
- package/dist/types/components/ui/GMenu/GSubmenu.vue.d.ts +14 -14
- package/dist/types/components/ui/GMenuItem/GMenuItem.vue.d.ts +11 -11
- package/dist/types/components/ui/GMenuItem/types.d.ts +4 -4
- package/dist/types/components/ui/GModal/GModal.vue.d.ts +1 -1
- package/dist/types/components/ui/GNavList/GNavList.vue.d.ts +7 -5
- package/dist/types/components/ui/GNavList/types.d.ts +17 -6
- package/dist/types/components/ui/GNavbar/GNavbar.vue.d.ts +4 -4
- package/dist/types/components/ui/GNavbar/types.d.ts +6 -6
- package/dist/types/components/ui/GProgress/GProgress.vue.d.ts +41 -20
- package/dist/types/components/ui/GProgress/types.d.ts +23 -10
- package/dist/types/components/ui/GQuickActions/GQuickActions.vue.d.ts +1 -1
- package/dist/types/components/ui/GSelectItem.vue.d.ts +5 -3
- package/dist/types/components/ui/GSnackbar/GSnackbar.vue.d.ts +681 -15
- package/dist/types/components/ui/GSnackbar/types.d.ts +350 -3
- package/dist/types/components/ui/GSquircle/GSquircle.vue.d.ts +2 -2
- package/dist/types/components/ui/GSquircle/types.d.ts +8 -2
- package/dist/types/components/ui/GSwitch/GSwitch.vue.d.ts +24 -24
- package/dist/types/components/ui/GTable/GTable.vue.d.ts +51 -3
- package/dist/types/components/ui/GTable/types.d.ts +351 -3
- package/dist/types/components/ui/GTabs/GTabs.vue.d.ts +4 -4
- package/dist/types/components/ui/GTabs/types.d.ts +6 -6
- package/dist/types/components/ui/GTextarea/GTextarea.vue.d.ts +15 -15
- package/dist/types/components/ui/GToggleButton/GToggleButton.vue.d.ts +490 -16
- package/dist/types/components/ui/GToggleButton/types.d.ts +284 -32
- package/dist/types/directives/index.d.ts +2 -0
- package/dist/types/directives/ripple.d.ts +1 -1
- package/dist/types/directives/specular.d.ts +34 -0
- package/dist/types/theme/color.d.ts +11 -0
- package/dist/types/theme/colorSeeds.d.ts +21 -20
- package/dist/types/theme/colorSystem.d.ts +12 -0
- package/dist/types/theme/cssTokens.d.ts +7 -0
- package/dist/types/theme/default.d.ts +26 -80
- package/dist/types/theme/gradient/animation/css.d.ts +12 -0
- package/dist/types/theme/gradient/animation/index.d.ts +1 -0
- package/dist/types/theme/gradient/colorMath.d.ts +3 -0
- package/dist/types/theme/gradient/constants.d.ts +3 -0
- package/dist/types/theme/gradient/core.d.ts +1 -0
- package/dist/types/theme/gradient/effects/index.d.ts +1 -0
- package/dist/types/theme/gradient/effects/morph.d.ts +5 -0
- package/dist/types/theme/gradient/effects/shadow.d.ts +3 -0
- package/dist/types/theme/gradient/formatters/canvas.d.ts +2 -0
- package/dist/types/theme/gradient/formatters/css.d.ts +3 -0
- package/dist/types/theme/gradient/formatters/index.d.ts +1 -0
- package/dist/types/theme/gradient/formatters/svg.d.ts +5 -0
- package/dist/types/theme/gradient/index.d.ts +1 -0
- package/dist/types/theme/gradient/material.d.ts +1 -0
- package/dist/types/theme/gradient/model.d.ts +5 -0
- package/dist/types/theme/gradient/presets.d.ts +158 -0
- package/dist/types/theme/gradient/recipes.d.ts +14 -0
- package/dist/types/theme/gradient/tokens.d.ts +72 -0
- package/dist/types/theme/gradient/types.d.ts +117 -0
- package/dist/types/theme/gradient/utils.d.ts +10 -0
- package/dist/types/theme/gradient.d.ts +1 -0
- package/dist/types/theme/index.d.ts +12 -1
- package/dist/types/theme/palette.d.ts +13 -0
- package/dist/types/theme/scheme.d.ts +2 -0
- package/dist/types/theme/types.d.ts +11 -0
- package/dist/types/use/actionSurface.d.ts +1742 -20
- package/dist/types/use/check/booleanControl.d.ts +9 -9
- package/dist/types/use/check/optionGroup.d.ts +9 -7
- package/dist/types/use/check/types.d.ts +26 -26
- package/dist/types/use/color.d.ts +2 -2
- package/dist/types/use/colorResolver.d.ts +15 -5
- package/dist/types/use/form/context.d.ts +8 -0
- package/dist/types/use/form/control.d.ts +4 -0
- package/dist/types/use/form/props.d.ts +4 -4
- package/dist/types/use/form/textFieldControl.d.ts +1 -1
- package/dist/types/use/glass.d.ts +24 -0
- package/dist/types/use/gradient.d.ts +1759 -43
- package/dist/types/use/gradientGlow.d.ts +4 -4
- package/dist/types/use/gradientMaterial.d.ts +21 -0
- package/dist/types/use/gradientRuntime.d.ts +11 -0
- package/dist/types/use/gradientRuntimeRegistry.d.ts +8 -0
- package/dist/types/use/gradientSurface.d.ts +31 -4
- package/dist/types/use/index.d.ts +8 -0
- package/dist/types/use/input/props.d.ts +11 -11
- package/dist/types/use/material.d.ts +112 -0
- package/dist/types/use/materialSurface.d.ts +376 -0
- package/dist/types/use/surface.d.ts +67 -19
- package/dist/types/use/surfaceColor.d.ts +1 -1
- package/dist/types/use/textarea/props.d.ts +11 -11
- package/dist/types/use/variant.d.ts +1 -1
- package/dist/use.cjs +1 -1
- package/dist/use.mjs +42 -22
- package/dist/useSnackbar-BHQshEZ8.cjs +1 -0
- package/dist/useSnackbar-DeNHZH8v.js +908 -0
- package/package.json +11 -4
- package/dist/GLoading.vue_vue_type_style_index_0_lang-CPzo3WD3.js +0 -680
- package/dist/GLoading.vue_vue_type_style_index_0_lang-cokm-HBh.cjs +0 -1
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BmbKqNgm.js +0 -6421
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-By_7hZOW.cjs +0 -4
- package/dist/camelToKebabCase-BAESShJ1.cjs +0 -1
- package/dist/camelToKebabCase-KgkZ7-1F.js +0 -28
- package/dist/default-BcPApP1Q.cjs +0 -318
- package/dist/mask-Bu8cjwwH.js +0 -817
- package/dist/mask-D1vJj5Hl.cjs +0 -1
- package/dist/propsFactory-DyyboUaC.cjs +0 -1
- package/dist/propsFactory-UhcvubZJ.js +0 -13
- package/dist/tagName-CYG1CUfd.js +0 -103
- package/dist/tagName-CbsvFHGg.cjs +0 -1
- package/dist/types/theme/changeTone.d.ts +0 -1
- package/dist/types/theme/colorPallete.d.ts +0 -2
- package/dist/types/theme/generateColors.d.ts +0 -1
- package/dist/types/theme/generateGradient.d.ts +0 -9
- package/dist/types/theme/getComplementaryColor.d.ts +0 -1
- package/dist/types/utils/color.d.ts +0 -3
- package/dist/types/utils/colors/normaliseColor.d.ts +0 -5
- package/dist/useSnackbar-2iJU4bdd.js +0 -769
- package/dist/useSnackbar-3QuH25xm.cjs +0 -1
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"use strict";const $e={red:"#F44336",pink:"#E91E63",purple:"#9C27B0",deepPurple:"#673AB7",indigo:"#3F51B5",blue:"#2196F3",lightBlue:"#03A9F4",cyan:"#00BCD4",teal:"#009688",green:"#4CAF50",lightGreen:"#8BC34A",lime:"#CDDC39",yellow:"#FFEB3B",amber:"#FFC107",orange:"#FF9800",deepOrange:"#FF5722",brown:"#795548",grey:"#9E9E9E",blueGrey:"#607D8B"},pe=(a,e=0,r=1)=>Math.min(r,Math.max(e,a)),me=a=>{const e=a/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},Xe=a=>{const e=a.slice(1),r=e.length===3||e.length===4?e.slice(0,3).split("").map(t=>t.repeat(2)).join(""):e.slice(0,6);return r.length!==6||!/^[\da-f]{6}$/i.test(r)?null:{r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16)}},Ge=a=>{const e=a.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i);return e?{r:pe(Number(e[1]),0,255),g:pe(Number(e[2]),0,255),b:pe(Number(e[3]),0,255)}:null},ce=a=>{if(typeof a=="number"){const r=a&16777215;return{r:r>>16&255,g:r>>8&255,b:r&255}}const e=a.trim();return e.startsWith("#")?Xe(e):e.toLowerCase().startsWith("rgb")?Ge(e):null},ve=({r:a,g:e,b:r})=>`#${[a,e,r].map(t=>Math.round(t).toString(16).padStart(2,"0")).join("")}`,Je=({r:a,g:e,b:r})=>`${Math.round(a)}, ${Math.round(e)}, ${Math.round(r)}`,Ae=(a,e)=>{const r=ce(a)??ce(e);if(!r)throw new Error(`Invalid fallback color: ${e}`);return ve(r)},We=a=>.2126*me(a.r)+.7152*me(a.g)+.0722*me(a.b),Ze=a=>{const e=ce(a);if(!e)return"#ffffff";const r=We(e),t=1.05/(r+.05),n=(r+.05)/.055;return t>=n?"#ffffff":"#0d0d12"};/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/function z(a){return a<0?-1:a===0?0:1}function ne(a,e,r){return(1-r)*a+r*e}function Qe(a,e,r){return r<a?a:r>e?e:r}function H(a,e,r){return r<a?a:r>e?e:r}function ue(a){return a=a%360,a<0&&(a=a+360),a}function er(a,e){return ue(e-a)<=180?1:-1}function rr(a,e){return 180-Math.abs(Math.abs(a-e)-180)}function ye(a,e){const r=a[0]*e[0][0]+a[1]*e[0][1]+a[2]*e[0][2],t=a[0]*e[1][0]+a[1]*e[1][1]+a[2]*e[1][2],n=a[0]*e[2][0]+a[1]*e[2][1]+a[2]*e[2][2];return[r,t,n]}/**
|
|
17
|
+
* @license
|
|
18
|
+
* Copyright 2021 Google LLC
|
|
19
|
+
*
|
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License.
|
|
22
|
+
* You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/const tr=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],nr=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],ar=[95.047,100,108.883];function ke(a,e,r){return(255<<24|(a&255)<<16|(e&255)<<8|r&255)>>>0}function xe(a){const e=Q(a[0]),r=Q(a[1]),t=Q(a[2]);return ke(e,r,t)}function Me(a){return a>>16&255}function Ie(a){return a>>8&255}function Ee(a){return a&255}function or(a,e,r){const t=nr,n=t[0][0]*a+t[0][1]*e+t[0][2]*r,s=t[1][0]*a+t[1][1]*e+t[1][2]*r,i=t[2][0]*a+t[2][1]*e+t[2][2]*r,u=Q(n),l=Q(s),h=Q(i);return ke(u,l,h)}function ir(a){const e=te(Me(a)),r=te(Ie(a)),t=te(Ee(a));return ye([e,r,t],tr)}function sr(a){const e=Z(a),r=Q(e);return ke(r,r,r)}function ge(a){const e=ir(a)[1];return 116*Le(e/100)-16}function Z(a){return 100*ur((a+16)/116)}function Pe(a){return Le(a/100)*116-16}function te(a){const e=a/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function Q(a){const e=a/100;let r=0;return e<=.0031308?r=e*12.92:r=1.055*Math.pow(e,1/2.4)-.055,Qe(0,255,Math.round(r*255))}function cr(){return ar}function Le(a){const e=.008856451679035631,r=24389/27;return a>e?Math.pow(a,1/3):(r*a+16)/116}function ur(a){const e=.008856451679035631,r=24389/27,t=a*a*a;return t>e?t:(116*a-16)/r}/**
|
|
32
|
+
* @license
|
|
33
|
+
* Copyright 2021 Google LLC
|
|
34
|
+
*
|
|
35
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
36
|
+
* you may not use this file except in compliance with the License.
|
|
37
|
+
* You may obtain a copy of the License at
|
|
38
|
+
*
|
|
39
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
40
|
+
*
|
|
41
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
42
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
43
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
44
|
+
* See the License for the specific language governing permissions and
|
|
45
|
+
* limitations under the License.
|
|
46
|
+
*/class j{static make(e=cr(),r=200/Math.PI*Z(50)/100,t=50,n=2,s=!1){const i=e,u=i[0]*.401288+i[1]*.650173+i[2]*-.051461,l=i[0]*-.250268+i[1]*1.204414+i[2]*.045854,h=i[0]*-.002079+i[1]*.048952+i[2]*.953127,d=.8+n/10,C=d>=.9?ne(.59,.69,(d-.9)*10):ne(.525,.59,(d-.8)*10);let p=s?1:d*(1-1/3.6*Math.exp((-r-42)/92));p=p>1?1:p<0?0:p;const D=d,m=[p*(100/u)+1-p,p*(100/l)+1-p,p*(100/h)+1-p],g=1/(5*r+1),P=g*g*g*g,A=1-P,B=P*r+.1*A*A*Math.cbrt(5*r),O=Z(t)/e[1],R=1.48+Math.sqrt(O),V=.725/Math.pow(O,.2),I=V,x=[Math.pow(B*m[0]*u/100,.42),Math.pow(B*m[1]*l/100,.42),Math.pow(B*m[2]*h/100,.42)],L=[400*x[0]/(x[0]+27.13),400*x[1]/(x[1]+27.13),400*x[2]/(x[2]+27.13)],_=(2*L[0]+L[1]+.05*L[2])*V;return new j(O,_,V,I,C,D,m,B,Math.pow(B,.25),R)}constructor(e,r,t,n,s,i,u,l,h,d){this.n=e,this.aw=r,this.nbb=t,this.ncb=n,this.c=s,this.nc=i,this.rgbD=u,this.fl=l,this.fLRoot=h,this.z=d}}j.DEFAULT=j.make();/**
|
|
47
|
+
* @license
|
|
48
|
+
* Copyright 2021 Google LLC
|
|
49
|
+
*
|
|
50
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
51
|
+
* you may not use this file except in compliance with the License.
|
|
52
|
+
* You may obtain a copy of the License at
|
|
53
|
+
*
|
|
54
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
55
|
+
*
|
|
56
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
57
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
58
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
59
|
+
* See the License for the specific language governing permissions and
|
|
60
|
+
* limitations under the License.
|
|
61
|
+
*/class N{constructor(e,r,t,n,s,i,u,l,h){this.hue=e,this.chroma=r,this.j=t,this.q=n,this.m=s,this.s=i,this.jstar=u,this.astar=l,this.bstar=h}distance(e){const r=this.jstar-e.jstar,t=this.astar-e.astar,n=this.bstar-e.bstar,s=Math.sqrt(r*r+t*t+n*n);return 1.41*Math.pow(s,.63)}static fromInt(e){return N.fromIntInViewingConditions(e,j.DEFAULT)}static fromIntInViewingConditions(e,r){const t=(e&16711680)>>16,n=(e&65280)>>8,s=e&255,i=te(t),u=te(n),l=te(s),h=.41233895*i+.35762064*u+.18051042*l,d=.2126*i+.7152*u+.0722*l,C=.01932141*i+.11916382*u+.95034478*l,p=.401288*h+.650173*d-.051461*C,D=-.250268*h+1.204414*d+.045854*C,m=-.002079*h+.048952*d+.953127*C,g=r.rgbD[0]*p,P=r.rgbD[1]*D,A=r.rgbD[2]*m,B=Math.pow(r.fl*Math.abs(g)/100,.42),O=Math.pow(r.fl*Math.abs(P)/100,.42),R=Math.pow(r.fl*Math.abs(A)/100,.42),V=z(g)*400*B/(B+27.13),I=z(P)*400*O/(O+27.13),x=z(A)*400*R/(R+27.13),L=(11*V+-12*I+x)/11,_=(V+I-2*x)/9,E=(20*V+20*I+21*x)/20,q=(40*V+20*I+x)/20,ee=Math.atan2(_,L)*180/Math.PI,K=ue(ee),ae=K*Math.PI/180,oe=q*r.nbb,J=100*Math.pow(oe/r.aw,r.c*r.z),ie=4/r.c*Math.sqrt(J/100)*(r.aw+4)*r.fLRoot,le=K<20.14?K+360:K,fe=.25*(Math.cos(le*Math.PI/180+2)+3.8),de=5e4/13*fe*r.nc*r.ncb*Math.sqrt(L*L+_*_)/(E+.305),se=Math.pow(de,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),De=se*Math.sqrt(J/100),Fe=De*r.fLRoot,ze=50*Math.sqrt(se*r.c/(r.aw+4)),Ke=(1+100*.007)*J/(1+.007*J),we=1/.0228*Math.log(1+.0228*Fe),je=we*Math.cos(ae),qe=we*Math.sin(ae);return new N(K,De,J,ie,Fe,ze,Ke,je,qe)}static fromJch(e,r,t){return N.fromJchInViewingConditions(e,r,t,j.DEFAULT)}static fromJchInViewingConditions(e,r,t,n){const s=4/n.c*Math.sqrt(e/100)*(n.aw+4)*n.fLRoot,i=r*n.fLRoot,u=r/Math.sqrt(e/100),l=50*Math.sqrt(u*n.c/(n.aw+4)),h=t*Math.PI/180,d=(1+100*.007)*e/(1+.007*e),C=1/.0228*Math.log(1+.0228*i),p=C*Math.cos(h),D=C*Math.sin(h);return new N(t,r,e,s,i,l,d,p,D)}static fromUcs(e,r,t){return N.fromUcsInViewingConditions(e,r,t,j.DEFAULT)}static fromUcsInViewingConditions(e,r,t,n){const s=r,i=t,u=Math.sqrt(s*s+i*i),h=(Math.exp(u*.0228)-1)/.0228/n.fLRoot;let d=Math.atan2(i,s)*(180/Math.PI);d<0&&(d+=360);const C=e/(1-(e-100)*.007);return N.fromJchInViewingConditions(C,h,d,n)}toInt(){return this.viewed(j.DEFAULT)}viewed(e){const r=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),t=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),n=this.hue*Math.PI/180,s=.25*(Math.cos(n+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),u=s*(5e4/13)*e.nc*e.ncb,l=i/e.nbb,h=Math.sin(n),d=Math.cos(n),C=23*(l+.305)*t/(23*u+11*t*d+108*t*h),p=C*d,D=C*h,m=(460*l+451*p+288*D)/1403,g=(460*l-891*p-261*D)/1403,P=(460*l-220*p-6300*D)/1403,A=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),B=z(m)*(100/e.fl)*Math.pow(A,1/.42),O=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),R=z(g)*(100/e.fl)*Math.pow(O,1/.42),V=Math.max(0,27.13*Math.abs(P)/(400-Math.abs(P))),I=z(P)*(100/e.fl)*Math.pow(V,1/.42),x=B/e.rgbD[0],L=R/e.rgbD[1],_=I/e.rgbD[2],E=1.86206786*x-1.01125463*L+.14918677*_,q=.38752654*x+.62144744*L-.00897398*_,G=-.0158415*x-.03412294*L+1.04996444*_;return or(E,q,G)}static fromXyzInViewingConditions(e,r,t,n){const s=.401288*e+.650173*r-.051461*t,i=-.250268*e+1.204414*r+.045854*t,u=-.002079*e+.048952*r+.953127*t,l=n.rgbD[0]*s,h=n.rgbD[1]*i,d=n.rgbD[2]*u,C=Math.pow(n.fl*Math.abs(l)/100,.42),p=Math.pow(n.fl*Math.abs(h)/100,.42),D=Math.pow(n.fl*Math.abs(d)/100,.42),m=z(l)*400*C/(C+27.13),g=z(h)*400*p/(p+27.13),P=z(d)*400*D/(D+27.13),A=(11*m+-12*g+P)/11,B=(m+g-2*P)/9,O=(20*m+20*g+21*P)/20,R=(40*m+20*g+P)/20,I=Math.atan2(B,A)*180/Math.PI,x=I<0?I+360:I>=360?I-360:I,L=x*Math.PI/180,_=R*n.nbb,E=100*Math.pow(_/n.aw,n.c*n.z),q=4/n.c*Math.sqrt(E/100)*(n.aw+4)*n.fLRoot,G=x<20.14?x+360:x,ee=1/4*(Math.cos(G*Math.PI/180+2)+3.8),ae=5e4/13*ee*n.nc*n.ncb*Math.sqrt(A*A+B*B)/(O+.305),oe=Math.pow(ae,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),J=oe*Math.sqrt(E/100),ie=J*n.fLRoot,le=50*Math.sqrt(oe*n.c/(n.aw+4)),fe=(1+100*.007)*E/(1+.007*E),he=Math.log(1+.0228*ie)/.0228,de=he*Math.cos(L),se=he*Math.sin(L);return new N(x,J,E,q,ie,le,fe,de,se)}xyzInViewingConditions(e){const r=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),t=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),n=this.hue*Math.PI/180,s=.25*(Math.cos(n+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),u=s*(5e4/13)*e.nc*e.ncb,l=i/e.nbb,h=Math.sin(n),d=Math.cos(n),C=23*(l+.305)*t/(23*u+11*t*d+108*t*h),p=C*d,D=C*h,m=(460*l+451*p+288*D)/1403,g=(460*l-891*p-261*D)/1403,P=(460*l-220*p-6300*D)/1403,A=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),B=z(m)*(100/e.fl)*Math.pow(A,1/.42),O=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),R=z(g)*(100/e.fl)*Math.pow(O,1/.42),V=Math.max(0,27.13*Math.abs(P)/(400-Math.abs(P))),I=z(P)*(100/e.fl)*Math.pow(V,1/.42),x=B/e.rgbD[0],L=R/e.rgbD[1],_=I/e.rgbD[2],E=1.86206786*x-1.01125463*L+.14918677*_,q=.38752654*x+.62144744*L-.00897398*_,G=-.0158415*x-.03412294*L+1.04996444*_;return[E,q,G]}}/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright 2021 Google LLC
|
|
64
|
+
*
|
|
65
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
66
|
+
* you may not use this file except in compliance with the License.
|
|
67
|
+
* You may obtain a copy of the License at
|
|
68
|
+
*
|
|
69
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
70
|
+
*
|
|
71
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
72
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
73
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
74
|
+
* See the License for the specific language governing permissions and
|
|
75
|
+
* limitations under the License.
|
|
76
|
+
*/class S{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){const r=e/100;let t=0;return r<=.0031308?t=r*12.92:t=1.055*Math.pow(r,1/2.4)-.055,t*255}static chromaticAdaptation(e){const r=Math.pow(Math.abs(e),.42);return z(e)*400*r/(r+27.13)}static hueOf(e){const r=ye(e,S.SCALED_DISCOUNT_FROM_LINRGB),t=S.chromaticAdaptation(r[0]),n=S.chromaticAdaptation(r[1]),s=S.chromaticAdaptation(r[2]),i=(11*t+-12*n+s)/11,u=(t+n-2*s)/9;return Math.atan2(u,i)}static areInCyclicOrder(e,r,t){const n=S.sanitizeRadians(r-e),s=S.sanitizeRadians(t-e);return n<s}static intercept(e,r,t){return(r-e)/(t-e)}static lerpPoint(e,r,t){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r,e[2]+(t[2]-e[2])*r]}static setCoordinate(e,r,t,n){const s=S.intercept(e[n],r,t[n]);return S.lerpPoint(e,s,t)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,r){const t=S.Y_FROM_LINRGB[0],n=S.Y_FROM_LINRGB[1],s=S.Y_FROM_LINRGB[2],i=r%4<=1?0:100,u=r%2===0?0:100;if(r<4){const l=i,h=u,d=(e-l*n-h*s)/t;return S.isBounded(d)?[d,l,h]:[-1,-1,-1]}else if(r<8){const l=i,h=u,d=(e-h*t-l*s)/n;return S.isBounded(d)?[h,d,l]:[-1,-1,-1]}else{const l=i,h=u,d=(e-l*t-h*n)/s;return S.isBounded(d)?[l,h,d]:[-1,-1,-1]}}static bisectToSegment(e,r){let t=[-1,-1,-1],n=t,s=0,i=0,u=!1,l=!0;for(let h=0;h<12;h++){const d=S.nthVertex(e,h);if(d[0]<0)continue;const C=S.hueOf(d);if(!u){t=d,n=d,s=C,i=C,u=!0;continue}(l||S.areInCyclicOrder(s,C,i))&&(l=!1,S.areInCyclicOrder(s,r,C)?(n=d,i=C):(t=d,s=C))}return[t,n]}static midpoint(e,r){return[(e[0]+r[0])/2,(e[1]+r[1])/2,(e[2]+r[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(e,r){const t=S.bisectToSegment(e,r);let n=t[0],s=S.hueOf(n),i=t[1];for(let u=0;u<3;u++)if(n[u]!==i[u]){let l=-1,h=255;n[u]<i[u]?(l=S.criticalPlaneBelow(S.trueDelinearized(n[u])),h=S.criticalPlaneAbove(S.trueDelinearized(i[u]))):(l=S.criticalPlaneAbove(S.trueDelinearized(n[u])),h=S.criticalPlaneBelow(S.trueDelinearized(i[u])));for(let d=0;d<8&&!(Math.abs(h-l)<=1);d++){const C=Math.floor((l+h)/2),p=S.CRITICAL_PLANES[C],D=S.setCoordinate(n,p,i,u),m=S.hueOf(D);S.areInCyclicOrder(s,r,m)?(i=D,h=C):(n=D,s=m,l=C)}}return S.midpoint(n,i)}static inverseChromaticAdaptation(e){const r=Math.abs(e),t=Math.max(0,27.13*r/(400-r));return z(e)*Math.pow(t,1/.42)}static findResultByJ(e,r,t){let n=Math.sqrt(t)*11;const s=j.DEFAULT,i=1/Math.pow(1.64-Math.pow(.29,s.n),.73),l=.25*(Math.cos(e+2)+3.8)*(5e4/13)*s.nc*s.ncb,h=Math.sin(e),d=Math.cos(e);for(let C=0;C<5;C++){const p=n/100,D=r===0||n===0?0:r/Math.sqrt(p),m=Math.pow(D*i,1/.9),P=s.aw*Math.pow(p,1/s.c/s.z)/s.nbb,A=23*(P+.305)*m/(23*l+11*m*d+108*m*h),B=A*d,O=A*h,R=(460*P+451*B+288*O)/1403,V=(460*P-891*B-261*O)/1403,I=(460*P-220*B-6300*O)/1403,x=S.inverseChromaticAdaptation(R),L=S.inverseChromaticAdaptation(V),_=S.inverseChromaticAdaptation(I),E=ye([x,L,_],S.LINRGB_FROM_SCALED_DISCOUNT);if(E[0]<0||E[1]<0||E[2]<0)return 0;const q=S.Y_FROM_LINRGB[0],G=S.Y_FROM_LINRGB[1],ee=S.Y_FROM_LINRGB[2],K=q*E[0]+G*E[1]+ee*E[2];if(K<=0)return 0;if(C===4||Math.abs(K-t)<.002)return E[0]>100.01||E[1]>100.01||E[2]>100.01?0:xe(E);n=n-(K-t)*n/(2*K)}return 0}static solveToInt(e,r,t){if(r<1e-4||t<1e-4||t>99.9999)return sr(t);e=ue(e);const n=e/180*Math.PI,s=Z(t),i=S.findResultByJ(n,r,s);if(i!==0)return i;const u=S.bisectToLimit(s,n);return xe(u)}static solveToCam(e,r,t){return N.fromInt(S.solveToInt(e,r,t))}}S.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];S.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];S.Y_FROM_LINRGB=[.2126,.7152,.0722];S.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.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];/**
|
|
77
|
+
* @license
|
|
78
|
+
* Copyright 2021 Google LLC
|
|
79
|
+
*
|
|
80
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
81
|
+
* you may not use this file except in compliance with the License.
|
|
82
|
+
* You may obtain a copy of the License at
|
|
83
|
+
*
|
|
84
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
85
|
+
*
|
|
86
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
87
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
88
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
89
|
+
* See the License for the specific language governing permissions and
|
|
90
|
+
* limitations under the License.
|
|
91
|
+
*/class T{static from(e,r,t){return new T(S.solveToInt(e,r,t))}static fromInt(e){return new T(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(S.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(S.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(S.solveToInt(this.internalHue,this.internalChroma,e))}setValue(e,r){this[e]=r}toString(){return`HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`}static isBlue(e){return e>=250&&e<270}static isYellow(e){return e>=105&&e<125}static isCyan(e){return e>=170&&e<207}constructor(e){this.argb=e;const r=N.fromInt(e);this.internalHue=r.hue,this.internalChroma=r.chroma,this.internalTone=ge(e),this.argb=e}setInternalState(e){const r=N.fromInt(e);this.internalHue=r.hue,this.internalChroma=r.chroma,this.internalTone=ge(e),this.argb=e}inViewingConditions(e){const t=N.fromInt(this.toInt()).xyzInViewingConditions(e),n=N.fromXyzInViewingConditions(t[0],t[1],t[2],j.make());return T.from(n.hue,n.chroma,Pe(t[1]))}}/**
|
|
92
|
+
* @license
|
|
93
|
+
* Copyright 2021 Google LLC
|
|
94
|
+
*
|
|
95
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
96
|
+
* you may not use this file except in compliance with the License.
|
|
97
|
+
* You may obtain a copy of the License at
|
|
98
|
+
*
|
|
99
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
100
|
+
*
|
|
101
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
102
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
103
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
104
|
+
* See the License for the specific language governing permissions and
|
|
105
|
+
* limitations under the License.
|
|
106
|
+
*/class Ce{static harmonize(e,r){const t=T.fromInt(e),n=T.fromInt(r),s=rr(t.hue,n.hue),i=Math.min(s*.5,15),u=ue(t.hue+i*er(t.hue,n.hue));return T.from(u,t.chroma,t.tone).toInt()}static hctHue(e,r,t){const n=Ce.cam16Ucs(e,r,t),s=N.fromInt(n),i=N.fromInt(e);return T.from(s.hue,i.chroma,ge(e)).toInt()}static cam16Ucs(e,r,t){const n=N.fromInt(e),s=N.fromInt(r),i=n.jstar,u=n.astar,l=n.bstar,h=s.jstar,d=s.astar,C=s.bstar,p=i+(h-i)*t,D=u+(d-u)*t,m=l+(C-l)*t;return N.fromUcs(p,D,m).toInt()}}/**
|
|
107
|
+
* @license
|
|
108
|
+
* Copyright 2022 Google LLC
|
|
109
|
+
*
|
|
110
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
111
|
+
* you may not use this file except in compliance with the License.
|
|
112
|
+
* You may obtain a copy of the License at
|
|
113
|
+
*
|
|
114
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
115
|
+
*
|
|
116
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
117
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
118
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
119
|
+
* See the License for the specific language governing permissions and
|
|
120
|
+
* limitations under the License.
|
|
121
|
+
*/class v{static ratioOfTones(e,r){return e=H(0,100,e),r=H(0,100,r),v.ratioOfYs(Z(e),Z(r))}static ratioOfYs(e,r){const t=e>r?e:r,n=t===r?e:r;return(t+5)/(n+5)}static lighter(e,r){if(e<0||e>100)return-1;const t=Z(e),n=r*(t+5)-5,s=v.ratioOfYs(n,t),i=Math.abs(s-r);if(s<r&&i>.04)return-1;const u=Pe(n)+.4;return u<0||u>100?-1:u}static darker(e,r){if(e<0||e>100)return-1;const t=Z(e),n=(t+5)/r-5,s=v.ratioOfYs(t,n),i=Math.abs(s-r);if(s<r&&i>.04)return-1;const u=Pe(n)-.4;return u<0||u>100?-1:u}static lighterUnsafe(e,r){const t=v.lighter(e,r);return t<0?100:t}static darkerUnsafe(e,r){const t=v.darker(e,r);return t<0?0:t}}/**
|
|
122
|
+
* @license
|
|
123
|
+
* Copyright 2023 Google LLC
|
|
124
|
+
*
|
|
125
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
126
|
+
* you may not use this file except in compliance with the License.
|
|
127
|
+
* You may obtain a copy of the License at
|
|
128
|
+
*
|
|
129
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
130
|
+
*
|
|
131
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
132
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
133
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
134
|
+
* See the License for the specific language governing permissions and
|
|
135
|
+
* limitations under the License.
|
|
136
|
+
*/class Se{static isDisliked(e){const r=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,t=Math.round(e.chroma)>16,n=Math.round(e.tone)<65;return r&&t&&n}static fixIfDisliked(e){return Se.isDisliked(e)?T.from(e.hue,e.chroma,70):e}}/**
|
|
137
|
+
* @license
|
|
138
|
+
* Copyright 2022 Google LLC
|
|
139
|
+
*
|
|
140
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
141
|
+
* you may not use this file except in compliance with the License.
|
|
142
|
+
* You may obtain a copy of the License at
|
|
143
|
+
*
|
|
144
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
145
|
+
*
|
|
146
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
147
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
148
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
149
|
+
* See the License for the specific language governing permissions and
|
|
150
|
+
* limitations under the License.
|
|
151
|
+
*/function lr(a,e,r){if(a.name!==r.name)throw new Error(`Attempting to extend color ${a.name} with color ${r.name} of different name for spec version ${e}.`);if(a.isBackground!==r.isBackground)throw new Error(`Attempting to extend color ${a.name} as a ${a.isBackground?"background":"foreground"} with color ${r.name} as a ${r.isBackground?"background":"foreground"} for spec version ${e}.`)}function b(a,e,r){return lr(a,e,r),c.fromPalette({name:a.name,palette:t=>t.specVersion===e?r.palette(t):a.palette(t),tone:t=>t.specVersion===e?r.tone(t):a.tone(t),isBackground:a.isBackground,chromaMultiplier:t=>{const n=t.specVersion===e?r.chromaMultiplier:a.chromaMultiplier;return n!==void 0?n(t):1},background:t=>{const n=t.specVersion===e?r.background:a.background;return n!==void 0?n(t):void 0},secondBackground:t=>{const n=t.specVersion===e?r.secondBackground:a.secondBackground;return n!==void 0?n(t):void 0},contrastCurve:t=>{const n=t.specVersion===e?r.contrastCurve:a.contrastCurve;return n!==void 0?n(t):void 0},toneDeltaPair:t=>{const n=t.specVersion===e?r.toneDeltaPair:a.toneDeltaPair;return n!==void 0?n(t):void 0}})}class c{static fromPalette(e){return new c(e.name??"",e.palette,e.tone??c.getInitialToneFromBackground(e.background),e.isBackground??!1,e.chromaMultiplier,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}static getInitialToneFromBackground(e){return e===void 0?r=>50:r=>e(r)?e(r).getTone(r):50}constructor(e,r,t,n,s,i,u,l,h){if(this.name=e,this.palette=r,this.tone=t,this.isBackground=n,this.chromaMultiplier=s,this.background=i,this.secondBackground=u,this.contrastCurve=l,this.toneDeltaPair=h,this.hctCache=new Map,!i&&u)throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!i&&l)throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(i&&!l)throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}clone(){return c.fromPalette({name:this.name,palette:this.palette,tone:this.tone,isBackground:this.isBackground,chromaMultiplier:this.chromaMultiplier,background:this.background,secondBackground:this.secondBackground,contrastCurve:this.contrastCurve,toneDeltaPair:this.toneDeltaPair})}clearCache(){this.hctCache.clear()}getArgb(e){return this.getHct(e).toInt()}getHct(e){const r=this.hctCache.get(e);if(r!=null)return r;const t=Be(e.specVersion).getHct(e,this);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,t),t}getTone(e){return Be(e.specVersion).getTone(e,this)}static foregroundTone(e,r){const t=v.lighterUnsafe(e,r),n=v.darkerUnsafe(e,r),s=v.ratioOfTones(t,e),i=v.ratioOfTones(n,e);if(c.tonePrefersLightForeground(e)){const l=Math.abs(s-i)<.1&&s<r&&i<r;return s>=r||s>=i||l?t:n}else return i>=r||i>=s?n:t}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(e){return c.tonePrefersLightForeground(e)&&!c.toneAllowsLightForeground(e)?49:e}}class fr{getHct(e,r){const t=r.getTone(e);return r.palette(e).getHct(t)}getTone(e,r){const t=e.contrastLevel<0,n=r.toneDeltaPair?r.toneDeltaPair(e):void 0;if(n){const s=n.roleA,i=n.roleB,u=n.delta,l=n.polarity,h=n.stayTogether,d=l==="nearer"||l==="lighter"&&!e.isDark||l==="darker"&&e.isDark,C=d?s:i,p=d?i:s,D=r.name===C.name,m=e.isDark?1:-1;let g=C.tone(e),P=p.tone(e);if(r.background&&C.contrastCurve&&p.contrastCurve){const A=r.background(e),B=C.contrastCurve(e),O=p.contrastCurve(e);if(A&&B&&O){const R=A.getTone(e),V=B.get(e.contrastLevel),I=O.get(e.contrastLevel);v.ratioOfTones(R,g)<V&&(g=c.foregroundTone(R,V)),v.ratioOfTones(R,P)<I&&(P=c.foregroundTone(R,I)),t&&(g=c.foregroundTone(R,V),P=c.foregroundTone(R,I))}}return(P-g)*m<u&&(P=H(0,100,g+u*m),(P-g)*m>=u||(g=H(0,100,P-u*m))),50<=g&&g<60?m>0?(g=60,P=Math.max(P,g+u*m)):(g=49,P=Math.min(P,g+u*m)):50<=P&&P<60&&(h?m>0?(g=60,P=Math.max(P,g+u*m)):(g=49,P=Math.min(P,g+u*m)):m>0?P=60:P=49),D?g:P}else{let s=r.tone(e);if(r.background==null||r.background(e)===void 0||r.contrastCurve==null||r.contrastCurve(e)===void 0)return s;const i=r.background(e).getTone(e),u=r.contrastCurve(e).get(e.contrastLevel);if(v.ratioOfTones(i,s)>=u||(s=c.foregroundTone(i,u)),t&&(s=c.foregroundTone(i,u)),r.isBackground&&50<=s&&s<60&&(v.ratioOfTones(49,i)>=u?s=49:s=60),r.secondBackground==null||r.secondBackground(e)===void 0)return s;const[l,h]=[r.background,r.secondBackground],[d,C]=[l(e).getTone(e),h(e).getTone(e)],[p,D]=[Math.max(d,C),Math.min(d,C)];if(v.ratioOfTones(p,s)>=u&&v.ratioOfTones(D,s)>=u)return s;const m=v.lighter(p,u),g=v.darker(D,u),P=[];return m!==-1&&P.push(m),g!==-1&&P.push(g),c.tonePrefersLightForeground(d)||c.tonePrefersLightForeground(C)?m<0?100:m:P.length===1?P[0]:g<0?0:g}}}class hr{getHct(e,r){const t=r.palette(e),n=r.getTone(e),s=t.hue,i=t.chroma*(r.chromaMultiplier?r.chromaMultiplier(e):1);return T.from(s,i,n)}getTone(e,r){const t=r.toneDeltaPair?r.toneDeltaPair(e):void 0;if(t){const n=t.roleA,s=t.roleB,i=t.polarity,u=t.constraint,l=i==="darker"||i==="relative_lighter"&&e.isDark||i==="relative_darker"&&!e.isDark?-t.delta:t.delta,h=r.name===n.name,d=h?n:s,C=h?s:n;let p=d.tone(e),D=C.getTone(e);const m=l*(h?1:-1);if(u==="exact"?p=H(0,100,D+m):u==="nearer"?m>0?p=H(0,100,H(D,D+m,p)):p=H(0,100,H(D+m,D,p)):u==="farther"&&(m>0?p=H(D+m,100,p):p=H(0,D+m,p)),r.background&&r.contrastCurve){const g=r.background(e),P=r.contrastCurve(e);if(g&&P){const A=g.getTone(e),B=P.get(e.contrastLevel);p=v.ratioOfTones(A,p)>=B&&e.contrastLevel>=0?p:c.foregroundTone(A,B)}}return r.isBackground&&!r.name.endsWith("_fixed_dim")&&(p>=57?p=H(65,100,p):p=H(0,49,p)),p}else{let n=r.tone(e);if(r.background==null||r.background(e)===void 0||r.contrastCurve==null||r.contrastCurve(e)===void 0)return n;const s=r.background(e).getTone(e),i=r.contrastCurve(e).get(e.contrastLevel);if(n=v.ratioOfTones(s,n)>=i&&e.contrastLevel>=0?n:c.foregroundTone(s,i),r.isBackground&&!r.name.endsWith("_fixed_dim")&&(n>=57?n=H(65,100,n):n=H(0,49,n)),r.secondBackground==null||r.secondBackground(e)===void 0)return n;const[u,l]=[r.background,r.secondBackground],[h,d]=[u(e).getTone(e),l(e).getTone(e)],[C,p]=[Math.max(h,d),Math.min(h,d)];if(v.ratioOfTones(C,n)>=i&&v.ratioOfTones(p,n)>=i)return n;const D=v.lighter(C,i),m=v.darker(p,i),g=[];return D!==-1&&g.push(D),m!==-1&&g.push(m),c.tonePrefersLightForeground(h)||c.tonePrefersLightForeground(d)?D<0?100:D:g.length===1?g[0]:m<0?0:m}}}const dr=new fr,pr=new hr;function Be(a){return a==="2025"?pr:dr}/**
|
|
152
|
+
* @license
|
|
153
|
+
* Copyright 2021 Google LLC
|
|
154
|
+
*
|
|
155
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
156
|
+
* you may not use this file except in compliance with the License.
|
|
157
|
+
* You may obtain a copy of the License at
|
|
158
|
+
*
|
|
159
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
160
|
+
*
|
|
161
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
162
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
163
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
164
|
+
* See the License for the specific language governing permissions and
|
|
165
|
+
* limitations under the License.
|
|
166
|
+
*/class Y{static fromInt(e){const r=T.fromInt(e);return Y.fromHct(r)}static fromHct(e){return new Y(e.hue,e.chroma,e)}static fromHueAndChroma(e,r){const t=new mr(e,r).create();return new Y(e,r,t)}constructor(e,r,t){this.hue=e,this.chroma=r,this.keyColor=t,this.cache=new Map}tone(e){let r=this.cache.get(e);return r===void 0&&(e==99&&T.isYellow(this.hue)?r=this.averageArgb(this.tone(98),this.tone(100)):r=T.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,r)),r}getHct(e){return T.fromInt(this.tone(e))}averageArgb(e,r){const t=e>>>16&255,n=e>>>8&255,s=e&255,i=r>>>16&255,u=r>>>8&255,l=r&255,h=Math.round((t+i)/2),d=Math.round((n+u)/2),C=Math.round((s+l)/2);return(255<<24|(h&255)<<16|(d&255)<<8|C&255)>>>0}}class mr{constructor(e,r){this.hue=e,this.requestedChroma=r,this.chromaCache=new Map,this.maxChromaValue=200}create(){let n=0,s=100;for(;n<s;){const i=Math.floor((n+s)/2),u=this.maxChroma(i)<this.maxChroma(i+1);if(this.maxChroma(i)>=this.requestedChroma-.01)if(Math.abs(n-50)<Math.abs(s-50))s=i;else{if(n===i)return T.from(this.hue,this.requestedChroma,n);n=i}else u?n=i+1:s=i}return T.from(this.hue,this.requestedChroma,n)}maxChroma(e){if(this.chromaCache.has(e))return this.chromaCache.get(e);const r=T.from(this.hue,this.maxChromaValue,e).chroma;return this.chromaCache.set(e,r),r}}/**
|
|
167
|
+
* @license
|
|
168
|
+
* Copyright 2023 Google LLC
|
|
169
|
+
*
|
|
170
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
171
|
+
* you may not use this file except in compliance with the License.
|
|
172
|
+
* You may obtain a copy of the License at
|
|
173
|
+
*
|
|
174
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
175
|
+
*
|
|
176
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
177
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
178
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
179
|
+
* See the License for the specific language governing permissions and
|
|
180
|
+
* limitations under the License.
|
|
181
|
+
*/class y{constructor(e,r,t,n){this.low=e,this.normal=r,this.medium=t,this.high=n}get(e){return e<=-1?this.low:e<0?ne(this.low,this.normal,(e- -1)/1):e<.5?ne(this.normal,this.medium,(e-0)/.5):e<1?ne(this.medium,this.high,(e-.5)/.5):this.high}}/**
|
|
182
|
+
* @license
|
|
183
|
+
* Copyright 2023 Google LLC
|
|
184
|
+
*
|
|
185
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
186
|
+
* you may not use this file except in compliance with the License.
|
|
187
|
+
* You may obtain a copy of the License at
|
|
188
|
+
*
|
|
189
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
190
|
+
*
|
|
191
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
192
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
193
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
194
|
+
* See the License for the specific language governing permissions and
|
|
195
|
+
* limitations under the License.
|
|
196
|
+
*/class w{constructor(e,r,t,n,s,i){this.roleA=e,this.roleB=r,this.delta=t,this.polarity=n,this.stayTogether=s,this.constraint=i,this.constraint=i??"exact"}}/**
|
|
197
|
+
* @license
|
|
198
|
+
* Copyright 2022 Google LLC
|
|
199
|
+
*
|
|
200
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
201
|
+
* you may not use this file except in compliance with the License.
|
|
202
|
+
* You may obtain a copy of the License at
|
|
203
|
+
*
|
|
204
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
205
|
+
*
|
|
206
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
207
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
208
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
209
|
+
* See the License for the specific language governing permissions and
|
|
210
|
+
* limitations under the License.
|
|
211
|
+
*/var f;(function(a){a[a.MONOCHROME=0]="MONOCHROME",a[a.NEUTRAL=1]="NEUTRAL",a[a.TONAL_SPOT=2]="TONAL_SPOT",a[a.VIBRANT=3]="VIBRANT",a[a.EXPRESSIVE=4]="EXPRESSIVE",a[a.FIDELITY=5]="FIDELITY",a[a.CONTENT=6]="CONTENT",a[a.RAINBOW=7]="RAINBOW",a[a.FRUIT_SALAD=8]="FRUIT_SALAD"})(f||(f={}));/**
|
|
212
|
+
* @license
|
|
213
|
+
* Copyright 2025 Google LLC
|
|
214
|
+
*
|
|
215
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
216
|
+
* you may not use this file except in compliance with the License.
|
|
217
|
+
* You may obtain a copy of the License at
|
|
218
|
+
*
|
|
219
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
220
|
+
*
|
|
221
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
222
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
223
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
224
|
+
* See the License for the specific language governing permissions and
|
|
225
|
+
* limitations under the License.
|
|
226
|
+
*/function re(a){return a.variant===f.FIDELITY||a.variant===f.CONTENT}function M(a){return a.variant===f.MONOCHROME}function yr(a,e,r,t){let n=r,s=T.from(a,e,r);if(s.chroma<e){let i=s.chroma;for(;s.chroma<e;){n+=t?-1:1;const u=T.from(a,e,n);if(i>u.chroma||Math.abs(u.chroma-e)<.4)break;const l=Math.abs(u.chroma-e),h=Math.abs(s.chroma-e);l<h&&(s=u),i=Math.max(i,u.chroma)}}return n}class gr{primaryPaletteKeyColor(){return c.fromPalette({name:"primary_palette_key_color",palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone})}secondaryPaletteKeyColor(){return c.fromPalette({name:"secondary_palette_key_color",palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone})}tertiaryPaletteKeyColor(){return c.fromPalette({name:"tertiary_palette_key_color",palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone})}neutralPaletteKeyColor(){return c.fromPalette({name:"neutral_palette_key_color",palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone})}neutralVariantPaletteKeyColor(){return c.fromPalette({name:"neutral_variant_palette_key_color",palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone})}errorPaletteKeyColor(){return c.fromPalette({name:"error_palette_key_color",palette:e=>e.errorPalette,tone:e=>e.errorPalette.keyColor.tone})}background(){return c.fromPalette({name:"background",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}onBackground(){return c.fromPalette({name:"on_background",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.background(),contrastCurve:e=>new y(3,3,4.5,7)})}surface(){return c.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}surfaceDim(){return c.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:new y(87,87,80,75).get(e.contrastLevel),isBackground:!0})}surfaceBright(){return c.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(24,24,29,34).get(e.contrastLevel):98,isBackground:!0})}surfaceContainerLowest(){return c.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(4,4,2,0).get(e.contrastLevel):100,isBackground:!0})}surfaceContainerLow(){return c.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(10,10,11,12).get(e.contrastLevel):new y(96,96,96,95).get(e.contrastLevel),isBackground:!0})}surfaceContainer(){return c.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(12,12,16,20).get(e.contrastLevel):new y(94,94,92,90).get(e.contrastLevel),isBackground:!0})}surfaceContainerHigh(){return c.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(17,17,21,25).get(e.contrastLevel):new y(92,92,88,85).get(e.contrastLevel),isBackground:!0})}surfaceContainerHighest(){return c.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(22,22,26,30).get(e.contrastLevel):new y(90,90,84,80).get(e.contrastLevel),isBackground:!0})}onSurface(){return c.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.highestSurface(e),contrastCurve:e=>new y(4.5,7,11,21)})}surfaceVariant(){return c.fromPalette({name:"surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0})}onSurfaceVariant(){return c.fromPalette({name:"on_surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,11)})}inverseSurface(){return c.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20,isBackground:!0})}inverseOnSurface(){return c.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>this.inverseSurface(),contrastCurve:e=>new y(4.5,7,11,21)})}outline(){return c.fromPalette({name:"outline",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1.5,3,4.5,7)})}outlineVariant(){return c.fromPalette({name:"outline_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5)})}shadow(){return c.fromPalette({name:"shadow",palette:e=>e.neutralPalette,tone:e=>0})}scrim(){return c.fromPalette({name:"scrim",palette:e=>e.neutralPalette,tone:e=>0})}surfaceTint(){return c.fromPalette({name:"surface_tint",palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0})}primary(){return c.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>M(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,7),toneDeltaPair:e=>new w(this.primaryContainer(),this.primary(),10,"nearer",!1)})}primaryDim(){}onPrimary(){return c.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,tone:e=>M(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.primary(),contrastCurve:e=>new y(4.5,7,11,21)})}primaryContainer(){return c.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>re(e)?e.sourceColorHct.tone:M(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.primaryContainer(),this.primary(),10,"nearer",!1)})}onPrimaryContainer(){return c.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,tone:e=>re(e)?c.foregroundTone(this.primaryContainer().tone(e),4.5):M(e)?e.isDark?0:100:e.isDark?90:30,background:e=>this.primaryContainer(),contrastCurve:e=>new y(3,4.5,7,11)})}inversePrimary(){return c.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>this.inverseSurface(),contrastCurve:e=>new y(3,4.5,7,7)})}secondary(){return c.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,7),toneDeltaPair:e=>new w(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}secondaryDim(){}onSecondary(){return c.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,tone:e=>M(e)?e.isDark?10:100:e.isDark?20:100,background:e=>this.secondary(),contrastCurve:e=>new y(4.5,7,11,21)})}secondaryContainer(){return c.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>{const r=e.isDark?30:90;return M(e)?e.isDark?30:85:re(e)?yr(e.secondaryPalette.hue,e.secondaryPalette.chroma,r,!e.isDark):r},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}onSecondaryContainer(){return c.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,tone:e=>M(e)?e.isDark?90:10:re(e)?c.foregroundTone(this.secondaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.secondaryContainer(),contrastCurve:e=>new y(3,4.5,7,11)})}tertiary(){return c.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>M(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,7),toneDeltaPair:e=>new w(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}tertiaryDim(){}onTertiary(){return c.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,tone:e=>M(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.tertiary(),contrastCurve:e=>new y(4.5,7,11,21)})}tertiaryContainer(){return c.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{if(M(e))return e.isDark?60:49;if(!re(e))return e.isDark?30:90;const r=e.tertiaryPalette.getHct(e.sourceColorHct.tone);return Se.fixIfDisliked(r).tone},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}onTertiaryContainer(){return c.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>M(e)?e.isDark?0:100:re(e)?c.foregroundTone(this.tertiaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.tertiaryContainer(),contrastCurve:e=>new y(3,4.5,7,11)})}error(){return c.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,7),toneDeltaPair:e=>new w(this.errorContainer(),this.error(),10,"nearer",!1)})}errorDim(){}onError(){return c.fromPalette({name:"on_error",palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>this.error(),contrastCurve:e=>new y(4.5,7,11,21)})}errorContainer(){return c.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.errorContainer(),this.error(),10,"nearer",!1)})}onErrorContainer(){return c.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,tone:e=>M(e)?e.isDark?90:10:e.isDark?90:30,background:e=>this.errorContainer(),contrastCurve:e=>new y(3,4.5,7,11)})}primaryFixed(){return c.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>M(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}primaryFixedDim(){return c.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>M(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}onPrimaryFixed(){return c.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,tone:e=>M(e)?100:10,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new y(4.5,7,11,21)})}onPrimaryFixedVariant(){return c.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,tone:e=>M(e)?90:30,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new y(3,4.5,7,11)})}secondaryFixed(){return c.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>M(e)?80:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}secondaryFixedDim(){return c.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>M(e)?70:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}onSecondaryFixed(){return c.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>10,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new y(4.5,7,11,21)})}onSecondaryFixedVariant(){return c.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,tone:e=>M(e)?25:30,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new y(3,4.5,7,11)})}tertiaryFixed(){return c.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>M(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}tertiaryFixedDim(){return c.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>M(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new w(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}onTertiaryFixed(){return c.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>M(e)?100:10,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new y(4.5,7,11,21)})}onTertiaryFixedVariant(){return c.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,tone:e=>M(e)?90:30,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new y(3,4.5,7,11)})}highestSurface(e){return e.isDark?this.surfaceBright():this.surfaceDim()}}/**
|
|
227
|
+
* @license
|
|
228
|
+
* Copyright 2025 Google LLC
|
|
229
|
+
*
|
|
230
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
231
|
+
* you may not use this file except in compliance with the License.
|
|
232
|
+
* You may obtain a copy of the License at
|
|
233
|
+
*
|
|
234
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
235
|
+
*
|
|
236
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
237
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
238
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
239
|
+
* See the License for the specific language governing permissions and
|
|
240
|
+
* limitations under the License.
|
|
241
|
+
*/function F(a,e=0,r=100,t=1){let n=Oe(a.hue,a.chroma*t,100,!0);return H(e,r,n)}function W(a,e=0,r=100){let t=Oe(a.hue,a.chroma,0,!1);return H(e,r,t)}function Oe(a,e,r,t){let n=r,s=T.from(a,e,n);for(;s.chroma<e&&!(r<0||r>100);){r+=t?-1:1;const i=T.from(a,e,r);s.chroma<i.chroma&&(s=i,n=r)}return n}function k(a){return a===1.5?new y(1.5,1.5,3,5.5):a===3?new y(3,3,4.5,7):a===4.5?new y(4.5,4.5,7,11):a===6?new y(6,6,7,11):a===7?new y(7,7,11,21):a===9?new y(9,9,11,21):a===11?new y(11,11,21,21):a===21?new y(21,21,21,21):new y(a,a,7,21)}class Pr extends gr{surface(){const e=c.fromPalette({name:"surface",palette:r=>r.neutralPalette,tone:r=>(super.surface().tone(r),r.platform==="phone"?r.isDark?4:T.isYellow(r.neutralPalette.hue)?99:r.variant===f.VIBRANT?97:98:0),isBackground:!0});return b(super.surface(),"2025",e)}surfaceDim(){const e=c.fromPalette({name:"surface_dim",palette:r=>r.neutralPalette,tone:r=>r.isDark?4:T.isYellow(r.neutralPalette.hue)?90:r.variant===f.VIBRANT?85:87,isBackground:!0,chromaMultiplier:r=>{if(!r.isDark){if(r.variant===f.NEUTRAL)return 2.5;if(r.variant===f.TONAL_SPOT)return 1.7;if(r.variant===f.EXPRESSIVE)return T.isYellow(r.neutralPalette.hue)?2.7:1.75;if(r.variant===f.VIBRANT)return 1.36}return 1}});return b(super.surfaceDim(),"2025",e)}surfaceBright(){const e=c.fromPalette({name:"surface_bright",palette:r=>r.neutralPalette,tone:r=>r.isDark?18:T.isYellow(r.neutralPalette.hue)?99:r.variant===f.VIBRANT?97:98,isBackground:!0,chromaMultiplier:r=>{if(r.isDark){if(r.variant===f.NEUTRAL)return 2.5;if(r.variant===f.TONAL_SPOT)return 1.7;if(r.variant===f.EXPRESSIVE)return T.isYellow(r.neutralPalette.hue)?2.7:1.75;if(r.variant===f.VIBRANT)return 1.36}return 1}});return b(super.surfaceBright(),"2025",e)}surfaceContainerLowest(){const e=c.fromPalette({name:"surface_container_lowest",palette:r=>r.neutralPalette,tone:r=>r.isDark?0:100,isBackground:!0});return b(super.surfaceContainerLowest(),"2025",e)}surfaceContainerLow(){const e=c.fromPalette({name:"surface_container_low",palette:r=>r.neutralPalette,tone:r=>r.platform==="phone"?r.isDark?6:T.isYellow(r.neutralPalette.hue)?98:r.variant===f.VIBRANT?95:96:15,isBackground:!0,chromaMultiplier:r=>{if(r.platform==="phone"){if(r.variant===f.NEUTRAL)return 1.3;if(r.variant===f.TONAL_SPOT)return 1.25;if(r.variant===f.EXPRESSIVE)return T.isYellow(r.neutralPalette.hue)?1.3:1.15;if(r.variant===f.VIBRANT)return 1.08}return 1}});return b(super.surfaceContainerLow(),"2025",e)}surfaceContainer(){const e=c.fromPalette({name:"surface_container",palette:r=>r.neutralPalette,tone:r=>r.platform==="phone"?r.isDark?9:T.isYellow(r.neutralPalette.hue)?96:r.variant===f.VIBRANT?92:94:20,isBackground:!0,chromaMultiplier:r=>{if(r.platform==="phone"){if(r.variant===f.NEUTRAL)return 1.6;if(r.variant===f.TONAL_SPOT)return 1.4;if(r.variant===f.EXPRESSIVE)return T.isYellow(r.neutralPalette.hue)?1.6:1.3;if(r.variant===f.VIBRANT)return 1.15}return 1}});return b(super.surfaceContainer(),"2025",e)}surfaceContainerHigh(){const e=c.fromPalette({name:"surface_container_high",palette:r=>r.neutralPalette,tone:r=>r.platform==="phone"?r.isDark?12:T.isYellow(r.neutralPalette.hue)?94:r.variant===f.VIBRANT?90:92:25,isBackground:!0,chromaMultiplier:r=>{if(r.platform==="phone"){if(r.variant===f.NEUTRAL)return 1.9;if(r.variant===f.TONAL_SPOT)return 1.5;if(r.variant===f.EXPRESSIVE)return T.isYellow(r.neutralPalette.hue)?1.95:1.45;if(r.variant===f.VIBRANT)return 1.22}return 1}});return b(super.surfaceContainerHigh(),"2025",e)}surfaceContainerHighest(){const e=c.fromPalette({name:"surface_container_highest",palette:r=>r.neutralPalette,tone:r=>r.isDark?15:T.isYellow(r.neutralPalette.hue)?92:r.variant===f.VIBRANT?88:90,isBackground:!0,chromaMultiplier:r=>r.variant===f.NEUTRAL?2.2:r.variant===f.TONAL_SPOT?1.7:r.variant===f.EXPRESSIVE?T.isYellow(r.neutralPalette.hue)?2.3:1.6:r.variant===f.VIBRANT?1.29:1});return b(super.surfaceContainerHighest(),"2025",e)}onSurface(){const e=c.fromPalette({name:"on_surface",palette:r=>r.neutralPalette,tone:r=>r.variant===f.VIBRANT?F(r.neutralPalette,0,100,1.1):c.getInitialToneFromBackground(t=>t.platform==="phone"?this.highestSurface(t):this.surfaceContainerHigh())(r),chromaMultiplier:r=>{if(r.platform==="phone"){if(r.variant===f.NEUTRAL)return 2.2;if(r.variant===f.TONAL_SPOT)return 1.7;if(r.variant===f.EXPRESSIVE)return T.isYellow(r.neutralPalette.hue)?r.isDark?3:2.3:1.6}return 1},background:r=>r.platform==="phone"?this.highestSurface(r):this.surfaceContainerHigh(),contrastCurve:r=>r.isDark&&r.platform==="phone"?k(11):k(9)});return b(super.onSurface(),"2025",e)}onSurfaceVariant(){const e=c.fromPalette({name:"on_surface_variant",palette:r=>r.neutralPalette,chromaMultiplier:r=>{if(r.platform==="phone"){if(r.variant===f.NEUTRAL)return 2.2;if(r.variant===f.TONAL_SPOT)return 1.7;if(r.variant===f.EXPRESSIVE)return T.isYellow(r.neutralPalette.hue)?r.isDark?3:2.3:1.6}return 1},background:r=>r.platform==="phone"?this.highestSurface(r):this.surfaceContainerHigh(),contrastCurve:r=>r.platform==="phone"?r.isDark?k(6):k(4.5):k(7)});return b(super.onSurfaceVariant(),"2025",e)}outline(){const e=c.fromPalette({name:"outline",palette:r=>r.neutralPalette,chromaMultiplier:r=>{if(r.platform==="phone"){if(r.variant===f.NEUTRAL)return 2.2;if(r.variant===f.TONAL_SPOT)return 1.7;if(r.variant===f.EXPRESSIVE)return T.isYellow(r.neutralPalette.hue)?r.isDark?3:2.3:1.6}return 1},background:r=>r.platform==="phone"?this.highestSurface(r):this.surfaceContainerHigh(),contrastCurve:r=>r.platform==="phone"?k(3):k(4.5)});return b(super.outline(),"2025",e)}outlineVariant(){const e=c.fromPalette({name:"outline_variant",palette:r=>r.neutralPalette,chromaMultiplier:r=>{if(r.platform==="phone"){if(r.variant===f.NEUTRAL)return 2.2;if(r.variant===f.TONAL_SPOT)return 1.7;if(r.variant===f.EXPRESSIVE)return T.isYellow(r.neutralPalette.hue)?r.isDark?3:2.3:1.6}return 1},background:r=>r.platform==="phone"?this.highestSurface(r):this.surfaceContainerHigh(),contrastCurve:r=>r.platform==="phone"?k(1.5):k(3)});return b(super.outlineVariant(),"2025",e)}inverseSurface(){const e=c.fromPalette({name:"inverse_surface",palette:r=>r.neutralPalette,tone:r=>r.isDark?98:4,isBackground:!0});return b(super.inverseSurface(),"2025",e)}inverseOnSurface(){const e=c.fromPalette({name:"inverse_on_surface",palette:r=>r.neutralPalette,background:r=>this.inverseSurface(),contrastCurve:r=>k(7)});return b(super.inverseOnSurface(),"2025",e)}primary(){const e=c.fromPalette({name:"primary",palette:r=>r.primaryPalette,tone:r=>r.variant===f.NEUTRAL?r.platform==="phone"?r.isDark?80:40:90:r.variant===f.TONAL_SPOT?r.platform==="phone"?r.isDark?80:F(r.primaryPalette):F(r.primaryPalette,0,90):r.variant===f.EXPRESSIVE?r.platform==="phone"?F(r.primaryPalette,0,T.isYellow(r.primaryPalette.hue)?25:T.isCyan(r.primaryPalette.hue)?88:98):F(r.primaryPalette):r.platform==="phone"?F(r.primaryPalette,0,T.isCyan(r.primaryPalette.hue)?88:98):F(r.primaryPalette),isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):this.surfaceContainerHigh(),contrastCurve:r=>r.platform==="phone"?k(4.5):k(7),toneDeltaPair:r=>r.platform==="phone"?new w(this.primaryContainer(),this.primary(),5,"relative_lighter",!0,"farther"):void 0});return b(super.primary(),"2025",e)}primaryDim(){return c.fromPalette({name:"primary_dim",palette:e=>e.primaryPalette,tone:e=>e.variant===f.NEUTRAL?85:e.variant===f.TONAL_SPOT?F(e.primaryPalette,0,90):F(e.primaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>k(4.5),toneDeltaPair:e=>new w(this.primaryDim(),this.primary(),5,"darker",!0,"farther")})}onPrimary(){const e=c.fromPalette({name:"on_primary",palette:r=>r.primaryPalette,background:r=>r.platform==="phone"?this.primary():this.primaryDim(),contrastCurve:r=>r.platform==="phone"?k(6):k(7)});return b(super.onPrimary(),"2025",e)}primaryContainer(){const e=c.fromPalette({name:"primary_container",palette:r=>r.primaryPalette,tone:r=>r.platform==="watch"?30:r.variant===f.NEUTRAL?r.isDark?30:90:r.variant===f.TONAL_SPOT?r.isDark?W(r.primaryPalette,35,93):F(r.primaryPalette,0,90):r.variant===f.EXPRESSIVE?r.isDark?F(r.primaryPalette,30,93):F(r.primaryPalette,78,T.isCyan(r.primaryPalette.hue)?88:90):r.isDark?W(r.primaryPalette,66,93):F(r.primaryPalette,66,T.isCyan(r.primaryPalette.hue)?88:93),isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):void 0,toneDeltaPair:r=>r.platform==="phone"?void 0:new w(this.primaryContainer(),this.primaryDim(),10,"darker",!0,"farther"),contrastCurve:r=>r.platform==="phone"&&r.contrastLevel>0?k(1.5):void 0});return b(super.primaryContainer(),"2025",e)}onPrimaryContainer(){const e=c.fromPalette({name:"on_primary_container",palette:r=>r.primaryPalette,background:r=>this.primaryContainer(),contrastCurve:r=>r.platform==="phone"?k(6):k(7)});return b(super.onPrimaryContainer(),"2025",e)}primaryFixed(){const e=c.fromPalette({name:"primary_fixed",palette:r=>r.primaryPalette,tone:r=>{let t=Object.assign({},r,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(t)},isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):void 0,contrastCurve:r=>r.platform==="phone"&&r.contrastLevel>0?k(1.5):void 0});return b(super.primaryFixed(),"2025",e)}primaryFixedDim(){const e=c.fromPalette({name:"primary_fixed_dim",palette:r=>r.primaryPalette,tone:r=>this.primaryFixed().getTone(r),isBackground:!0,toneDeltaPair:r=>new w(this.primaryFixedDim(),this.primaryFixed(),5,"darker",!0,"exact")});return b(super.primaryFixedDim(),"2025",e)}onPrimaryFixed(){const e=c.fromPalette({name:"on_primary_fixed",palette:r=>r.primaryPalette,background:r=>this.primaryFixedDim(),contrastCurve:r=>k(7)});return b(super.onPrimaryFixed(),"2025",e)}onPrimaryFixedVariant(){const e=c.fromPalette({name:"on_primary_fixed_variant",palette:r=>r.primaryPalette,background:r=>this.primaryFixedDim(),contrastCurve:r=>k(4.5)});return b(super.onPrimaryFixedVariant(),"2025",e)}inversePrimary(){const e=c.fromPalette({name:"inverse_primary",palette:r=>r.primaryPalette,tone:r=>F(r.primaryPalette),background:r=>this.inverseSurface(),contrastCurve:r=>r.platform==="phone"?k(6):k(7)});return b(super.inversePrimary(),"2025",e)}secondary(){const e=c.fromPalette({name:"secondary",palette:r=>r.secondaryPalette,tone:r=>r.platform==="watch"?r.variant===f.NEUTRAL?90:F(r.secondaryPalette,0,90):r.variant===f.NEUTRAL?r.isDark?W(r.secondaryPalette,0,98):F(r.secondaryPalette):r.variant===f.VIBRANT?F(r.secondaryPalette,0,r.isDark?90:98):r.isDark?80:F(r.secondaryPalette),isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):this.surfaceContainerHigh(),contrastCurve:r=>r.platform==="phone"?k(4.5):k(7),toneDeltaPair:r=>r.platform==="phone"?new w(this.secondaryContainer(),this.secondary(),5,"relative_lighter",!0,"farther"):void 0});return b(super.secondary(),"2025",e)}secondaryDim(){return c.fromPalette({name:"secondary_dim",palette:e=>e.secondaryPalette,tone:e=>e.variant===f.NEUTRAL?85:F(e.secondaryPalette,0,90),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>k(4.5),toneDeltaPair:e=>new w(this.secondaryDim(),this.secondary(),5,"darker",!0,"farther")})}onSecondary(){const e=c.fromPalette({name:"on_secondary",palette:r=>r.secondaryPalette,background:r=>r.platform==="phone"?this.secondary():this.secondaryDim(),contrastCurve:r=>r.platform==="phone"?k(6):k(7)});return b(super.onSecondary(),"2025",e)}secondaryContainer(){const e=c.fromPalette({name:"secondary_container",palette:r=>r.secondaryPalette,tone:r=>r.platform==="watch"?30:r.variant===f.VIBRANT?r.isDark?W(r.secondaryPalette,30,40):F(r.secondaryPalette,84,90):r.variant===f.EXPRESSIVE?r.isDark?15:F(r.secondaryPalette,90,95):r.isDark?25:90,isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):void 0,toneDeltaPair:r=>r.platform==="watch"?new w(this.secondaryContainer(),this.secondaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:r=>r.platform==="phone"&&r.contrastLevel>0?k(1.5):void 0});return b(super.secondaryContainer(),"2025",e)}onSecondaryContainer(){const e=c.fromPalette({name:"on_secondary_container",palette:r=>r.secondaryPalette,background:r=>this.secondaryContainer(),contrastCurve:r=>r.platform==="phone"?k(6):k(7)});return b(super.onSecondaryContainer(),"2025",e)}secondaryFixed(){const e=c.fromPalette({name:"secondary_fixed",palette:r=>r.secondaryPalette,tone:r=>{let t=Object.assign({},r,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(t)},isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):void 0,contrastCurve:r=>r.platform==="phone"&&r.contrastLevel>0?k(1.5):void 0});return b(super.secondaryFixed(),"2025",e)}secondaryFixedDim(){const e=c.fromPalette({name:"secondary_fixed_dim",palette:r=>r.secondaryPalette,tone:r=>this.secondaryFixed().getTone(r),isBackground:!0,toneDeltaPair:r=>new w(this.secondaryFixedDim(),this.secondaryFixed(),5,"darker",!0,"exact")});return b(super.secondaryFixedDim(),"2025",e)}onSecondaryFixed(){const e=c.fromPalette({name:"on_secondary_fixed",palette:r=>r.secondaryPalette,background:r=>this.secondaryFixedDim(),contrastCurve:r=>k(7)});return b(super.onSecondaryFixed(),"2025",e)}onSecondaryFixedVariant(){const e=c.fromPalette({name:"on_secondary_fixed_variant",palette:r=>r.secondaryPalette,background:r=>this.secondaryFixedDim(),contrastCurve:r=>k(4.5)});return b(super.onSecondaryFixedVariant(),"2025",e)}tertiary(){const e=c.fromPalette({name:"tertiary",palette:r=>r.tertiaryPalette,tone:r=>r.platform==="watch"?r.variant===f.TONAL_SPOT?F(r.tertiaryPalette,0,90):F(r.tertiaryPalette):r.variant===f.EXPRESSIVE||r.variant===f.VIBRANT?F(r.tertiaryPalette,0,T.isCyan(r.tertiaryPalette.hue)?88:r.isDark?98:100):r.isDark?F(r.tertiaryPalette,0,98):F(r.tertiaryPalette),isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):this.surfaceContainerHigh(),contrastCurve:r=>r.platform==="phone"?k(4.5):k(7),toneDeltaPair:r=>r.platform==="phone"?new w(this.tertiaryContainer(),this.tertiary(),5,"relative_lighter",!0,"farther"):void 0});return b(super.tertiary(),"2025",e)}tertiaryDim(){return c.fromPalette({name:"tertiary_dim",palette:e=>e.tertiaryPalette,tone:e=>e.variant===f.TONAL_SPOT?F(e.tertiaryPalette,0,90):F(e.tertiaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>k(4.5),toneDeltaPair:e=>new w(this.tertiaryDim(),this.tertiary(),5,"darker",!0,"farther")})}onTertiary(){const e=c.fromPalette({name:"on_tertiary",palette:r=>r.tertiaryPalette,background:r=>r.platform==="phone"?this.tertiary():this.tertiaryDim(),contrastCurve:r=>r.platform==="phone"?k(6):k(7)});return b(super.onTertiary(),"2025",e)}tertiaryContainer(){const e=c.fromPalette({name:"tertiary_container",palette:r=>r.tertiaryPalette,tone:r=>r.platform==="watch"?r.variant===f.TONAL_SPOT?F(r.tertiaryPalette,0,90):F(r.tertiaryPalette):r.variant===f.NEUTRAL?r.isDark?F(r.tertiaryPalette,0,93):F(r.tertiaryPalette,0,96):r.variant===f.TONAL_SPOT?F(r.tertiaryPalette,0,r.isDark?93:100):r.variant===f.EXPRESSIVE?F(r.tertiaryPalette,75,T.isCyan(r.tertiaryPalette.hue)?88:r.isDark?93:100):r.isDark?F(r.tertiaryPalette,0,93):F(r.tertiaryPalette,72,100),isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):void 0,toneDeltaPair:r=>r.platform==="watch"?new w(this.tertiaryContainer(),this.tertiaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:r=>r.platform==="phone"&&r.contrastLevel>0?k(1.5):void 0});return b(super.tertiaryContainer(),"2025",e)}onTertiaryContainer(){const e=c.fromPalette({name:"on_tertiary_container",palette:r=>r.tertiaryPalette,background:r=>this.tertiaryContainer(),contrastCurve:r=>r.platform==="phone"?k(6):k(7)});return b(super.onTertiaryContainer(),"2025",e)}tertiaryFixed(){const e=c.fromPalette({name:"tertiary_fixed",palette:r=>r.tertiaryPalette,tone:r=>{let t=Object.assign({},r,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(t)},isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):void 0,contrastCurve:r=>r.platform==="phone"&&r.contrastLevel>0?k(1.5):void 0});return b(super.tertiaryFixed(),"2025",e)}tertiaryFixedDim(){const e=c.fromPalette({name:"tertiary_fixed_dim",palette:r=>r.tertiaryPalette,tone:r=>this.tertiaryFixed().getTone(r),isBackground:!0,toneDeltaPair:r=>new w(this.tertiaryFixedDim(),this.tertiaryFixed(),5,"darker",!0,"exact")});return b(super.tertiaryFixedDim(),"2025",e)}onTertiaryFixed(){const e=c.fromPalette({name:"on_tertiary_fixed",palette:r=>r.tertiaryPalette,background:r=>this.tertiaryFixedDim(),contrastCurve:r=>k(7)});return b(super.onTertiaryFixed(),"2025",e)}onTertiaryFixedVariant(){const e=c.fromPalette({name:"on_tertiary_fixed_variant",palette:r=>r.tertiaryPalette,background:r=>this.tertiaryFixedDim(),contrastCurve:r=>k(4.5)});return b(super.onTertiaryFixedVariant(),"2025",e)}error(){const e=c.fromPalette({name:"error",palette:r=>r.errorPalette,tone:r=>r.platform==="phone"?r.isDark?W(r.errorPalette,0,98):F(r.errorPalette):W(r.errorPalette),isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):this.surfaceContainerHigh(),contrastCurve:r=>r.platform==="phone"?k(4.5):k(7),toneDeltaPair:r=>r.platform==="phone"?new w(this.errorContainer(),this.error(),5,"relative_lighter",!0,"farther"):void 0});return b(super.error(),"2025",e)}errorDim(){return c.fromPalette({name:"error_dim",palette:e=>e.errorPalette,tone:e=>W(e.errorPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>k(4.5),toneDeltaPair:e=>new w(this.errorDim(),this.error(),5,"darker",!0,"farther")})}onError(){const e=c.fromPalette({name:"on_error",palette:r=>r.errorPalette,background:r=>r.platform==="phone"?this.error():this.errorDim(),contrastCurve:r=>r.platform==="phone"?k(6):k(7)});return b(super.onError(),"2025",e)}errorContainer(){const e=c.fromPalette({name:"error_container",palette:r=>r.errorPalette,tone:r=>r.platform==="watch"?30:r.isDark?W(r.errorPalette,30,93):F(r.errorPalette,0,90),isBackground:!0,background:r=>r.platform==="phone"?this.highestSurface(r):void 0,toneDeltaPair:r=>r.platform==="watch"?new w(this.errorContainer(),this.errorDim(),10,"darker",!0,"farther"):void 0,contrastCurve:r=>r.platform==="phone"&&r.contrastLevel>0?k(1.5):void 0});return b(super.errorContainer(),"2025",e)}onErrorContainer(){const e=c.fromPalette({name:"on_error_container",palette:r=>r.errorPalette,background:r=>this.errorContainer(),contrastCurve:r=>r.platform==="phone"?k(4.5):k(7)});return b(super.onErrorContainer(),"2025",e)}surfaceVariant(){const e=Object.assign(this.surfaceContainerHighest().clone(),{name:"surface_variant"});return b(super.surfaceVariant(),"2025",e)}surfaceTint(){const e=Object.assign(this.primary().clone(),{name:"surface_tint"});return b(super.surfaceTint(),"2025",e)}background(){const e=Object.assign(this.surface().clone(),{name:"background"});return b(super.background(),"2025",e)}onBackground(){const e=Object.assign(this.onSurface().clone(),{name:"on_background",tone:r=>r.platform==="watch"?100:this.onSurface().getTone(r)});return b(super.onBackground(),"2025",e)}}/**
|
|
242
|
+
* @license
|
|
243
|
+
* Copyright 2022 Google LLC
|
|
244
|
+
*
|
|
245
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
246
|
+
* you may not use this file except in compliance with the License.
|
|
247
|
+
* You may obtain a copy of the License at
|
|
248
|
+
*
|
|
249
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
250
|
+
*
|
|
251
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
252
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
253
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
254
|
+
* See the License for the specific language governing permissions and
|
|
255
|
+
* limitations under the License.
|
|
256
|
+
*/class o{constructor(){this.allColors=[this.background(),this.onBackground(),this.surface(),this.surfaceDim(),this.surfaceBright(),this.surfaceContainerLowest(),this.surfaceContainerLow(),this.surfaceContainer(),this.surfaceContainerHigh(),this.surfaceContainerHighest(),this.onSurface(),this.onSurfaceVariant(),this.outline(),this.outlineVariant(),this.inverseSurface(),this.inverseOnSurface(),this.primary(),this.primaryDim(),this.onPrimary(),this.primaryContainer(),this.onPrimaryContainer(),this.primaryFixed(),this.primaryFixedDim(),this.onPrimaryFixed(),this.onPrimaryFixedVariant(),this.inversePrimary(),this.secondary(),this.secondaryDim(),this.onSecondary(),this.secondaryContainer(),this.onSecondaryContainer(),this.secondaryFixed(),this.secondaryFixedDim(),this.onSecondaryFixed(),this.onSecondaryFixedVariant(),this.tertiary(),this.tertiaryDim(),this.onTertiary(),this.tertiaryContainer(),this.onTertiaryContainer(),this.tertiaryFixed(),this.tertiaryFixedDim(),this.onTertiaryFixed(),this.onTertiaryFixedVariant(),this.error(),this.errorDim(),this.onError(),this.errorContainer(),this.onErrorContainer()].filter(e=>e!==void 0)}highestSurface(e){return o.colorSpec.highestSurface(e)}primaryPaletteKeyColor(){return o.colorSpec.primaryPaletteKeyColor()}secondaryPaletteKeyColor(){return o.colorSpec.secondaryPaletteKeyColor()}tertiaryPaletteKeyColor(){return o.colorSpec.tertiaryPaletteKeyColor()}neutralPaletteKeyColor(){return o.colorSpec.neutralPaletteKeyColor()}neutralVariantPaletteKeyColor(){return o.colorSpec.neutralVariantPaletteKeyColor()}errorPaletteKeyColor(){return o.colorSpec.errorPaletteKeyColor()}background(){return o.colorSpec.background()}onBackground(){return o.colorSpec.onBackground()}surface(){return o.colorSpec.surface()}surfaceDim(){return o.colorSpec.surfaceDim()}surfaceBright(){return o.colorSpec.surfaceBright()}surfaceContainerLowest(){return o.colorSpec.surfaceContainerLowest()}surfaceContainerLow(){return o.colorSpec.surfaceContainerLow()}surfaceContainer(){return o.colorSpec.surfaceContainer()}surfaceContainerHigh(){return o.colorSpec.surfaceContainerHigh()}surfaceContainerHighest(){return o.colorSpec.surfaceContainerHighest()}onSurface(){return o.colorSpec.onSurface()}surfaceVariant(){return o.colorSpec.surfaceVariant()}onSurfaceVariant(){return o.colorSpec.onSurfaceVariant()}outline(){return o.colorSpec.outline()}outlineVariant(){return o.colorSpec.outlineVariant()}inverseSurface(){return o.colorSpec.inverseSurface()}inverseOnSurface(){return o.colorSpec.inverseOnSurface()}shadow(){return o.colorSpec.shadow()}scrim(){return o.colorSpec.scrim()}surfaceTint(){return o.colorSpec.surfaceTint()}primary(){return o.colorSpec.primary()}primaryDim(){return o.colorSpec.primaryDim()}onPrimary(){return o.colorSpec.onPrimary()}primaryContainer(){return o.colorSpec.primaryContainer()}onPrimaryContainer(){return o.colorSpec.onPrimaryContainer()}inversePrimary(){return o.colorSpec.inversePrimary()}primaryFixed(){return o.colorSpec.primaryFixed()}primaryFixedDim(){return o.colorSpec.primaryFixedDim()}onPrimaryFixed(){return o.colorSpec.onPrimaryFixed()}onPrimaryFixedVariant(){return o.colorSpec.onPrimaryFixedVariant()}secondary(){return o.colorSpec.secondary()}secondaryDim(){return o.colorSpec.secondaryDim()}onSecondary(){return o.colorSpec.onSecondary()}secondaryContainer(){return o.colorSpec.secondaryContainer()}onSecondaryContainer(){return o.colorSpec.onSecondaryContainer()}secondaryFixed(){return o.colorSpec.secondaryFixed()}secondaryFixedDim(){return o.colorSpec.secondaryFixedDim()}onSecondaryFixed(){return o.colorSpec.onSecondaryFixed()}onSecondaryFixedVariant(){return o.colorSpec.onSecondaryFixedVariant()}tertiary(){return o.colorSpec.tertiary()}tertiaryDim(){return o.colorSpec.tertiaryDim()}onTertiary(){return o.colorSpec.onTertiary()}tertiaryContainer(){return o.colorSpec.tertiaryContainer()}onTertiaryContainer(){return o.colorSpec.onTertiaryContainer()}tertiaryFixed(){return o.colorSpec.tertiaryFixed()}tertiaryFixedDim(){return o.colorSpec.tertiaryFixedDim()}onTertiaryFixed(){return o.colorSpec.onTertiaryFixed()}onTertiaryFixedVariant(){return o.colorSpec.onTertiaryFixedVariant()}error(){return o.colorSpec.error()}errorDim(){return o.colorSpec.errorDim()}onError(){return o.colorSpec.onError()}errorContainer(){return o.colorSpec.errorContainer()}onErrorContainer(){return o.colorSpec.onErrorContainer()}static highestSurface(e){return o.colorSpec.highestSurface(e)}}o.contentAccentToneDelta=15;o.colorSpec=new Pr;o.primaryPaletteKeyColor=o.colorSpec.primaryPaletteKeyColor();o.secondaryPaletteKeyColor=o.colorSpec.secondaryPaletteKeyColor();o.tertiaryPaletteKeyColor=o.colorSpec.tertiaryPaletteKeyColor();o.neutralPaletteKeyColor=o.colorSpec.neutralPaletteKeyColor();o.neutralVariantPaletteKeyColor=o.colorSpec.neutralVariantPaletteKeyColor();o.background=o.colorSpec.background();o.onBackground=o.colorSpec.onBackground();o.surface=o.colorSpec.surface();o.surfaceDim=o.colorSpec.surfaceDim();o.surfaceBright=o.colorSpec.surfaceBright();o.surfaceContainerLowest=o.colorSpec.surfaceContainerLowest();o.surfaceContainerLow=o.colorSpec.surfaceContainerLow();o.surfaceContainer=o.colorSpec.surfaceContainer();o.surfaceContainerHigh=o.colorSpec.surfaceContainerHigh();o.surfaceContainerHighest=o.colorSpec.surfaceContainerHighest();o.onSurface=o.colorSpec.onSurface();o.surfaceVariant=o.colorSpec.surfaceVariant();o.onSurfaceVariant=o.colorSpec.onSurfaceVariant();o.inverseSurface=o.colorSpec.inverseSurface();o.inverseOnSurface=o.colorSpec.inverseOnSurface();o.outline=o.colorSpec.outline();o.outlineVariant=o.colorSpec.outlineVariant();o.shadow=o.colorSpec.shadow();o.scrim=o.colorSpec.scrim();o.surfaceTint=o.colorSpec.surfaceTint();o.primary=o.colorSpec.primary();o.onPrimary=o.colorSpec.onPrimary();o.primaryContainer=o.colorSpec.primaryContainer();o.onPrimaryContainer=o.colorSpec.onPrimaryContainer();o.inversePrimary=o.colorSpec.inversePrimary();o.secondary=o.colorSpec.secondary();o.onSecondary=o.colorSpec.onSecondary();o.secondaryContainer=o.colorSpec.secondaryContainer();o.onSecondaryContainer=o.colorSpec.onSecondaryContainer();o.tertiary=o.colorSpec.tertiary();o.onTertiary=o.colorSpec.onTertiary();o.tertiaryContainer=o.colorSpec.tertiaryContainer();o.onTertiaryContainer=o.colorSpec.onTertiaryContainer();o.error=o.colorSpec.error();o.onError=o.colorSpec.onError();o.errorContainer=o.colorSpec.errorContainer();o.onErrorContainer=o.colorSpec.onErrorContainer();o.primaryFixed=o.colorSpec.primaryFixed();o.primaryFixedDim=o.colorSpec.primaryFixedDim();o.onPrimaryFixed=o.colorSpec.onPrimaryFixed();o.onPrimaryFixedVariant=o.colorSpec.onPrimaryFixedVariant();o.secondaryFixed=o.colorSpec.secondaryFixed();o.secondaryFixedDim=o.colorSpec.secondaryFixedDim();o.onSecondaryFixed=o.colorSpec.onSecondaryFixed();o.onSecondaryFixedVariant=o.colorSpec.onSecondaryFixedVariant();o.tertiaryFixed=o.colorSpec.tertiaryFixed();o.tertiaryFixedDim=o.colorSpec.tertiaryFixedDim();o.onTertiaryFixed=o.colorSpec.onTertiaryFixed();o.onTertiaryFixedVariant=o.colorSpec.onTertiaryFixedVariant();/**
|
|
257
|
+
* @license
|
|
258
|
+
* Copyright 2021 Google LLC
|
|
259
|
+
*
|
|
260
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
261
|
+
* you may not use this file except in compliance with the License.
|
|
262
|
+
* You may obtain a copy of the License at
|
|
263
|
+
*
|
|
264
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
265
|
+
*
|
|
266
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
267
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
268
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
269
|
+
* See the License for the specific language governing permissions and
|
|
270
|
+
* limitations under the License.
|
|
271
|
+
*/class U{static of(e){return new U(e,!1)}static contentOf(e){return new U(e,!0)}static fromColors(e){return U.createPaletteFromColors(!1,e)}static contentFromColors(e){return U.createPaletteFromColors(!0,e)}static createPaletteFromColors(e,r){const t=new U(r.primary,e);if(r.secondary){const n=new U(r.secondary,e);t.a2=n.a1}if(r.tertiary){const n=new U(r.tertiary,e);t.a3=n.a1}if(r.error){const n=new U(r.error,e);t.error=n.a1}if(r.neutral){const n=new U(r.neutral,e);t.n1=n.n1}if(r.neutralVariant){const n=new U(r.neutralVariant,e);t.n2=n.n2}return t}constructor(e,r){const t=T.fromInt(e),n=t.hue,s=t.chroma;r?(this.a1=Y.fromHueAndChroma(n,s),this.a2=Y.fromHueAndChroma(n,s/3),this.a3=Y.fromHueAndChroma(n+60,s/2),this.n1=Y.fromHueAndChroma(n,Math.min(s/12,4)),this.n2=Y.fromHueAndChroma(n,Math.min(s/6,8))):(this.a1=Y.fromHueAndChroma(n,Math.max(48,s)),this.a2=Y.fromHueAndChroma(n,16),this.a3=Y.fromHueAndChroma(n+60,24),this.n1=Y.fromHueAndChroma(n,4),this.n2=Y.fromHueAndChroma(n,8)),this.error=Y.fromHueAndChroma(25,84)}}/**
|
|
272
|
+
* @license
|
|
273
|
+
* Copyright 2021 Google LLC
|
|
274
|
+
*
|
|
275
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
276
|
+
* you may not use this file except in compliance with the License.
|
|
277
|
+
* You may obtain a copy of the License at
|
|
278
|
+
*
|
|
279
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
280
|
+
*
|
|
281
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
282
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
283
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
284
|
+
* See the License for the specific language governing permissions and
|
|
285
|
+
* limitations under the License.
|
|
286
|
+
*/class X{get primary(){return this.props.primary}get onPrimary(){return this.props.onPrimary}get primaryContainer(){return this.props.primaryContainer}get onPrimaryContainer(){return this.props.onPrimaryContainer}get secondary(){return this.props.secondary}get onSecondary(){return this.props.onSecondary}get secondaryContainer(){return this.props.secondaryContainer}get onSecondaryContainer(){return this.props.onSecondaryContainer}get tertiary(){return this.props.tertiary}get onTertiary(){return this.props.onTertiary}get tertiaryContainer(){return this.props.tertiaryContainer}get onTertiaryContainer(){return this.props.onTertiaryContainer}get error(){return this.props.error}get onError(){return this.props.onError}get errorContainer(){return this.props.errorContainer}get onErrorContainer(){return this.props.onErrorContainer}get background(){return this.props.background}get onBackground(){return this.props.onBackground}get surface(){return this.props.surface}get onSurface(){return this.props.onSurface}get surfaceVariant(){return this.props.surfaceVariant}get onSurfaceVariant(){return this.props.onSurfaceVariant}get outline(){return this.props.outline}get outlineVariant(){return this.props.outlineVariant}get shadow(){return this.props.shadow}get scrim(){return this.props.scrim}get inverseSurface(){return this.props.inverseSurface}get inverseOnSurface(){return this.props.inverseOnSurface}get inversePrimary(){return this.props.inversePrimary}static light(e){return X.lightFromCorePalette(U.of(e))}static dark(e){return X.darkFromCorePalette(U.of(e))}static lightContent(e){return X.lightFromCorePalette(U.contentOf(e))}static darkContent(e){return X.darkFromCorePalette(U.contentOf(e))}static lightFromCorePalette(e){return new X({primary:e.a1.tone(40),onPrimary:e.a1.tone(100),primaryContainer:e.a1.tone(90),onPrimaryContainer:e.a1.tone(10),secondary:e.a2.tone(40),onSecondary:e.a2.tone(100),secondaryContainer:e.a2.tone(90),onSecondaryContainer:e.a2.tone(10),tertiary:e.a3.tone(40),onTertiary:e.a3.tone(100),tertiaryContainer:e.a3.tone(90),onTertiaryContainer:e.a3.tone(10),error:e.error.tone(40),onError:e.error.tone(100),errorContainer:e.error.tone(90),onErrorContainer:e.error.tone(10),background:e.n1.tone(99),onBackground:e.n1.tone(10),surface:e.n1.tone(99),onSurface:e.n1.tone(10),surfaceVariant:e.n2.tone(90),onSurfaceVariant:e.n2.tone(30),outline:e.n2.tone(50),outlineVariant:e.n2.tone(80),shadow:e.n1.tone(0),scrim:e.n1.tone(0),inverseSurface:e.n1.tone(20),inverseOnSurface:e.n1.tone(95),inversePrimary:e.a1.tone(80)})}static darkFromCorePalette(e){return new X({primary:e.a1.tone(80),onPrimary:e.a1.tone(20),primaryContainer:e.a1.tone(30),onPrimaryContainer:e.a1.tone(90),secondary:e.a2.tone(80),onSecondary:e.a2.tone(20),secondaryContainer:e.a2.tone(30),onSecondaryContainer:e.a2.tone(90),tertiary:e.a3.tone(80),onTertiary:e.a3.tone(20),tertiaryContainer:e.a3.tone(30),onTertiaryContainer:e.a3.tone(90),error:e.error.tone(80),onError:e.error.tone(20),errorContainer:e.error.tone(30),onErrorContainer:e.error.tone(80),background:e.n1.tone(10),onBackground:e.n1.tone(90),surface:e.n1.tone(10),onSurface:e.n1.tone(90),surfaceVariant:e.n2.tone(30),onSurfaceVariant:e.n2.tone(80),outline:e.n2.tone(60),outlineVariant:e.n2.tone(30),shadow:e.n1.tone(0),scrim:e.n1.tone(0),inverseSurface:e.n1.tone(90),inverseOnSurface:e.n1.tone(20),inversePrimary:e.a1.tone(40)})}constructor(e){this.props=e}toJSON(){return{...this.props}}}/**
|
|
287
|
+
* @license
|
|
288
|
+
* Copyright 2021 Google LLC
|
|
289
|
+
*
|
|
290
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
291
|
+
* you may not use this file except in compliance with the License.
|
|
292
|
+
* You may obtain a copy of the License at
|
|
293
|
+
*
|
|
294
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
295
|
+
*
|
|
296
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
297
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
298
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
299
|
+
* See the License for the specific language governing permissions and
|
|
300
|
+
* limitations under the License.
|
|
301
|
+
*/function Re(a){const e=Me(a),r=Ie(a),t=Ee(a),n=[e.toString(16),r.toString(16),t.toString(16)];for(const[s,i]of n.entries())i.length===1&&(n[s]="0"+i);return"#"+n.join("")}function Ve(a){a=a.replace("#","");const e=a.length===3,r=a.length===6,t=a.length===8;if(!e&&!r&&!t)throw new Error("unexpected hex "+a);let n=0,s=0,i=0;return e?(n=$(a.slice(0,1).repeat(2)),s=$(a.slice(1,2).repeat(2)),i=$(a.slice(2,3).repeat(2))):r?(n=$(a.slice(0,2)),s=$(a.slice(2,4)),i=$(a.slice(4,6))):t&&(n=$(a.slice(2,4)),s=$(a.slice(4,6)),i=$(a.slice(6,8))),(255<<24|(n&255)<<16|(s&255)<<8|i&255)>>>0}function $(a){return parseInt(a,16)}/**
|
|
302
|
+
* @license
|
|
303
|
+
* Copyright 2021 Google LLC
|
|
304
|
+
*
|
|
305
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
306
|
+
* you may not use this file except in compliance with the License.
|
|
307
|
+
* You may obtain a copy of the License at
|
|
308
|
+
*
|
|
309
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
310
|
+
*
|
|
311
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
312
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
313
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
314
|
+
* See the License for the specific language governing permissions and
|
|
315
|
+
* limitations under the License.
|
|
316
|
+
*/function Ne(a,e=[]){const r=U.of(a);return{source:a,schemes:{light:X.light(a),dark:X.dark(a)},palettes:{primary:r.a1,secondary:r.a2,tertiary:r.a3,neutral:r.n1,neutralVariant:r.n2,error:r.error},customColors:e.map(t=>kr(a,t))}}function kr(a,e){let r=e.value;const t=r,n=a;e.blend&&(r=Ce.harmonize(t,n));const i=U.of(r).a1;return{color:e,value:r,light:{color:i.tone(40),onColor:i.tone(100),colorContainer:i.tone(90),onColorContainer:i.tone(10)},dark:{color:i.tone(80),onColor:i.tone(20),colorContainer:i.tone(30),onColorContainer:i.tone(90)}}}const be=[50,100,200,300,400,500,600,700,800,900],Te={50:90,100:80,200:70,300:60,400:50,500:40,600:35,700:30,800:20,900:10},_e=Object.fromEntries(be.map(a=>[a,Te[a]>=60?10:100])),Cr=a=>{const e=Ae(a,"#000000");return Ne(Ve(e)).palettes.primary},He=(a,e)=>{const r=Cr(a);return Object.fromEntries(be.map(t=>[t,Re(r.tone(e[t]))]))},Ue=a=>He(a,Te),Ye=a=>He(a,_e),Sr=a=>({colors:Ue(a),onColors:Ye(a)});function br(a){return a.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/([a-zA-Z])(\d+)/g,"$1-$2")}exports.COLOR_SEEDS=$e;exports.COLOR_SHADES=be;exports.Hct=T;exports.ON_SHADE_TONES=_e;exports.SHADE_TONES=Te;exports.argbFromHex=Ve;exports.camelToKebabCase=br;exports.colorToHex=Ae;exports.createOnPalette=Ye;exports.createPalette=Ue;exports.createPalettePair=Sr;exports.getContrastingColor=Ze;exports.hexFromArgb=Re;exports.parseColor=ce;exports.rgbToChannels=Je;exports.rgbToHex=ve;exports.themeFromSourceColor=Ne;
|
package/dist/components.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./GSwitch.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./GSwitch.vue_vue_type_script_setup_true_lang-BS6bb1XY.cjs"),i=require("./GLoading.vue_vue_type_style_index_0_lang-Bv3dWEq8.cjs"),G=require("./useSnackbar-BHQshEZ8.cjs"),e=require("./mask-BbofdFd4.cjs"),n=require("./index-DN5ngVtp.cjs"),s=require("./index-B3_n44N_.cjs");exports.BaseOverlay=a.BaseOverlay;exports.GAlert=a.GAlert;exports.GAside=a.GAside;exports.GAsideGroup=a.GAsideGroup;exports.GAsideItem=a.GAsideItem;exports.GBadge=a.GBadge;exports.GCheckbox=a._sfc_main;exports.GCheckboxGroup=a._sfc_main$1;exports.GChip=a.GChip;exports.GDrawer=a.GDrawer;exports.GDropdownGroup=a.GDropdownGroup;exports.GExpandTransition=a._sfc_main$2;exports.GExpansion=a.GExpansion;exports.GExpansionGroup=a.GExpansionGroup;exports.GFAB=a.GFAB;exports.GForm=a._sfc_main$3;exports.GGradientMaterial=a._sfc_main$4;exports.GInput=a._sfc_main$5;exports.GMenu=a.GMenu;exports.GModal=a.GModal;exports.GNavGroup=a.GNavGroup;exports.GNavItem=a.GNavItem;exports.GNavList=a.GNavList;exports.GNavbar=a.GNavbar;exports.GNavbarItem=a.GNavbarItem;exports.GNavbarMenu=a.GNavbarMenu;exports.GNavbarSubItem=a.GNavbarSubItem;exports.GQuickActions=a.GQuickActions;exports.GRadio=a._sfc_main$6;exports.GSelect=a.GSelect;exports.GSquircle=a.GSquircle;exports.GSwitch=a._sfc_main$7;exports.GTab=a.GTab;exports.GTabList=a.GTabList;exports.GTabPanel=a.GTabPanel;exports.GTabPanels=a.GTabPanels;exports.GTable=a._sfc_main$8;exports.GTabs=a.GTabs;exports.GText=a.GText;exports.GTextarea=a._sfc_main$9;exports.GTransitionGroup=a._sfc_main$10;exports.GLoading=i._sfc_main;exports.GProgress=i.GProgress;exports.GTransition=i._sfc_main$1;exports.GButton=G._sfc_main;exports.GGradient=G.GGradient;exports.GIcon=G.GIcon;exports.GSnackbar=G.GSnackbar;exports.useLoading=G.useLoading;exports.useSnackbar=G.useSnackbar;exports.GTooltip=e.GTooltip;exports.vGradientIcon=e.gradientIcon;exports.vGradientText=e.vGradientText;exports.vLoading=e.loading;exports.vMask=e.vMask;exports.vRipple=e.ripple;exports.vSpecular=e.specular;exports.vTooltip=e.vTooltip;exports.applyMask=n.applyMask;exports.defaultMaskTokens=n.defaultMaskTokens;exports.unmaskValue=n.unmaskValue;exports.useMask=n.useMask;exports.defaultBreakpoints=s.defaultBreakpoints;exports.useBreakpoints=s.useBreakpoints;
|
package/dist/components.mjs
CHANGED
|
@@ -1,69 +1,72 @@
|
|
|
1
|
-
import { B as G, G as e, a as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { G as
|
|
5
|
-
import { a as
|
|
6
|
-
import { d as
|
|
1
|
+
import { B as G, G as e, a as r, b as o, c as t, d as n, _ as i, e as p, f as u, g as d, h as b, i as l, j as v, k as x, l as T, m as c, n as k, o as m, p as f, q as M, r as I, s as N, t as g, u as A, v as B, w as S, x as L, y as h, z as w, A as C, C as E, D as y, E as D, F, H as P, I as _, J as q, K as R, L as j, M as z, N as H } from "./GSwitch.vue_vue_type_script_setup_true_lang-UTBNFP5X.js";
|
|
2
|
+
import { _ as K, G as O, a as Q } from "./GLoading.vue_vue_type_style_index_0_lang-CBB_GocW.js";
|
|
3
|
+
import { _ as U, G as W, a as X, b as Y, u as Z, c as $ } from "./useSnackbar-DeNHZH8v.js";
|
|
4
|
+
import { G as sa, g as Ga, v as ea, l as ra, a as oa, r as ta, s as na, b as ia } from "./mask-CZX-I_iy.js";
|
|
5
|
+
import { a as ua, d as da, u as ba, b as la } from "./index-Cs3XQ3JB.js";
|
|
6
|
+
import { d as xa, u as Ta } from "./index-BtCLucTD.js";
|
|
7
7
|
export {
|
|
8
8
|
G as BaseOverlay,
|
|
9
9
|
e as GAlert,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
r as GAside,
|
|
11
|
+
o as GAsideGroup,
|
|
12
12
|
t as GAsideItem,
|
|
13
13
|
n as GBadge,
|
|
14
|
-
|
|
14
|
+
U as GButton,
|
|
15
15
|
i as GCheckbox,
|
|
16
16
|
p as GCheckboxGroup,
|
|
17
17
|
u as GChip,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
d as GDrawer,
|
|
19
|
+
b as GDropdownGroup,
|
|
20
20
|
l as GExpandTransition,
|
|
21
21
|
v as GExpansion,
|
|
22
22
|
x as GExpansionGroup,
|
|
23
23
|
T as GFAB,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
k as
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
f as
|
|
31
|
-
|
|
24
|
+
c as GForm,
|
|
25
|
+
W as GGradient,
|
|
26
|
+
k as GGradientMaterial,
|
|
27
|
+
X as GIcon,
|
|
28
|
+
m as GInput,
|
|
29
|
+
K as GLoading,
|
|
30
|
+
f as GMenu,
|
|
31
|
+
M as GModal,
|
|
32
|
+
I as GNavGroup,
|
|
33
|
+
N as GNavItem,
|
|
32
34
|
g as GNavList,
|
|
33
35
|
A as GNavbar,
|
|
34
36
|
B as GNavbarItem,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
37
|
+
S as GNavbarMenu,
|
|
38
|
+
L as GNavbarSubItem,
|
|
39
|
+
O as GProgress,
|
|
40
|
+
h as GQuickActions,
|
|
41
|
+
w as GRadio,
|
|
42
|
+
C as GSelect,
|
|
43
|
+
Y as GSnackbar,
|
|
44
|
+
E as GSquircle,
|
|
45
|
+
y as GSwitch,
|
|
46
|
+
D as GTab,
|
|
47
|
+
F as GTabList,
|
|
48
|
+
P as GTabPanel,
|
|
49
|
+
_ as GTabPanels,
|
|
50
|
+
q as GTable,
|
|
51
|
+
R as GTabs,
|
|
52
|
+
j as GText,
|
|
53
|
+
z as GTextarea,
|
|
54
|
+
sa as GTooltip,
|
|
55
|
+
Q as GTransition,
|
|
56
|
+
H as GTransitionGroup,
|
|
57
|
+
ua as applyMask,
|
|
58
|
+
xa as defaultBreakpoints,
|
|
59
|
+
da as defaultMaskTokens,
|
|
60
|
+
ba as unmaskValue,
|
|
61
|
+
Ta as useBreakpoints,
|
|
62
|
+
Z as useLoading,
|
|
63
|
+
la as useMask,
|
|
64
|
+
$ as useSnackbar,
|
|
65
|
+
Ga as vGradientIcon,
|
|
66
|
+
ea as vGradientText,
|
|
67
|
+
ra as vLoading,
|
|
68
|
+
oa as vMask,
|
|
69
|
+
ta as vRipple,
|
|
70
|
+
na as vSpecular,
|
|
71
|
+
ia as vTooltip
|
|
69
72
|
};
|