@gradient-ui/core 0.8.0 → 2.0.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.
Files changed (996) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +60 -261
  3. package/dist/BaseOverlay-DgBWbJbs.cjs +1 -0
  4. package/dist/BaseOverlay-DzJ37TCS.js +216 -0
  5. package/dist/GAvatar-CN3PHGY_.js +202 -0
  6. package/dist/GAvatar-Dj6hSgL3.cjs +1 -0
  7. package/dist/GButton.vue_vue_type_style_index_0_lang-D9qRus1m.js +141 -0
  8. package/dist/GButton.vue_vue_type_style_index_0_lang-tGLnt3_R.cjs +1 -0
  9. package/dist/GCheckGroup-B3gZ9p6e.cjs +1 -0
  10. package/dist/GCheckGroup-DDkxtEj2.js +132 -0
  11. package/dist/GCheckIndicator-C-adGOcb.cjs +1 -0
  12. package/dist/GCheckIndicator-yvipPkWi.js +264 -0
  13. package/dist/GCheckbox.vue_vue_type_script_setup_true_lang-BrQE29bm.js +68 -0
  14. package/dist/GCheckbox.vue_vue_type_script_setup_true_lang-hjvutORC.cjs +1 -0
  15. package/dist/GCheckboxGroup.vue_vue_type_script_setup_true_lang-ChPcOQYQ.js +143 -0
  16. package/dist/GCheckboxGroup.vue_vue_type_script_setup_true_lang-CjPc-fNv.cjs +1 -0
  17. package/dist/GDropdown-CmBNk0jK.cjs +1 -0
  18. package/dist/GDropdown-TVH93Obq.js +126 -0
  19. package/dist/GExpandTransition.vue_vue_type_script_setup_true_lang-Ccl2Cemo.cjs +1 -0
  20. package/dist/GExpandTransition.vue_vue_type_script_setup_true_lang-ztMeJVQO.js +170 -0
  21. package/dist/GForm.vue_vue_type_style_index_0_lang-BzOWdjzk.cjs +1 -0
  22. package/dist/GForm.vue_vue_type_style_index_0_lang-DpPM5snQ.js +149 -0
  23. package/dist/GGradientMaterial.vue_vue_type_style_index_0_lang-ChRL7BIo.js +119 -0
  24. package/dist/GGradientMaterial.vue_vue_type_style_index_0_lang-DJcGdEVi.cjs +1 -0
  25. package/dist/GInput.vue_vue_type_script_setup_true_lang-BHM4W0S8.js +143 -0
  26. package/dist/GInput.vue_vue_type_script_setup_true_lang-dMjIUhb1.cjs +1 -0
  27. package/dist/GLoading.vue_vue_type_style_index_0_lang-BNOsRA0v.js +97 -0
  28. package/dist/GLoading.vue_vue_type_style_index_0_lang-KmMjjwpE.cjs +1 -0
  29. package/dist/GRadio.vue_vue_type_script_setup_true_lang-DNRTDtF2.cjs +1 -0
  30. package/dist/GRadio.vue_vue_type_script_setup_true_lang-kE-52Aj1.js +182 -0
  31. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BZXxiyLT.js +68 -0
  32. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-DC8vyW7e.cjs +1 -0
  33. package/dist/GTable.vue_vue_type_style_index_1_lang-BECleEMi.js +828 -0
  34. package/dist/GTable.vue_vue_type_style_index_1_lang-DgaYCTxJ.cjs +1 -0
  35. package/dist/GTextarea.vue_vue_type_script_setup_true_lang-CyuCJwv6.cjs +1 -0
  36. package/dist/GTextarea.vue_vue_type_script_setup_true_lang-zSTso23Z.js +84 -0
  37. package/dist/GTransition.vue_vue_type_script_setup_true_lang-CHGSgsZ0.js +143 -0
  38. package/dist/GTransition.vue_vue_type_script_setup_true_lang-CgELPmMA.cjs +1 -0
  39. package/dist/GTransitionGroup.vue_vue_type_script_setup_true_lang-CDu6W6-X.js +23 -0
  40. package/dist/GTransitionGroup.vue_vue_type_script_setup_true_lang-DDh0rXP7.cjs +1 -0
  41. package/dist/PLA-B2QljfgE.cjs +1 -0
  42. package/dist/PLA-DePtRzKl.js +10 -0
  43. package/dist/_plugin-vue_export-helper-B--vMWp3.js +9 -0
  44. package/dist/_plugin-vue_export-helper-D_jf5u0r.cjs +1 -0
  45. package/dist/actionSurface-BkFPXb-Z.js +123 -0
  46. package/dist/actionSurface-Db2TksPm.cjs +1 -0
  47. package/dist/appScopedState-BCzeQW7Y.js +15 -0
  48. package/dist/appScopedState-D0zgOLf5.cjs +1 -0
  49. package/dist/booleanControl-BrOrGYvg.js +71 -0
  50. package/dist/booleanControl-uPXEckMZ.cjs +1 -0
  51. package/dist/camelToKebabCase-BFm1Zwmu.cjs +1 -0
  52. package/dist/camelToKebabCase-nw6sbguT.js +6 -0
  53. package/dist/clientLifecycle-DlIZRy4I.cjs +1 -0
  54. package/dist/clientLifecycle-NZQzL_eH.js +12 -0
  55. package/dist/color-8SkPDCIp.cjs +1 -0
  56. package/dist/color-WJmhRKJ_.js +26 -0
  57. package/dist/colorResolver-BBj51UAZ.js +90 -0
  58. package/dist/colorResolver-C6PTz0S8.cjs +1 -0
  59. package/dist/component-names.cjs +1 -0
  60. package/dist/component-names.mjs +79 -0
  61. package/dist/components/BaseOverlay.cjs +1 -0
  62. package/dist/components/BaseOverlay.mjs +5 -0
  63. package/dist/components/GAlert.cjs +1 -0
  64. package/dist/components/GAlert.mjs +126 -0
  65. package/dist/components/GAside.cjs +1 -0
  66. package/dist/components/GAside.mjs +90 -0
  67. package/dist/components/GAsideGroup.cjs +1 -0
  68. package/dist/components/GAsideGroup.mjs +99 -0
  69. package/dist/components/GAsideItem.cjs +1 -0
  70. package/dist/components/GAsideItem.mjs +123 -0
  71. package/dist/components/GAvatar.cjs +1 -0
  72. package/dist/components/GAvatar.mjs +5 -0
  73. package/dist/components/GAvatarGroup.cjs +1 -0
  74. package/dist/components/GAvatarGroup.mjs +66 -0
  75. package/dist/components/GBadge.cjs +1 -0
  76. package/dist/components/GBadge.mjs +141 -0
  77. package/dist/components/GButton.cjs +1 -0
  78. package/dist/components/GButton.mjs +4 -0
  79. package/dist/components/GCard.cjs +1 -0
  80. package/dist/components/GCard.mjs +235 -0
  81. package/dist/components/GCheckbox.cjs +1 -0
  82. package/dist/components/GCheckbox.mjs +4 -0
  83. package/dist/components/GCheckboxGroup.cjs +1 -0
  84. package/dist/components/GCheckboxGroup.mjs +4 -0
  85. package/dist/components/GChip.cjs +1 -0
  86. package/dist/components/GChip.mjs +133 -0
  87. package/dist/components/GCombobox.cjs +1 -0
  88. package/dist/components/GCombobox.mjs +477 -0
  89. package/dist/components/GDivider.cjs +1 -0
  90. package/dist/components/GDivider.mjs +189 -0
  91. package/dist/components/GDrawer.cjs +1 -0
  92. package/dist/components/GDrawer.mjs +151 -0
  93. package/dist/components/GDropdownGroup.cjs +1 -0
  94. package/dist/components/GDropdownGroup.mjs +24 -0
  95. package/dist/components/GExpandTransition.cjs +1 -0
  96. package/dist/components/GExpandTransition.mjs +4 -0
  97. package/dist/components/GExpansion.cjs +1 -0
  98. package/dist/components/GExpansion.mjs +321 -0
  99. package/dist/components/GExpansionGroup.cjs +1 -0
  100. package/dist/components/GExpansionGroup.mjs +95 -0
  101. package/dist/components/GFAB.cjs +1 -0
  102. package/dist/components/GFAB.mjs +142 -0
  103. package/dist/components/GForm.cjs +1 -0
  104. package/dist/components/GForm.mjs +4 -0
  105. package/dist/components/GGradient.cjs +1 -0
  106. package/dist/components/GGradient.mjs +158 -0
  107. package/dist/components/GGradientMaterial.cjs +1 -0
  108. package/dist/components/GGradientMaterial.mjs +4 -0
  109. package/dist/components/GIcon.cjs +1 -0
  110. package/dist/components/GIcon.mjs +35 -0
  111. package/dist/components/GImg.cjs +1 -0
  112. package/dist/components/GImg.mjs +167 -0
  113. package/dist/components/GInput.cjs +1 -0
  114. package/dist/components/GInput.mjs +4 -0
  115. package/dist/components/GLoading.cjs +1 -0
  116. package/dist/components/GLoading.mjs +4 -0
  117. package/dist/components/GMenu.cjs +1 -0
  118. package/dist/components/GMenu.mjs +274 -0
  119. package/dist/components/GModal.cjs +1 -0
  120. package/dist/components/GModal.mjs +141 -0
  121. package/dist/components/GNavGroup.cjs +1 -0
  122. package/dist/components/GNavGroup.mjs +99 -0
  123. package/dist/components/GNavItem.cjs +1 -0
  124. package/dist/components/GNavItem.mjs +124 -0
  125. package/dist/components/GNavList.cjs +1 -0
  126. package/dist/components/GNavList.mjs +82 -0
  127. package/dist/components/GNavbar.cjs +1 -0
  128. package/dist/components/GNavbar.mjs +172 -0
  129. package/dist/components/GNavbarItem.cjs +1 -0
  130. package/dist/components/GNavbarItem.mjs +120 -0
  131. package/dist/components/GNavbarMenu.cjs +1 -0
  132. package/dist/components/GNavbarMenu.mjs +147 -0
  133. package/dist/components/GNavbarSubItem.cjs +1 -0
  134. package/dist/components/GNavbarSubItem.mjs +96 -0
  135. package/dist/components/GProgress.cjs +1 -0
  136. package/dist/components/GProgress.mjs +135 -0
  137. package/dist/components/GQuickActions.cjs +1 -0
  138. package/dist/components/GQuickActions.mjs +157 -0
  139. package/dist/components/GRadio.cjs +1 -0
  140. package/dist/components/GRadio.mjs +4 -0
  141. package/dist/components/GSelect.cjs +1 -0
  142. package/dist/components/GSelect.mjs +145 -0
  143. package/dist/components/GSnackbar.cjs +1 -0
  144. package/dist/components/GSnackbar.mjs +285 -0
  145. package/dist/components/GSquircle.cjs +1 -0
  146. package/dist/components/GSquircle.mjs +180 -0
  147. package/dist/components/GStepPanel.cjs +1 -0
  148. package/dist/components/GStepPanel.mjs +156 -0
  149. package/dist/components/GStepper.cjs +1 -0
  150. package/dist/components/GStepper.mjs +335 -0
  151. package/dist/components/GStepperActions.cjs +1 -0
  152. package/dist/components/GStepperActions.mjs +61 -0
  153. package/dist/components/GSwitch.cjs +1 -0
  154. package/dist/components/GSwitch.mjs +4 -0
  155. package/dist/components/GTab.cjs +1 -0
  156. package/dist/components/GTab.mjs +105 -0
  157. package/dist/components/GTabList.cjs +1 -0
  158. package/dist/components/GTabList.mjs +28 -0
  159. package/dist/components/GTabPanel.cjs +1 -0
  160. package/dist/components/GTabPanel.mjs +35 -0
  161. package/dist/components/GTabPanels.cjs +1 -0
  162. package/dist/components/GTabPanels.mjs +24 -0
  163. package/dist/components/GTable.cjs +1 -0
  164. package/dist/components/GTable.mjs +4 -0
  165. package/dist/components/GTabs.cjs +1 -0
  166. package/dist/components/GTabs.mjs +73 -0
  167. package/dist/components/GText.cjs +1 -0
  168. package/dist/components/GText.mjs +59 -0
  169. package/dist/components/GTextarea.cjs +1 -0
  170. package/dist/components/GTextarea.mjs +4 -0
  171. package/dist/components/GTooltip.cjs +1 -0
  172. package/dist/components/GTooltip.mjs +65 -0
  173. package/dist/components/GTransition.cjs +1 -0
  174. package/dist/components/GTransition.mjs +4 -0
  175. package/dist/components/GTransitionGroup.cjs +1 -0
  176. package/dist/components/GTransitionGroup.mjs +4 -0
  177. package/dist/components.cjs +1 -1
  178. package/dist/components.mjs +135 -78
  179. package/dist/context-D_uVf3Ih.cjs +1 -0
  180. package/dist/context-DmyyyTi-.js +164 -0
  181. package/dist/context-FLWxn0X1.js +8 -0
  182. package/dist/context-obVnJalQ.cjs +1 -0
  183. package/dist/control-B3T1H83D.js +53 -0
  184. package/dist/control-C5Ws5lp3.cjs +1 -0
  185. package/dist/controller-DTFaTta0.cjs +1 -0
  186. package/dist/controller-Dk9Wd1Sr.js +101 -0
  187. package/dist/createComponentId-CK5eUecc.cjs +1 -0
  188. package/dist/createComponentId-CrqdDHC3.js +5 -0
  189. package/dist/createId-t3ke7cZx.js +5 -0
  190. package/dist/createId-tM8qn_N_.cjs +1 -0
  191. package/dist/cssTokens-CR4OxIND.js +75 -0
  192. package/dist/cssTokens-gELrmYNj.cjs +5 -0
  193. package/dist/defaults-DJ6ZV1Qc.js +51 -0
  194. package/dist/defaults-aVtmQF-9.cjs +1 -0
  195. package/dist/density-C3E1eUQ3.cjs +1 -0
  196. package/dist/density-Ci15Ek7T.js +15 -0
  197. package/dist/di-BXJSJc_E.js +12 -0
  198. package/dist/di-Czemfti1.cjs +1 -0
  199. package/dist/directives.cjs +1 -1
  200. package/dist/directives.mjs +8 -8
  201. package/dist/disabled-B_bAKgaM.cjs +1 -0
  202. package/dist/disabled-CAV056h6.js +12 -0
  203. package/dist/environment-Dr5kpq3D.cjs +1 -0
  204. package/dist/environment-o0e-UUbv.js +13 -0
  205. package/dist/fieldControl-BgVt1Hh1.js +144 -0
  206. package/dist/fieldControl-CIJMnu2j.cjs +1 -0
  207. package/dist/floatingTrigger-B_K4a4Fz.cjs +1 -0
  208. package/dist/floatingTrigger-CyvZ-aQ6.js +275 -0
  209. package/dist/glass-CJjbKWWO.js +20 -0
  210. package/dist/glass-CZEblMo2.cjs +1 -0
  211. package/dist/gradient-Bf_C3oqp.cjs +1 -0
  212. package/dist/gradient-Cesrzb2-.js +138 -0
  213. package/dist/gradientMaterial-BEhJP5b1.js +141 -0
  214. package/dist/gradientMaterial-DrttA9E_.cjs +1 -0
  215. package/dist/groupContext-C2lbjfsf.cjs +1 -0
  216. package/dist/groupContext-CBceOY6B.js +14 -0
  217. package/dist/groupContext-DU6dxh4q.cjs +1 -0
  218. package/dist/groupContext-vS5bHonI.js +14 -0
  219. package/dist/head-BMx6G1g4.js +45 -0
  220. package/dist/head-u-LV2RM9.cjs +2 -0
  221. package/dist/icon-C1AhpC8p.js +66 -0
  222. package/dist/icon-DgrRDU9A.cjs +1 -0
  223. package/dist/id-Cjq3OT0R.js +5 -0
  224. package/dist/id-EYQallpf.cjs +1 -0
  225. package/dist/index-71vxBpir.js +53 -0
  226. package/dist/index-8uDgLBTF.cjs +1 -0
  227. package/dist/index-BDHATTpo.js +141 -0
  228. package/dist/index-DQ6stZ3U.js +97 -0
  229. package/dist/index-Dd_8Hfjk.cjs +1 -0
  230. package/dist/index-YvJ0cd3f.cjs +1 -0
  231. package/dist/index.cjs +1 -1
  232. package/dist/index.mjs +315 -224
  233. package/dist/item-BiO-0FYg.cjs +1 -0
  234. package/dist/item-Cm_rJTEH.js +47 -0
  235. package/dist/layerStack-Bn2nFt2F.cjs +1 -0
  236. package/dist/layerStack-C926It64.js +86 -0
  237. package/dist/mask-BGVqqZXk.cjs +1 -0
  238. package/dist/mask-D4VYR8fo.js +541 -0
  239. package/dist/material-CkThdnz0.cjs +1 -0
  240. package/dist/material-Cn0l9r_y.js +182 -0
  241. package/dist/materialSurface-BZWqxSOo.cjs +1 -0
  242. package/dist/materialSurface-DKWanYUC.js +57 -0
  243. package/dist/menuContext-COshJAv-.js +14 -0
  244. package/dist/menuContext-DqTLm_y8.cjs +1 -0
  245. package/dist/mount-CqN_WfIk.js +58 -0
  246. package/dist/mount-qFaEMFZj.cjs +1 -0
  247. package/dist/palette-CH8mtBoc.js +3779 -0
  248. package/dist/palette-WOebHg01.cjs +316 -0
  249. package/dist/plugin.cjs +1 -0
  250. package/dist/plugin.mjs +24 -0
  251. package/dist/propsFactory-DT6-QS4L.cjs +1 -0
  252. package/dist/propsFactory-FM5RGbLN.js +13 -0
  253. package/dist/px-B-cyF02Z.js +8 -0
  254. package/dist/px-CVkec5Jf.cjs +1 -0
  255. package/dist/rounded-BneJO7vz.cjs +1 -0
  256. package/dist/rounded-CKhFFdmx.js +12 -0
  257. package/dist/routerLink-BhTEISct.cjs +1 -0
  258. package/dist/routerLink-p0fsQRNq.js +11 -0
  259. package/dist/runtime-DBDKFxqD.js +22 -0
  260. package/dist/runtime-DjqHzhfc.cjs +1 -0
  261. package/dist/scheme-C0jQNw-v.cjs +299 -0
  262. package/dist/scheme-Dp9cSd1s.js +1406 -0
  263. package/dist/selected-CEdYQtXH.cjs +1 -0
  264. package/dist/selected-DPdzuMh_.js +20 -0
  265. package/dist/selectionController-Cq7OffKP.js +98 -0
  266. package/dist/selectionController-D_SzzLi7.cjs +1 -0
  267. package/dist/selectionModel-B_tgk_Aa.cjs +1 -0
  268. package/dist/selectionModel-DMATNQOo.js +76 -0
  269. package/dist/services.cjs +1 -1
  270. package/dist/services.mjs +10 -3
  271. package/dist/size-BSjg5E6f.cjs +1 -0
  272. package/dist/size-C-WH-uPa.js +16 -0
  273. package/dist/ssr.cjs +1 -0
  274. package/dist/ssr.mjs +31 -0
  275. package/dist/state-CUskk7oG.cjs +1 -0
  276. package/dist/state-zMDQLwyB.js +12 -0
  277. package/dist/stateIcon-B8wmjxgd.js +98 -0
  278. package/dist/stateIcon-BxT3Loel.cjs +1 -0
  279. package/dist/style.css +1 -1
  280. package/dist/surface-NFdB950M.cjs +1 -0
  281. package/dist/surface-i-1vm2j3.js +99 -0
  282. package/dist/surfaceColor-BlDoAKoV.cjs +1 -0
  283. package/dist/surfaceColor-Cic675ry.js +34 -0
  284. package/dist/surfaceMaterial-B1a1iV02.js +39 -0
  285. package/dist/surfaceMaterial-JpbVongH.cjs +1 -0
  286. package/dist/tagName-D8HI-Yqc.js +40 -0
  287. package/dist/tagName-EmIHK0fg.cjs +1 -0
  288. package/dist/teleport-6ZRoZ2JT.js +26 -0
  289. package/dist/teleport-Bj9Z7LhE.cjs +1 -0
  290. package/dist/textFieldComponent-Ct4Z0dFr.cjs +1 -0
  291. package/dist/textFieldComponent-gnbYgrX0.js +217 -0
  292. package/dist/textFieldControl-Cxnq3lo4.js +80 -0
  293. package/dist/textFieldControl-D0-pdxIY.cjs +1 -0
  294. package/dist/theme.cjs +1 -1
  295. package/dist/theme.mjs +60 -59
  296. package/dist/tokenInputKeyboard-DBcgGd7c.js +108 -0
  297. package/dist/tokenInputKeyboard-DqEV34Li.cjs +1 -0
  298. package/dist/transition-BPMUkgHY.cjs +1 -0
  299. package/dist/transition-DVGMCo2o.js +108 -0
  300. package/dist/types/componentNames.d.ts +5 -0
  301. package/dist/types/components/GGroup/GGroup.vue.d.ts +11 -9
  302. package/dist/types/components/GGroup/index.d.ts +1 -1
  303. package/dist/types/components/index.d.ts +55 -53
  304. package/dist/types/components/transitions/GExpandTransition.vue.d.ts +26 -32
  305. package/dist/types/components/transitions/GTransition.vue.d.ts +26 -32
  306. package/dist/types/components/transitions/GTransitionGroup.vue.d.ts +26 -32
  307. package/dist/types/components/transitions/TransitionExpansion.vue.d.ts +2 -8
  308. package/dist/types/components/transitions/TransitionOverlay.vue.d.ts +2 -8
  309. package/dist/types/components/transitions/TransitionRotate.vue.d.ts +2 -8
  310. package/dist/types/components/transitions/TransitionScale.vue.d.ts +2 -8
  311. package/dist/types/components/transitions/TransitionStaggerTranslate.vue.d.ts +2 -8
  312. package/dist/types/components/transitions/index.d.ts +3 -3
  313. package/dist/types/components/ui/BaseFloating/BaseFloating.vue.d.ts +45 -53
  314. package/dist/types/components/ui/BaseFloating/index.d.ts +1 -1
  315. package/dist/types/components/ui/BaseOverlay/BaseOverlay.vue.d.ts +62 -71
  316. package/dist/types/components/ui/BaseOverlay/index.d.ts +1 -1
  317. package/dist/types/components/ui/BaseOverlay/types.d.ts +24 -24
  318. package/dist/types/components/ui/GAction/GAction.vue.d.ts +1 -1
  319. package/dist/types/components/ui/GAction/index.d.ts +1 -1
  320. package/dist/types/components/ui/GAction/types.d.ts +15 -15
  321. package/dist/types/components/ui/GAlert/GAlert.vue.d.ts +177 -183
  322. package/dist/types/components/ui/GAlert/index.d.ts +1 -1
  323. package/dist/types/components/ui/GAlert/types.d.ts +151 -151
  324. package/dist/types/components/ui/GAside/GAside.vue.d.ts +26 -24
  325. package/dist/types/components/ui/GAside/GAsideGroup.vue.d.ts +11 -9
  326. package/dist/types/components/ui/GAside/GAsideItem.vue.d.ts +16 -14
  327. package/dist/types/components/ui/GAside/context.d.ts +2 -2
  328. package/dist/types/components/ui/GAside/groupContext.d.ts +1 -1
  329. package/dist/types/components/ui/GAside/index.d.ts +4 -4
  330. package/dist/types/components/ui/GAside/types.d.ts +28 -28
  331. package/dist/types/components/ui/GAvatar/GAvatar.vue.d.ts +262 -268
  332. package/dist/types/components/ui/GAvatar/GAvatarGroup.vue.d.ts +43 -49
  333. package/dist/types/components/ui/GAvatar/index.d.ts +3 -3
  334. package/dist/types/components/ui/GAvatar/types.d.ts +163 -163
  335. package/dist/types/components/ui/GBadge/GBadge.vue.d.ts +367 -373
  336. package/dist/types/components/ui/GBadge/index.d.ts +2 -2
  337. package/dist/types/components/ui/GBadge/types.d.ts +153 -153
  338. package/dist/types/components/ui/GButton/GButton.vue.d.ts +252 -258
  339. package/dist/types/components/ui/GButton/index.d.ts +2 -2
  340. package/dist/types/components/ui/GButton/types.d.ts +149 -149
  341. package/dist/types/components/ui/GCard/GCard.vue.d.ts +215 -221
  342. package/dist/types/components/ui/GCard/index.d.ts +2 -2
  343. package/dist/types/components/ui/GCard/types.d.ts +160 -160
  344. package/dist/types/components/ui/GCheckControl/GCheckControl.vue.d.ts +86 -92
  345. package/dist/types/components/ui/GCheckControl/GCheckGroup.vue.d.ts +77 -83
  346. package/dist/types/components/ui/GCheckControl/GCheckIndicator.vue.d.ts +17 -10
  347. package/dist/types/components/ui/GCheckControl/index.d.ts +3 -3
  348. package/dist/types/components/ui/GCheckbox/GCheckbox.vue.d.ts +10 -211
  349. package/dist/types/components/ui/GCheckbox/index.d.ts +2 -2
  350. package/dist/types/components/ui/GCheckbox/types.d.ts +1 -1
  351. package/dist/types/components/ui/GCheckboxGroup/GCheckboxGroup.vue.d.ts +12 -10
  352. package/dist/types/components/ui/GCheckboxGroup/index.d.ts +2 -2
  353. package/dist/types/components/ui/GCheckboxGroup/types.d.ts +2 -2
  354. package/dist/types/components/ui/GChip/GChip.vue.d.ts +218 -224
  355. package/dist/types/components/ui/GChip/index.d.ts +2 -2
  356. package/dist/types/components/ui/GChip/types.d.ts +140 -140
  357. package/dist/types/components/ui/GCombobox/GCombobox.vue.d.ts +12 -10
  358. package/dist/types/components/ui/GCombobox/index.d.ts +2 -2
  359. package/dist/types/components/ui/GCombobox/types.d.ts +11 -11
  360. package/dist/types/components/ui/GDivider/GDivider.vue.d.ts +445 -451
  361. package/dist/types/components/ui/GDivider/index.d.ts +2 -2
  362. package/dist/types/components/ui/GDivider/types.d.ts +186 -186
  363. package/dist/types/components/ui/GDrawer/GDrawer.vue.d.ts +135 -141
  364. package/dist/types/components/ui/GDrawer/index.d.ts +2 -2
  365. package/dist/types/components/ui/GDrawer/types.d.ts +44 -44
  366. package/dist/types/components/ui/GDropdown/GDropdown.vue.d.ts +94 -102
  367. package/dist/types/components/ui/GDropdown/index.d.ts +1 -1
  368. package/dist/types/components/ui/GDropdown/types.d.ts +40 -40
  369. package/dist/types/components/ui/GDropdownGroup/GDropdownGroup.vue.d.ts +3 -9
  370. package/dist/types/components/ui/GDropdownGroup/index.d.ts +2 -2
  371. package/dist/types/components/ui/GDropdownSelect/GDropdownSelect.vue.d.ts +11 -9
  372. package/dist/types/components/ui/GDropdownSelect/types.d.ts +2 -2
  373. package/dist/types/components/ui/GExpansion/GExpansion.vue.d.ts +51 -49
  374. package/dist/types/components/ui/GExpansion/index.d.ts +1 -1
  375. package/dist/types/components/ui/GExpansion/types.d.ts +154 -154
  376. package/dist/types/components/ui/GExpansionGroup/GExpansionGroup.vue.d.ts +17 -15
  377. package/dist/types/components/ui/GExpansionGroup/index.d.ts +1 -1
  378. package/dist/types/components/ui/GExpansionGroup/types.d.ts +7 -7
  379. package/dist/types/components/ui/GFAB/GFAB.vue.d.ts +81 -87
  380. package/dist/types/components/ui/GFAB/index.d.ts +1 -1
  381. package/dist/types/components/ui/GFAB/types.d.ts +57 -57
  382. package/dist/types/components/ui/GFieldBase/GFieldBase.vue.d.ts +64 -70
  383. package/dist/types/components/ui/GFieldBase/props.d.ts +81 -81
  384. package/dist/types/components/ui/GForm/GForm.vue.d.ts +32 -40
  385. package/dist/types/components/ui/GForm/index.d.ts +2 -2
  386. package/dist/types/components/ui/GForm/types.d.ts +10 -10
  387. package/dist/types/components/ui/GGradient/GGradient.vue.d.ts +96 -102
  388. package/dist/types/components/ui/GGradient/GGradientBorderLayer.vue.d.ts +10 -4
  389. package/dist/types/components/ui/GGradient/index.d.ts +2 -2
  390. package/dist/types/components/ui/GGradient/types.d.ts +4 -4
  391. package/dist/types/components/ui/GGradientMaterial/GGradientMaterial.vue.d.ts +84 -90
  392. package/dist/types/components/ui/GGradientMaterial/index.d.ts +2 -2
  393. package/dist/types/components/ui/GGradientMaterial/types.d.ts +15 -15
  394. package/dist/types/components/ui/GIcon/GIcon.vue.d.ts +5 -5
  395. package/dist/types/components/ui/GIcon/index.d.ts +2 -2
  396. package/dist/types/components/ui/GIcon/sets/MdiIconSet.vue.d.ts +1 -1
  397. package/dist/types/components/ui/GIcon/types.d.ts +1 -1
  398. package/dist/types/components/ui/GIcon.vue.d.ts +2 -2
  399. package/dist/types/components/ui/GImg/GImg.vue.d.ts +266 -0
  400. package/dist/types/components/ui/GImg/index.d.ts +2 -0
  401. package/dist/types/components/ui/GImg/types.d.ts +174 -0
  402. package/dist/types/components/ui/GInput/GInput.vue.d.ts +14 -323
  403. package/dist/types/components/ui/GInput/SwitchPassword.vue.d.ts +2 -2
  404. package/dist/types/components/ui/GInput/index.d.ts +2 -2
  405. package/dist/types/components/ui/GInput/types.d.ts +2 -2
  406. package/dist/types/components/ui/GLoading/GLoading.vue.d.ts +30 -36
  407. package/dist/types/components/ui/GLoading/types.d.ts +9 -9
  408. package/dist/types/components/ui/GMenu/GMenu.vue.d.ts +18 -24
  409. package/dist/types/components/ui/GMenu/GSubmenu.vue.d.ts +16 -259
  410. package/dist/types/components/ui/GMenu/index.d.ts +1 -1
  411. package/dist/types/components/ui/GMenuItem/GMenuItem.vue.d.ts +89 -95
  412. package/dist/types/components/ui/GMenuItem/types.d.ts +32 -32
  413. package/dist/types/components/ui/GModal/GModal.vue.d.ts +139 -145
  414. package/dist/types/components/ui/GModal/index.d.ts +2 -2
  415. package/dist/types/components/ui/GModal/types.d.ts +48 -48
  416. package/dist/types/components/ui/GNavList/GNavGroup.vue.d.ts +11 -9
  417. package/dist/types/components/ui/GNavList/GNavItem.vue.d.ts +16 -14
  418. package/dist/types/components/ui/GNavList/GNavList.vue.d.ts +24 -22
  419. package/dist/types/components/ui/GNavList/context.d.ts +2 -2
  420. package/dist/types/components/ui/GNavList/groupContext.d.ts +1 -1
  421. package/dist/types/components/ui/GNavList/index.d.ts +4 -4
  422. package/dist/types/components/ui/GNavList/types.d.ts +27 -27
  423. package/dist/types/components/ui/GNavbar/GNavbar.vue.d.ts +16 -14
  424. package/dist/types/components/ui/GNavbar/GNavbarItem.vue.d.ts +20 -18
  425. package/dist/types/components/ui/GNavbar/GNavbarMenu.vue.d.ts +20 -18
  426. package/dist/types/components/ui/GNavbar/GNavbarSubItem.vue.d.ts +14 -12
  427. package/dist/types/components/ui/GNavbar/context.d.ts +2 -2
  428. package/dist/types/components/ui/GNavbar/index.d.ts +5 -5
  429. package/dist/types/components/ui/GNavbar/menuContext.d.ts +1 -1
  430. package/dist/types/components/ui/GNavbar/types.d.ts +30 -30
  431. package/dist/types/components/ui/GProgress/GProgress.vue.d.ts +83 -91
  432. package/dist/types/components/ui/GProgress/index.d.ts +1 -1
  433. package/dist/types/components/ui/GProgress/types.d.ts +16 -16
  434. package/dist/types/components/ui/GQuickActions/GQuickActions.vue.d.ts +26 -32
  435. package/dist/types/components/ui/GQuickActions/index.d.ts +2 -2
  436. package/dist/types/components/ui/GQuickActions/types.d.ts +3 -3
  437. package/dist/types/components/ui/GRadio/GRadio.vue.d.ts +12 -10
  438. package/dist/types/components/ui/GRadio/GRadioItem.vue.d.ts +13 -11
  439. package/dist/types/components/ui/GRadio/index.d.ts +3 -3
  440. package/dist/types/components/ui/GRadio/types.d.ts +2 -2
  441. package/dist/types/components/ui/GSelect/GSelect.vue.d.ts +12 -10
  442. package/dist/types/components/ui/GSelect/index.d.ts +2 -2
  443. package/dist/types/components/ui/GSelect/types.d.ts +10 -10
  444. package/dist/types/components/ui/GSelectItem.vue.d.ts +5 -11
  445. package/dist/types/components/ui/GSnackbar/GSnackbar.vue.d.ts +411 -417
  446. package/dist/types/components/ui/GSnackbar/index.d.ts +2 -2
  447. package/dist/types/components/ui/GSnackbar/types.d.ts +164 -164
  448. package/dist/types/components/ui/GSquircle/GSquircle.vue.d.ts +8 -14
  449. package/dist/types/components/ui/GSquircle/index.d.ts +1 -1
  450. package/dist/types/components/ui/GSquircle/types.d.ts +5 -5
  451. package/dist/types/components/ui/GStepper/GStepItem.vue.d.ts +8 -6
  452. package/dist/types/components/ui/GStepper/GStepPanel.vue.d.ts +35 -33
  453. package/dist/types/components/ui/GStepper/GStepper.vue.d.ts +32 -30
  454. package/dist/types/components/ui/GStepper/GStepperActions.vue.d.ts +9 -7
  455. package/dist/types/components/ui/GStepper/context.d.ts +4 -4
  456. package/dist/types/components/ui/GStepper/index.d.ts +4 -4
  457. package/dist/types/components/ui/GStepper/types.d.ts +182 -182
  458. package/dist/types/components/ui/GSwitch/GSwitch.vue.d.ts +10 -211
  459. package/dist/types/components/ui/GSwitch/index.d.ts +2 -2
  460. package/dist/types/components/ui/GSwitch/types.d.ts +1 -1
  461. package/dist/types/components/ui/GTable/GTable.vue.d.ts +61 -59
  462. package/dist/types/components/ui/GTable/GTableBody.vue.d.ts +8 -6
  463. package/dist/types/components/ui/GTable/GTableCell.vue.d.ts +9 -7
  464. package/dist/types/components/ui/GTable/GTableExpandedRow.vue.d.ts +10 -8
  465. package/dist/types/components/ui/GTable/GTableHead.vue.d.ts +9 -7
  466. package/dist/types/components/ui/GTable/GTableRow.vue.d.ts +8 -6
  467. package/dist/types/components/ui/GTable/context.d.ts +1 -1
  468. package/dist/types/components/ui/GTable/index.d.ts +3 -3
  469. package/dist/types/components/ui/GTable/types.d.ts +161 -161
  470. package/dist/types/components/ui/GTable/useTable.d.ts +3 -3
  471. package/dist/types/components/ui/GTable/useTableExpansion.d.ts +1 -1
  472. package/dist/types/components/ui/GTable/useTableSpans.d.ts +1 -1
  473. package/dist/types/components/ui/GTabs/GTab.vue.d.ts +14 -12
  474. package/dist/types/components/ui/GTabs/GTabList.vue.d.ts +3 -9
  475. package/dist/types/components/ui/GTabs/GTabPanel.vue.d.ts +9 -7
  476. package/dist/types/components/ui/GTabs/GTabPanels.vue.d.ts +6 -12
  477. package/dist/types/components/ui/GTabs/GTabs.vue.d.ts +24 -22
  478. package/dist/types/components/ui/GTabs/context.d.ts +3 -3
  479. package/dist/types/components/ui/GTabs/index.d.ts +6 -6
  480. package/dist/types/components/ui/GTabs/types.d.ts +24 -24
  481. package/dist/types/components/ui/GText/GText.vue.d.ts +5 -10
  482. package/dist/types/components/ui/GText/index.d.ts +1 -1
  483. package/dist/types/components/ui/GText/types.d.ts +1 -1
  484. package/dist/types/components/ui/GTextarea/GTextarea.vue.d.ts +14 -290
  485. package/dist/types/components/ui/GTextarea/index.d.ts +2 -2
  486. package/dist/types/components/ui/GTextarea/types.d.ts +2 -2
  487. package/dist/types/components/ui/GToggleButton/GToggleButton.vue.d.ts +10 -760
  488. package/dist/types/components/ui/GToggleButton/index.d.ts +2 -2
  489. package/dist/types/components/ui/GToggleButton/types.d.ts +127 -127
  490. package/dist/types/components/ui/GTooltip/GTooltip.vue.d.ts +79 -85
  491. package/dist/types/components/ui/GTooltip/index.d.ts +1 -1
  492. package/dist/types/components/ui/GTooltip/types.d.ts +37 -37
  493. package/dist/types/directives/gradientIcon.d.ts +1 -1
  494. package/dist/types/directives/gradientText.d.ts +2 -2
  495. package/dist/types/directives/index.d.ts +13 -13
  496. package/dist/types/directives/loading.d.ts +5 -5
  497. package/dist/types/directives/mask.d.ts +1 -1
  498. package/dist/types/directives/ripple.d.ts +1 -1
  499. package/dist/types/directives/specular.d.ts +1 -1
  500. package/dist/types/index.d.ts +13 -17
  501. package/dist/types/plugin.d.ts +15 -0
  502. package/dist/types/services/context.d.ts +8 -0
  503. package/dist/types/services/index.d.ts +4 -2
  504. package/dist/types/services/runtime.d.ts +5 -0
  505. package/dist/types/services/useLoading.d.ts +5 -2
  506. package/dist/types/services/useSnackbar.d.ts +5 -2
  507. package/dist/types/ssr/index.d.ts +2 -0
  508. package/dist/types/ssr/use/appScopedState.d.ts +1 -0
  509. package/dist/types/ssr/use/clientLifecycle.d.ts +2 -0
  510. package/dist/types/ssr/use/hydration.d.ts +2 -0
  511. package/dist/types/ssr/use/id.d.ts +1 -0
  512. package/dist/types/ssr/use/index.d.ts +6 -0
  513. package/dist/types/ssr/use/teleport.d.ts +11 -0
  514. package/dist/types/ssr/use/viewport.d.ts +12 -0
  515. package/dist/types/ssr/utils/environment.d.ts +11 -0
  516. package/dist/types/ssr/utils/head.d.ts +28 -0
  517. package/dist/types/ssr/utils/index.d.ts +3 -0
  518. package/dist/types/ssr/utils/mount.d.ts +21 -0
  519. package/dist/types/theme/color.d.ts +1 -1
  520. package/dist/types/theme/colorSystem.d.ts +3 -3
  521. package/dist/types/theme/cssTokens.d.ts +3 -2
  522. package/dist/types/theme/default.d.ts +13 -6
  523. package/dist/types/theme/index.d.ts +7 -6
  524. package/dist/types/theme/palette.d.ts +1 -1
  525. package/dist/types/theme/scheme.d.ts +1 -1
  526. package/dist/types/theme/types.d.ts +1 -1
  527. package/dist/types/types/CommonTypes.d.ts +2 -2
  528. package/dist/types/use/PLA.d.ts +1 -1
  529. package/dist/types/use/actionProps.d.ts +15 -15
  530. package/dist/types/use/actionSurface.d.ts +45 -45
  531. package/dist/types/use/appendTarget.d.ts +2 -1
  532. package/dist/types/use/breakpoints/index.d.ts +10 -1
  533. package/dist/types/use/check/booleanControl.d.ts +13 -13
  534. package/dist/types/use/check/index.d.ts +6 -6
  535. package/dist/types/use/check/optionGroup.d.ts +7 -7
  536. package/dist/types/use/check/types.d.ts +55 -55
  537. package/dist/types/use/color.d.ts +2 -2
  538. package/dist/types/use/colorResolver.d.ts +2 -2
  539. package/dist/types/use/density.d.ts +1 -1
  540. package/dist/types/use/expansion/controller.d.ts +1 -1
  541. package/dist/types/use/expansion/di.d.ts +1 -1
  542. package/dist/types/use/expansion/index.d.ts +3 -3
  543. package/dist/types/use/floating.d.ts +18 -18
  544. package/dist/types/use/floatingLayer.d.ts +1 -1
  545. package/dist/types/use/form/control.d.ts +1 -1
  546. package/dist/types/use/form/props.d.ts +25 -25
  547. package/dist/types/use/form/textFieldComponent.d.ts +1 -3
  548. package/dist/types/use/form/textFieldControl.d.ts +7 -7
  549. package/dist/types/use/glass.d.ts +2 -2
  550. package/dist/types/use/gradient.d.ts +81 -81
  551. package/dist/types/use/gradientGlow.d.ts +7 -7
  552. package/dist/types/use/gradientMaterial.d.ts +3 -3
  553. package/dist/types/use/gradientRuntime.d.ts +2 -2
  554. package/dist/types/use/gradientRuntimeRegistry.d.ts +1 -1
  555. package/dist/types/use/gradientSurface.d.ts +5 -5
  556. package/dist/types/use/group/di.d.ts +1 -1
  557. package/dist/types/use/group/groupController.d.ts +1 -1
  558. package/dist/types/use/index.d.ts +23 -22
  559. package/dist/types/use/input/index.d.ts +4 -4
  560. package/dist/types/use/input/props.d.ts +71 -71
  561. package/dist/types/use/layerStack.d.ts +3 -3
  562. package/dist/types/use/material.d.ts +9 -9
  563. package/dist/types/use/materialSurface.d.ts +103 -103
  564. package/dist/types/use/menu.d.ts +5 -5
  565. package/dist/types/use/menuContext.d.ts +1 -1
  566. package/dist/types/use/navigation/controller.d.ts +1 -1
  567. package/dist/types/use/navigation/index.d.ts +4 -4
  568. package/dist/types/use/navigation/item.d.ts +1 -1
  569. package/dist/types/use/navigation/keyboard.d.ts +1 -1
  570. package/dist/types/use/open.d.ts +1 -1
  571. package/dist/types/use/overlay.d.ts +18 -18
  572. package/dist/types/use/placement.d.ts +2 -2
  573. package/dist/types/use/px.d.ts +1 -1
  574. package/dist/types/use/select/comboboxController.d.ts +9 -9
  575. package/dist/types/use/select/commit.d.ts +2 -2
  576. package/dist/types/use/select/controller.d.ts +9 -9
  577. package/dist/types/use/select/creatable.d.ts +1 -1
  578. package/dist/types/use/select/fieldControl.d.ts +7 -7
  579. package/dist/types/use/select/filter.d.ts +1 -1
  580. package/dist/types/use/select/items.d.ts +1 -1
  581. package/dist/types/use/select/listboxKeyboard.d.ts +1 -1
  582. package/dist/types/use/select/menuItems.d.ts +2 -2
  583. package/dist/types/use/select/menuSlot.d.ts +2 -2
  584. package/dist/types/use/select/modelFallbackItems.d.ts +2 -2
  585. package/dist/types/use/select/selection.d.ts +1 -1
  586. package/dist/types/use/select/selectionController.d.ts +1 -1
  587. package/dist/types/use/select/selectionSummary.d.ts +1 -1
  588. package/dist/types/use/select/tokenInputKeyboard.d.ts +1 -1
  589. package/dist/types/use/selected.d.ts +1 -1
  590. package/dist/types/use/size.d.ts +2 -2
  591. package/dist/types/use/state.d.ts +1 -1
  592. package/dist/types/use/stateIcon.d.ts +1 -1
  593. package/dist/types/use/stepper/controller.d.ts +1 -1
  594. package/dist/types/use/stepper/index.d.ts +1 -1
  595. package/dist/types/use/surface.d.ts +26 -26
  596. package/dist/types/use/surfaceColor.d.ts +3 -3
  597. package/dist/types/use/surfaceMaterial.d.ts +8 -8
  598. package/dist/types/use/textarea/index.d.ts +2 -2
  599. package/dist/types/use/textarea/props.d.ts +69 -69
  600. package/dist/types/use/transition.d.ts +5 -5
  601. package/dist/types/use/variant.d.ts +1 -1
  602. package/dist/types/utils/createComponentId.d.ts +1 -1
  603. package/dist/types/utils/createId.d.ts +1 -1
  604. package/dist/types-BItiZqNo.cjs +1 -0
  605. package/dist/types-BPZPPi6n.cjs +1 -0
  606. package/dist/types-BZSR5qEq.js +69 -0
  607. package/dist/types-CAh-uxuw.js +113 -0
  608. package/dist/types-Ce2Qoz6Q.js +90 -0
  609. package/dist/types-DGs8vjIX.cjs +1 -0
  610. package/dist/types-D_HgEWtj.js +95 -0
  611. package/dist/types-DmWFHzOk.js +80 -0
  612. package/dist/types-DsVDdHxP.cjs +1 -0
  613. package/dist/types-cjs/componentNames.d.cts +5 -0
  614. package/dist/types-cjs/components/GGroup/GGroup.vue.d.cts +24 -0
  615. package/dist/types-cjs/components/GGroup/index.d.cts +1 -0
  616. package/dist/types-cjs/components/GGroup/types.d.cts +0 -0
  617. package/dist/types-cjs/components/index.d.cts +55 -0
  618. package/dist/types-cjs/components/transitions/GExpandTransition.vue.d.cts +234 -0
  619. package/dist/types-cjs/components/transitions/GTransition.vue.d.cts +234 -0
  620. package/dist/types-cjs/components/transitions/GTransitionGroup.vue.d.cts +218 -0
  621. package/dist/types-cjs/components/transitions/TransitionExpansion.vue.d.cts +18 -0
  622. package/dist/types-cjs/components/transitions/TransitionOverlay.vue.d.cts +15 -0
  623. package/dist/types-cjs/components/transitions/TransitionRotate.vue.d.cts +11 -0
  624. package/dist/types-cjs/components/transitions/TransitionScale.vue.d.cts +15 -0
  625. package/dist/types-cjs/components/transitions/TransitionStaggerTranslate.vue.d.cts +11 -0
  626. package/dist/types-cjs/components/transitions/index.d.cts +3 -0
  627. package/dist/types-cjs/components/ui/BaseFloating/BaseFloating.vue.d.cts +237 -0
  628. package/dist/types-cjs/components/ui/BaseFloating/index.d.cts +1 -0
  629. package/dist/types-cjs/components/ui/BaseFloating/types.d.cts +0 -0
  630. package/dist/types-cjs/components/ui/BaseOverlay/BaseOverlay.vue.d.cts +228 -0
  631. package/dist/types-cjs/components/ui/BaseOverlay/index.d.cts +1 -0
  632. package/dist/types-cjs/components/ui/BaseOverlay/types.d.cts +108 -0
  633. package/dist/types-cjs/components/ui/GAction/GAction.vue.d.cts +2 -0
  634. package/dist/types-cjs/components/ui/GAction/index.d.cts +1 -0
  635. package/dist/types-cjs/components/ui/GAction/types.d.cts +33 -0
  636. package/dist/types-cjs/components/ui/GAlert/GAlert.vue.d.cts +756 -0
  637. package/dist/types-cjs/components/ui/GAlert/index.d.cts +1 -0
  638. package/dist/types-cjs/components/ui/GAlert/types.d.cts +400 -0
  639. package/dist/types-cjs/components/ui/GAside/GAside.vue.d.cts +50 -0
  640. package/dist/types-cjs/components/ui/GAside/GAsideGroup.vue.d.cts +30 -0
  641. package/dist/types-cjs/components/ui/GAside/GAsideItem.vue.d.cts +37 -0
  642. package/dist/types-cjs/components/ui/GAside/context.d.cts +15 -0
  643. package/dist/types-cjs/components/ui/GAside/groupContext.d.cts +7 -0
  644. package/dist/types-cjs/components/ui/GAside/index.d.cts +4 -0
  645. package/dist/types-cjs/components/ui/GAside/types.d.cts +273 -0
  646. package/dist/types-cjs/components/ui/GAvatar/GAvatar.vue.d.cts +867 -0
  647. package/dist/types-cjs/components/ui/GAvatar/GAvatarGroup.vue.d.cts +188 -0
  648. package/dist/types-cjs/components/ui/GAvatar/index.d.cts +3 -0
  649. package/dist/types-cjs/components/ui/GAvatar/types.d.cts +585 -0
  650. package/dist/types-cjs/components/ui/GBadge/GBadge.vue.d.cts +786 -0
  651. package/dist/types-cjs/components/ui/GBadge/index.d.cts +2 -0
  652. package/dist/types-cjs/components/ui/GBadge/types.d.cts +422 -0
  653. package/dist/types-cjs/components/ui/GButton/GButton.vue.d.cts +820 -0
  654. package/dist/types-cjs/components/ui/GButton/index.d.cts +2 -0
  655. package/dist/types-cjs/components/ui/GButton/types.d.cts +457 -0
  656. package/dist/types-cjs/components/ui/GCard/GCard.vue.d.cts +943 -0
  657. package/dist/types-cjs/components/ui/GCard/index.d.cts +2 -0
  658. package/dist/types-cjs/components/ui/GCard/types.d.cts +519 -0
  659. package/dist/types-cjs/components/ui/GCheckControl/GCheckControl.vue.d.cts +242 -0
  660. package/dist/types-cjs/components/ui/GCheckControl/GCheckGroup.vue.d.cts +184 -0
  661. package/dist/types-cjs/components/ui/GCheckControl/GCheckIndicator.vue.d.cts +28 -0
  662. package/dist/types-cjs/components/ui/GCheckControl/index.d.cts +3 -0
  663. package/dist/types-cjs/components/ui/GCheckbox/GCheckbox.vue.d.cts +27 -0
  664. package/dist/types-cjs/components/ui/GCheckbox/index.d.cts +2 -0
  665. package/dist/types-cjs/components/ui/GCheckbox/types.d.cts +1 -0
  666. package/dist/types-cjs/components/ui/GCheckboxGroup/GCheckboxGroup.vue.d.cts +26 -0
  667. package/dist/types-cjs/components/ui/GCheckboxGroup/index.d.cts +2 -0
  668. package/dist/types-cjs/components/ui/GCheckboxGroup/types.d.cts +12 -0
  669. package/dist/types-cjs/components/ui/GChip/GChip.vue.d.cts +731 -0
  670. package/dist/types-cjs/components/ui/GChip/index.d.cts +2 -0
  671. package/dist/types-cjs/components/ui/GChip/types.d.cts +403 -0
  672. package/dist/types-cjs/components/ui/GCombobox/GCombobox.vue.d.cts +39 -0
  673. package/dist/types-cjs/components/ui/GCombobox/index.d.cts +2 -0
  674. package/dist/types-cjs/components/ui/GCombobox/types.d.cts +59 -0
  675. package/dist/types-cjs/components/ui/GDivider/GDivider.vue.d.cts +959 -0
  676. package/dist/types-cjs/components/ui/GDivider/index.d.cts +2 -0
  677. package/dist/types-cjs/components/ui/GDivider/types.d.cts +518 -0
  678. package/dist/types-cjs/components/ui/GDrawer/GDrawer.vue.d.cts +429 -0
  679. package/dist/types-cjs/components/ui/GDrawer/index.d.cts +2 -0
  680. package/dist/types-cjs/components/ui/GDrawer/types.d.cts +205 -0
  681. package/dist/types-cjs/components/ui/GDropdown/GDropdown.vue.d.cts +418 -0
  682. package/dist/types-cjs/components/ui/GDropdown/index.d.cts +1 -0
  683. package/dist/types-cjs/components/ui/GDropdown/types.d.cts +208 -0
  684. package/dist/types-cjs/components/ui/GDropdownGroup/GDropdownGroup.vue.d.cts +23 -0
  685. package/dist/types-cjs/components/ui/GDropdownGroup/index.d.cts +2 -0
  686. package/dist/types-cjs/components/ui/GDropdownGroup/types.d.cts +10 -0
  687. package/dist/types-cjs/components/ui/GDropdownSelect/GDropdownSelect.vue.d.cts +19 -0
  688. package/dist/types-cjs/components/ui/GDropdownSelect/index.d.cts +0 -0
  689. package/dist/types-cjs/components/ui/GDropdownSelect/types.d.cts +14 -0
  690. package/dist/types-cjs/components/ui/GExpansion/GExpansion.vue.d.cts +110 -0
  691. package/dist/types-cjs/components/ui/GExpansion/index.d.cts +1 -0
  692. package/dist/types-cjs/components/ui/GExpansion/types.d.cts +479 -0
  693. package/dist/types-cjs/components/ui/GExpansionGroup/GExpansionGroup.vue.d.cts +34 -0
  694. package/dist/types-cjs/components/ui/GExpansionGroup/index.d.cts +1 -0
  695. package/dist/types-cjs/components/ui/GExpansionGroup/types.d.cts +61 -0
  696. package/dist/types-cjs/components/ui/GFAB/GFAB.vue.d.cts +415 -0
  697. package/dist/types-cjs/components/ui/GFAB/index.d.cts +1 -0
  698. package/dist/types-cjs/components/ui/GFAB/types.d.cts +247 -0
  699. package/dist/types-cjs/components/ui/GFieldBase/GFieldBase.vue.d.cts +312 -0
  700. package/dist/types-cjs/components/ui/GFieldBase/props.d.cts +256 -0
  701. package/dist/types-cjs/components/ui/GForm/GForm.vue.d.cts +148 -0
  702. package/dist/types-cjs/components/ui/GForm/index.d.cts +2 -0
  703. package/dist/types-cjs/components/ui/GForm/types.d.cts +107 -0
  704. package/dist/types-cjs/components/ui/GGradient/GGradient.vue.d.cts +362 -0
  705. package/dist/types-cjs/components/ui/GGradient/GGradientBorderLayer.vue.d.cts +17 -0
  706. package/dist/types-cjs/components/ui/GGradient/index.d.cts +2 -0
  707. package/dist/types-cjs/components/ui/GGradient/types.d.cts +23 -0
  708. package/dist/types-cjs/components/ui/GGradientMaterial/GGradientMaterial.vue.d.cts +251 -0
  709. package/dist/types-cjs/components/ui/GGradientMaterial/index.d.cts +2 -0
  710. package/dist/types-cjs/components/ui/GGradientMaterial/types.d.cts +140 -0
  711. package/dist/types-cjs/components/ui/GIcon/GIcon.vue.d.cts +31 -0
  712. package/dist/types-cjs/components/ui/GIcon/index.d.cts +2 -0
  713. package/dist/types-cjs/components/ui/GIcon/sets/MdiIconSet.vue.d.cts +3 -0
  714. package/dist/types-cjs/components/ui/GIcon/types.d.cts +24 -0
  715. package/dist/types-cjs/components/ui/GIcon.vue.d.cts +6 -0
  716. package/dist/types-cjs/components/ui/GImg/GImg.vue.d.cts +266 -0
  717. package/dist/types-cjs/components/ui/GImg/index.d.cts +2 -0
  718. package/dist/types-cjs/components/ui/GImg/types.d.cts +174 -0
  719. package/dist/types-cjs/components/ui/GInput/GInput.vue.d.cts +33 -0
  720. package/dist/types-cjs/components/ui/GInput/SwitchPassword.vue.d.cts +9 -0
  721. package/dist/types-cjs/components/ui/GInput/index.d.cts +2 -0
  722. package/dist/types-cjs/components/ui/GInput/types.d.cts +8 -0
  723. package/dist/types-cjs/components/ui/GLoading/GLoading.vue.d.cts +128 -0
  724. package/dist/types-cjs/components/ui/GLoading/types.d.cts +63 -0
  725. package/dist/types-cjs/components/ui/GMenu/GMenu.vue.d.cts +87 -0
  726. package/dist/types-cjs/components/ui/GMenu/GSubmenu.vue.d.cts +26 -0
  727. package/dist/types-cjs/components/ui/GMenu/index.d.cts +1 -0
  728. package/dist/types-cjs/components/ui/GMenu/types.d.cts +0 -0
  729. package/dist/types-cjs/components/ui/GMenuItem/GMenuItem.vue.d.cts +175 -0
  730. package/dist/types-cjs/components/ui/GMenuItem/index.d.cts +0 -0
  731. package/dist/types-cjs/components/ui/GMenuItem/types.d.cts +93 -0
  732. package/dist/types-cjs/components/ui/GModal/GModal.vue.d.cts +420 -0
  733. package/dist/types-cjs/components/ui/GModal/index.d.cts +2 -0
  734. package/dist/types-cjs/components/ui/GModal/types.d.cts +198 -0
  735. package/dist/types-cjs/components/ui/GNavList/GNavGroup.vue.d.cts +30 -0
  736. package/dist/types-cjs/components/ui/GNavList/GNavItem.vue.d.cts +37 -0
  737. package/dist/types-cjs/components/ui/GNavList/GNavList.vue.d.cts +42 -0
  738. package/dist/types-cjs/components/ui/GNavList/context.d.cts +15 -0
  739. package/dist/types-cjs/components/ui/GNavList/groupContext.d.cts +7 -0
  740. package/dist/types-cjs/components/ui/GNavList/index.d.cts +4 -0
  741. package/dist/types-cjs/components/ui/GNavList/types.d.cts +249 -0
  742. package/dist/types-cjs/components/ui/GNavbar/GNavbar.vue.d.cts +36 -0
  743. package/dist/types-cjs/components/ui/GNavbar/GNavbarItem.vue.d.cts +41 -0
  744. package/dist/types-cjs/components/ui/GNavbar/GNavbarMenu.vue.d.cts +43 -0
  745. package/dist/types-cjs/components/ui/GNavbar/GNavbarSubItem.vue.d.cts +42 -0
  746. package/dist/types-cjs/components/ui/GNavbar/context.d.cts +17 -0
  747. package/dist/types-cjs/components/ui/GNavbar/index.d.cts +5 -0
  748. package/dist/types-cjs/components/ui/GNavbar/menuContext.d.cts +9 -0
  749. package/dist/types-cjs/components/ui/GNavbar/types.d.cts +330 -0
  750. package/dist/types-cjs/components/ui/GProgress/GProgress.vue.d.cts +194 -0
  751. package/dist/types-cjs/components/ui/GProgress/index.d.cts +1 -0
  752. package/dist/types-cjs/components/ui/GProgress/types.d.cts +121 -0
  753. package/dist/types-cjs/components/ui/GQuickActions/GQuickActions.vue.d.cts +40 -0
  754. package/dist/types-cjs/components/ui/GQuickActions/index.d.cts +2 -0
  755. package/dist/types-cjs/components/ui/GQuickActions/types.d.cts +19 -0
  756. package/dist/types-cjs/components/ui/GRadio/GRadio.vue.d.cts +26 -0
  757. package/dist/types-cjs/components/ui/GRadio/GRadioItem.vue.d.cts +34 -0
  758. package/dist/types-cjs/components/ui/GRadio/index.d.cts +3 -0
  759. package/dist/types-cjs/components/ui/GRadio/types.d.cts +12 -0
  760. package/dist/types-cjs/components/ui/GSelect/GSelect.vue.d.cts +31 -0
  761. package/dist/types-cjs/components/ui/GSelect/index.d.cts +2 -0
  762. package/dist/types-cjs/components/ui/GSelect/types.d.cts +38 -0
  763. package/dist/types-cjs/components/ui/GSelectItem.vue.d.cts +43 -0
  764. package/dist/types-cjs/components/ui/GSnackbar/GSnackbar.vue.d.cts +986 -0
  765. package/dist/types-cjs/components/ui/GSnackbar/index.d.cts +2 -0
  766. package/dist/types-cjs/components/ui/GSnackbar/types.d.cts +515 -0
  767. package/dist/types-cjs/components/ui/GSquircle/GSquircle.vue.d.cts +19 -0
  768. package/dist/types-cjs/components/ui/GSquircle/index.d.cts +1 -0
  769. package/dist/types-cjs/components/ui/GSquircle/types.d.cts +20 -0
  770. package/dist/types-cjs/components/ui/GStepper/GStepItem.vue.d.cts +18 -0
  771. package/dist/types-cjs/components/ui/GStepper/GStepPanel.vue.d.cts +78 -0
  772. package/dist/types-cjs/components/ui/GStepper/GStepper.vue.d.cts +65 -0
  773. package/dist/types-cjs/components/ui/GStepper/GStepperActions.vue.d.cts +24 -0
  774. package/dist/types-cjs/components/ui/GStepper/context.d.cts +42 -0
  775. package/dist/types-cjs/components/ui/GStepper/index.d.cts +4 -0
  776. package/dist/types-cjs/components/ui/GStepper/types.d.cts +708 -0
  777. package/dist/types-cjs/components/ui/GSwitch/GSwitch.vue.d.cts +27 -0
  778. package/dist/types-cjs/components/ui/GSwitch/index.d.cts +2 -0
  779. package/dist/types-cjs/components/ui/GSwitch/types.d.cts +1 -0
  780. package/dist/types-cjs/components/ui/GTable/GTable.vue.d.cts +193 -0
  781. package/dist/types-cjs/components/ui/GTable/GTableBody.vue.d.cts +71 -0
  782. package/dist/types-cjs/components/ui/GTable/GTableCell.vue.d.cts +37 -0
  783. package/dist/types-cjs/components/ui/GTable/GTableExpandedRow.vue.d.cts +27 -0
  784. package/dist/types-cjs/components/ui/GTable/GTableHead.vue.d.cts +32 -0
  785. package/dist/types-cjs/components/ui/GTable/GTableRow.vue.d.cts +42 -0
  786. package/dist/types-cjs/components/ui/GTable/context.d.cts +25 -0
  787. package/dist/types-cjs/components/ui/GTable/index.d.cts +3 -0
  788. package/dist/types-cjs/components/ui/GTable/types.d.cts +670 -0
  789. package/dist/types-cjs/components/ui/GTable/useTable.d.cts +22 -0
  790. package/dist/types-cjs/components/ui/GTable/useTableExpansion.d.cts +17 -0
  791. package/dist/types-cjs/components/ui/GTable/useTableSpans.d.cts +12 -0
  792. package/dist/types-cjs/components/ui/GTabs/GTab.vue.d.cts +29 -0
  793. package/dist/types-cjs/components/ui/GTabs/GTabList.vue.d.cts +32 -0
  794. package/dist/types-cjs/components/ui/GTabs/GTabPanel.vue.d.cts +22 -0
  795. package/dist/types-cjs/components/ui/GTabs/GTabPanels.vue.d.cts +30 -0
  796. package/dist/types-cjs/components/ui/GTabs/GTabs.vue.d.cts +42 -0
  797. package/dist/types-cjs/components/ui/GTabs/context.d.cts +28 -0
  798. package/dist/types-cjs/components/ui/GTabs/index.d.cts +6 -0
  799. package/dist/types-cjs/components/ui/GTabs/types.d.cts +214 -0
  800. package/dist/types-cjs/components/ui/GText/GText.vue.d.cts +12 -0
  801. package/dist/types-cjs/components/ui/GText/index.d.cts +1 -0
  802. package/dist/types-cjs/components/ui/GText/types.d.cts +8 -0
  803. package/dist/types-cjs/components/ui/GTextarea/GTextarea.vue.d.cts +33 -0
  804. package/dist/types-cjs/components/ui/GTextarea/index.d.cts +2 -0
  805. package/dist/types-cjs/components/ui/GTextarea/types.d.cts +6 -0
  806. package/dist/types-cjs/components/ui/GToggleButton/GToggleButton.vue.d.cts +27 -0
  807. package/dist/types-cjs/components/ui/GToggleButton/index.d.cts +2 -0
  808. package/dist/types-cjs/components/ui/GToggleButton/types.d.cts +425 -0
  809. package/dist/types-cjs/components/ui/GTooltip/GTooltip.vue.d.cts +353 -0
  810. package/dist/types-cjs/components/ui/GTooltip/index.d.cts +1 -0
  811. package/dist/types-cjs/components/ui/GTooltip/types.d.cts +179 -0
  812. package/dist/types-cjs/directives/gradientIcon.d.cts +4 -0
  813. package/dist/types-cjs/directives/gradientText.d.cts +17 -0
  814. package/dist/types-cjs/directives/index.d.cts +13 -0
  815. package/dist/types-cjs/directives/loading.d.cts +19 -0
  816. package/dist/types-cjs/directives/mask.d.cts +13 -0
  817. package/dist/types-cjs/directives/ripple.d.cts +30 -0
  818. package/dist/types-cjs/directives/specular.d.cts +34 -0
  819. package/dist/types-cjs/directives/tooltip.d.cts +10 -0
  820. package/dist/types-cjs/index.d.cts +17 -0
  821. package/dist/types-cjs/package.json +3 -0
  822. package/dist/types-cjs/plugin.d.cts +15 -0
  823. package/dist/types-cjs/services/context.d.cts +8 -0
  824. package/dist/types-cjs/services/index.d.cts +4 -0
  825. package/dist/types-cjs/services/runtime.d.cts +5 -0
  826. package/dist/types-cjs/services/useLoading.d.cts +11 -0
  827. package/dist/types-cjs/services/useSnackbar.d.cts +25 -0
  828. package/dist/types-cjs/ssr/index.d.cts +2 -0
  829. package/dist/types-cjs/ssr/use/appScopedState.d.cts +1 -0
  830. package/dist/types-cjs/ssr/use/clientLifecycle.d.cts +2 -0
  831. package/dist/types-cjs/ssr/use/hydration.d.cts +2 -0
  832. package/dist/types-cjs/ssr/use/id.d.cts +1 -0
  833. package/dist/types-cjs/ssr/use/index.d.cts +6 -0
  834. package/dist/types-cjs/ssr/use/teleport.d.cts +11 -0
  835. package/dist/types-cjs/ssr/use/viewport.d.cts +12 -0
  836. package/dist/types-cjs/ssr/utils/environment.d.cts +11 -0
  837. package/dist/types-cjs/ssr/utils/head.d.cts +28 -0
  838. package/dist/types-cjs/ssr/utils/index.d.cts +3 -0
  839. package/dist/types-cjs/ssr/utils/mount.d.cts +21 -0
  840. package/dist/types-cjs/theme/color.d.cts +11 -0
  841. package/dist/types-cjs/theme/colorSeeds.d.cts +22 -0
  842. package/dist/types-cjs/theme/colorSystem.d.cts +12 -0
  843. package/dist/types-cjs/theme/cssTokens.d.cts +8 -0
  844. package/dist/types-cjs/theme/default.d.cts +51 -0
  845. package/dist/types-cjs/theme/gradient.d.cts +1 -0
  846. package/dist/types-cjs/theme/index.d.cts +13 -0
  847. package/dist/types-cjs/theme/palette.d.cts +13 -0
  848. package/dist/types-cjs/theme/scheme.d.cts +2 -0
  849. package/dist/types-cjs/theme/types.d.cts +11 -0
  850. package/dist/types-cjs/types/Colors.d.cts +2 -0
  851. package/dist/types-cjs/types/CommonTypes.d.cts +26 -0
  852. package/dist/types-cjs/types/UtilityTypes.d.cts +2 -0
  853. package/dist/types-cjs/use/PLA.d.cts +101 -0
  854. package/dist/types-cjs/use/actionProps.d.cts +38 -0
  855. package/dist/types-cjs/use/actionSurface.d.cts +200 -0
  856. package/dist/types-cjs/use/appendTarget.d.cts +5 -0
  857. package/dist/types-cjs/use/bodyScrollLock.d.cts +2 -0
  858. package/dist/types-cjs/use/booleanProp.d.cts +2 -0
  859. package/dist/types-cjs/use/breakpoints/index.d.cts +36 -0
  860. package/dist/types-cjs/use/check/booleanControl.d.cts +61 -0
  861. package/dist/types-cjs/use/check/groupFocus.d.cts +17 -0
  862. package/dist/types-cjs/use/check/index.d.cts +6 -0
  863. package/dist/types-cjs/use/check/optionGroup.d.cts +36 -0
  864. package/dist/types-cjs/use/check/selection.d.cts +2 -0
  865. package/dist/types-cjs/use/check/types.d.cts +496 -0
  866. package/dist/types-cjs/use/color.d.cts +20 -0
  867. package/dist/types-cjs/use/colorResolver.d.cts +16 -0
  868. package/dist/types-cjs/use/controllableOpen.d.cts +10 -0
  869. package/dist/types-cjs/use/defaults.d.cts +12 -0
  870. package/dist/types-cjs/use/density.d.cts +16 -0
  871. package/dist/types-cjs/use/disabled.d.cts +12 -0
  872. package/dist/types-cjs/use/dropdownContext.d.cts +9 -0
  873. package/dist/types-cjs/use/expansion/controller.d.cts +12 -0
  874. package/dist/types-cjs/use/expansion/di.d.cts +5 -0
  875. package/dist/types-cjs/use/expansion/index.d.cts +3 -0
  876. package/dist/types-cjs/use/expansion/types.d.cts +11 -0
  877. package/dist/types-cjs/use/floating.d.cts +120 -0
  878. package/dist/types-cjs/use/floatingDismiss.d.cts +10 -0
  879. package/dist/types-cjs/use/floatingLayer.d.cts +12 -0
  880. package/dist/types-cjs/use/floatingTrigger.d.cts +27 -0
  881. package/dist/types-cjs/use/focused.d.cts +12 -0
  882. package/dist/types-cjs/use/form/context.d.cts +8 -0
  883. package/dist/types-cjs/use/form/control.d.cts +21 -0
  884. package/dist/types-cjs/use/form/fieldKeyboard.d.cts +19 -0
  885. package/dist/types-cjs/use/form/props.d.cts +121 -0
  886. package/dist/types-cjs/use/form/textFieldComponent.d.cts +12 -0
  887. package/dist/types-cjs/use/form/textFieldControl.d.cts +71 -0
  888. package/dist/types-cjs/use/glass.d.cts +24 -0
  889. package/dist/types-cjs/use/gradient.d.cts +291 -0
  890. package/dist/types-cjs/use/gradientGlow.d.cts +48 -0
  891. package/dist/types-cjs/use/gradientMaterial.d.cts +21 -0
  892. package/dist/types-cjs/use/gradientRuntime.d.cts +11 -0
  893. package/dist/types-cjs/use/gradientRuntimeRegistry.d.cts +8 -0
  894. package/dist/types-cjs/use/gradientSurface.d.cts +50 -0
  895. package/dist/types-cjs/use/group/di.d.cts +5 -0
  896. package/dist/types-cjs/use/group/groupController.d.cts +10 -0
  897. package/dist/types-cjs/use/group/types.d.cts +9 -0
  898. package/dist/types-cjs/use/highlighted.d.cts +12 -0
  899. package/dist/types-cjs/use/icon.d.cts +22 -0
  900. package/dist/types-cjs/use/index.d.cts +23 -0
  901. package/dist/types-cjs/use/input/control.d.cts +10 -0
  902. package/dist/types-cjs/use/input/emits.d.cts +8 -0
  903. package/dist/types-cjs/use/input/index.d.cts +4 -0
  904. package/dist/types-cjs/use/input/props.d.cts +163 -0
  905. package/dist/types-cjs/use/items.d.cts +20 -0
  906. package/dist/types-cjs/use/layerStack.d.cts +15 -0
  907. package/dist/types-cjs/use/mask/index.d.cts +24 -0
  908. package/dist/types-cjs/use/material.d.cts +113 -0
  909. package/dist/types-cjs/use/materialSurface.d.cts +382 -0
  910. package/dist/types-cjs/use/menu.d.cts +49 -0
  911. package/dist/types-cjs/use/menuContext.d.cts +6 -0
  912. package/dist/types-cjs/use/navigation/controller.d.cts +14 -0
  913. package/dist/types-cjs/use/navigation/index.d.cts +4 -0
  914. package/dist/types-cjs/use/navigation/item.d.cts +9 -0
  915. package/dist/types-cjs/use/navigation/keyboard.d.cts +4 -0
  916. package/dist/types-cjs/use/navigation/types.d.cts +42 -0
  917. package/dist/types-cjs/use/open.d.cts +2 -0
  918. package/dist/types-cjs/use/overlay.d.cts +111 -0
  919. package/dist/types-cjs/use/placement.d.cts +16 -0
  920. package/dist/types-cjs/use/px.d.cts +4 -0
  921. package/dist/types-cjs/use/rounded.d.cts +12 -0
  922. package/dist/types-cjs/use/routerLink.d.cts +10 -0
  923. package/dist/types-cjs/use/select/comboboxController.d.cts +36 -0
  924. package/dist/types-cjs/use/select/commit.d.cts +23 -0
  925. package/dist/types-cjs/use/select/controller.d.cts +23 -0
  926. package/dist/types-cjs/use/select/creatable.d.cts +18 -0
  927. package/dist/types-cjs/use/select/fieldControl.d.cts +59 -0
  928. package/dist/types-cjs/use/select/filter.d.cts +14 -0
  929. package/dist/types-cjs/use/select/items.d.cts +14 -0
  930. package/dist/types-cjs/use/select/listboxKeyboard.d.cts +9 -0
  931. package/dist/types-cjs/use/select/menuItems.d.cts +11 -0
  932. package/dist/types-cjs/use/select/menuSlot.d.cts +5 -0
  933. package/dist/types-cjs/use/select/modelFallbackItems.d.cts +12 -0
  934. package/dist/types-cjs/use/select/search.d.cts +14 -0
  935. package/dist/types-cjs/use/select/searchFieldControl.d.cts +24 -0
  936. package/dist/types-cjs/use/select/selection.d.cts +12 -0
  937. package/dist/types-cjs/use/select/selectionController.d.cts +19 -0
  938. package/dist/types-cjs/use/select/selectionSummary.d.cts +8 -0
  939. package/dist/types-cjs/use/select/tokenInputKeyboard.d.cts +11 -0
  940. package/dist/types-cjs/use/select/types.d.cts +24 -0
  941. package/dist/types-cjs/use/selected.d.cts +17 -0
  942. package/dist/types-cjs/use/selectionModel.d.cts +19 -0
  943. package/dist/types-cjs/use/size.d.cts +16 -0
  944. package/dist/types-cjs/use/slots.d.cts +15 -0
  945. package/dist/types-cjs/use/state.d.cts +13 -0
  946. package/dist/types-cjs/use/stateIcon.d.cts +9 -0
  947. package/dist/types-cjs/use/stepper/controller.d.cts +20 -0
  948. package/dist/types-cjs/use/stepper/index.d.cts +1 -0
  949. package/dist/types-cjs/use/surface.d.cts +128 -0
  950. package/dist/types-cjs/use/surfaceColor.d.cts +19 -0
  951. package/dist/types-cjs/use/surfaceMaterial.d.cts +45 -0
  952. package/dist/types-cjs/use/tagName.d.cts +47 -0
  953. package/dist/types-cjs/use/textarea/index.d.cts +2 -0
  954. package/dist/types-cjs/use/textarea/props.d.cts +144 -0
  955. package/dist/types-cjs/use/transition.d.cts +156 -0
  956. package/dist/types-cjs/use/variant.d.cts +16 -0
  957. package/dist/types-cjs/use/visibleProps.d.cts +1 -0
  958. package/dist/types-cjs/use/zIndex.d.cts +10 -0
  959. package/dist/types-cjs/utils/camelToKebabCase.d.cts +1 -0
  960. package/dist/types-cjs/utils/createComponentId.d.cts +1 -0
  961. package/dist/types-cjs/utils/createId.d.cts +1 -0
  962. package/dist/types-cjs/utils/propsFactory.d.cts +29 -0
  963. package/dist/types-l8OJZAJz.cjs +1 -0
  964. package/dist/use.cjs +1 -1
  965. package/dist/use.mjs +80 -55
  966. package/dist/useSnackbar-CGt0lJDk.js +245 -0
  967. package/dist/useSnackbar-CRUtXt4_.cjs +1 -0
  968. package/dist/variant-BvBpmTET.cjs +1 -0
  969. package/dist/variant-Fpx1q_TY.js +15 -0
  970. package/dist/viewport-BhvdzcLi.cjs +1 -0
  971. package/dist/viewport-DhX6inI4.js +11 -0
  972. package/package.json +358 -28
  973. package/dist/GLoading.vue_vue_type_style_index_0_lang-BbVYszn2.js +0 -468
  974. package/dist/GLoading.vue_vue_type_style_index_0_lang-DW5X0giH.cjs +0 -1
  975. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BPwF9Kug.js +0 -8734
  976. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-C45EmRhx.cjs +0 -1
  977. package/dist/camelToKebabCase-BQDotaQm.cjs +0 -316
  978. package/dist/camelToKebabCase-BWbQb81D.js +0 -3783
  979. package/dist/default--73FwpwZ.cjs +0 -4
  980. package/dist/default-DlsS6GI_.js +0 -58
  981. package/dist/defaults-BlTdRhHs.cjs +0 -1
  982. package/dist/defaults-DMi34V8q.js +0 -51
  983. package/dist/index-Cs3XQ3JB.js +0 -97
  984. package/dist/index-DN5ngVtp.cjs +0 -1
  985. package/dist/index-DVHKm06w.cjs +0 -1
  986. package/dist/index-DeFv4BdJ.js +0 -418
  987. package/dist/mask-669nMf98.js +0 -936
  988. package/dist/mask-Bh_UkcCe.cjs +0 -1
  989. package/dist/materialSurface-BbFTyJuA.js +0 -634
  990. package/dist/materialSurface-DOfA2E9c.cjs +0 -1
  991. package/dist/scheme-CZ0a0X5e.cjs +0 -299
  992. package/dist/scheme-Dqwdqg6N.js +0 -1405
  993. package/dist/surface-C3w1Rz6V.js +0 -291
  994. package/dist/surface-DB9flb-h.cjs +0 -1
  995. package/dist/useSnackbar-6OiYxhJA.cjs +0 -1
  996. package/dist/useSnackbar-BYPu4tJ4.js +0 -922
@@ -0,0 +1,3779 @@
1
+ const COLOR_SEEDS = {
2
+ red: "#F44336",
3
+ pink: "#E91E63",
4
+ purple: "#9C27B0",
5
+ deepPurple: "#673AB7",
6
+ indigo: "#3F51B5",
7
+ blue: "#2196F3",
8
+ lightBlue: "#03A9F4",
9
+ cyan: "#00BCD4",
10
+ teal: "#009688",
11
+ green: "#4CAF50",
12
+ lightGreen: "#8BC34A",
13
+ lime: "#CDDC39",
14
+ yellow: "#FFEB3B",
15
+ amber: "#FFC107",
16
+ orange: "#FF9800",
17
+ deepOrange: "#FF5722",
18
+ brown: "#795548",
19
+ grey: "#9E9E9E",
20
+ blueGrey: "#607D8B"
21
+ }, clamp = (value, min = 0, max = 1) => Math.min(max, Math.max(min, value)), toLinear = (value) => {
22
+ const channel = value / 255;
23
+ return channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;
24
+ }, parseHex = (value) => {
25
+ const hex = value.slice(1), normalized = hex.length === 3 || hex.length === 4 ? hex.slice(0, 3).split("").map((character) => character.repeat(2)).join("") : hex.slice(0, 6);
26
+ return normalized.length !== 6 || !/^[\da-f]{6}$/i.test(normalized) ? null : {
27
+ r: parseInt(normalized.slice(0, 2), 16),
28
+ g: parseInt(normalized.slice(2, 4), 16),
29
+ b: parseInt(normalized.slice(4, 6), 16)
30
+ };
31
+ }, parseRgb = (value) => {
32
+ const match = value.match(
33
+ /^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i
34
+ );
35
+ return match ? {
36
+ r: clamp(Number(match[1]), 0, 255),
37
+ g: clamp(Number(match[2]), 0, 255),
38
+ b: clamp(Number(match[3]), 0, 255)
39
+ } : null;
40
+ }, parseColor = (input) => {
41
+ if (typeof input == "number") {
42
+ const value2 = input & 16777215;
43
+ return {
44
+ r: value2 >> 16 & 255,
45
+ g: value2 >> 8 & 255,
46
+ b: value2 & 255
47
+ };
48
+ }
49
+ const value = input.trim();
50
+ return value.startsWith("#") ? parseHex(value) : value.toLowerCase().startsWith("rgb") ? parseRgb(value) : null;
51
+ }, rgbToHex = ({ r, g, b }) => `#${[r, g, b].map((channel) => Math.round(channel).toString(16).padStart(2, "0")).join("")}`, rgbToChannels = ({ r, g, b }) => `${Math.round(r)}, ${Math.round(g)}, ${Math.round(b)}`, colorToHex = (input, fallback) => {
52
+ const color = parseColor(input) ?? parseColor(fallback);
53
+ if (!color)
54
+ throw new Error(`Invalid fallback color: ${fallback}`);
55
+ return rgbToHex(color);
56
+ }, relativeLuminance = (color) => 0.2126 * toLinear(color.r) + 0.7152 * toLinear(color.g) + 0.0722 * toLinear(color.b), getContrastingColor = (color) => {
57
+ const parsed = parseColor(color);
58
+ if (!parsed) return "#ffffff";
59
+ const luminance = relativeLuminance(parsed), whiteContrast = 1.05 / (luminance + 0.05), darkContrast = (luminance + 0.05) / 0.055;
60
+ return whiteContrast >= darkContrast ? "#ffffff" : "#0d0d12";
61
+ };
62
+ /**
63
+ * @license
64
+ * Copyright 2021 Google LLC
65
+ *
66
+ * Licensed under the Apache License, Version 2.0 (the "License");
67
+ * you may not use this file except in compliance with the License.
68
+ * You may obtain a copy of the License at
69
+ *
70
+ * http://www.apache.org/licenses/LICENSE-2.0
71
+ *
72
+ * Unless required by applicable law or agreed to in writing, software
73
+ * distributed under the License is distributed on an "AS IS" BASIS,
74
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75
+ * See the License for the specific language governing permissions and
76
+ * limitations under the License.
77
+ */
78
+ function signum(num) {
79
+ return num < 0 ? -1 : num === 0 ? 0 : 1;
80
+ }
81
+ function lerp(start, stop, amount) {
82
+ return (1 - amount) * start + amount * stop;
83
+ }
84
+ function clampInt(min, max, input) {
85
+ return input < min ? min : input > max ? max : input;
86
+ }
87
+ function clampDouble(min, max, input) {
88
+ return input < min ? min : input > max ? max : input;
89
+ }
90
+ function sanitizeDegreesDouble(degrees) {
91
+ return degrees = degrees % 360, degrees < 0 && (degrees = degrees + 360), degrees;
92
+ }
93
+ function rotationDirection(from, to) {
94
+ return sanitizeDegreesDouble(to - from) <= 180 ? 1 : -1;
95
+ }
96
+ function differenceDegrees(a, b) {
97
+ return 180 - Math.abs(Math.abs(a - b) - 180);
98
+ }
99
+ function matrixMultiply(row, matrix) {
100
+ const a = row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2], b = row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2], c = row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];
101
+ return [a, b, c];
102
+ }
103
+ /**
104
+ * @license
105
+ * Copyright 2021 Google LLC
106
+ *
107
+ * Licensed under the Apache License, Version 2.0 (the "License");
108
+ * you may not use this file except in compliance with the License.
109
+ * You may obtain a copy of the License at
110
+ *
111
+ * http://www.apache.org/licenses/LICENSE-2.0
112
+ *
113
+ * Unless required by applicable law or agreed to in writing, software
114
+ * distributed under the License is distributed on an "AS IS" BASIS,
115
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116
+ * See the License for the specific language governing permissions and
117
+ * limitations under the License.
118
+ */
119
+ const SRGB_TO_XYZ = [
120
+ [0.41233895, 0.35762064, 0.18051042],
121
+ [0.2126, 0.7152, 0.0722],
122
+ [0.01932141, 0.11916382, 0.95034478]
123
+ ], XYZ_TO_SRGB = [
124
+ [
125
+ 3.2413774792388685,
126
+ -1.5376652402851851,
127
+ -0.49885366846268053
128
+ ],
129
+ [
130
+ -0.9691452513005321,
131
+ 1.8758853451067872,
132
+ 0.04156585616912061
133
+ ],
134
+ [
135
+ 0.05562093689691305,
136
+ -0.20395524564742123,
137
+ 1.0571799111220335
138
+ ]
139
+ ], WHITE_POINT_D65 = [95.047, 100, 108.883];
140
+ function argbFromRgb(red, green, blue) {
141
+ return (255 << 24 | (red & 255) << 16 | (green & 255) << 8 | blue & 255) >>> 0;
142
+ }
143
+ function argbFromLinrgb(linrgb) {
144
+ const r = delinearized(linrgb[0]), g = delinearized(linrgb[1]), b = delinearized(linrgb[2]);
145
+ return argbFromRgb(r, g, b);
146
+ }
147
+ function redFromArgb(argb) {
148
+ return argb >> 16 & 255;
149
+ }
150
+ function greenFromArgb(argb) {
151
+ return argb >> 8 & 255;
152
+ }
153
+ function blueFromArgb(argb) {
154
+ return argb & 255;
155
+ }
156
+ function argbFromXyz(x, y, z) {
157
+ const matrix = XYZ_TO_SRGB, linearR = matrix[0][0] * x + matrix[0][1] * y + matrix[0][2] * z, linearG = matrix[1][0] * x + matrix[1][1] * y + matrix[1][2] * z, linearB = matrix[2][0] * x + matrix[2][1] * y + matrix[2][2] * z, r = delinearized(linearR), g = delinearized(linearG), b = delinearized(linearB);
158
+ return argbFromRgb(r, g, b);
159
+ }
160
+ function xyzFromArgb(argb) {
161
+ const r = linearized(redFromArgb(argb)), g = linearized(greenFromArgb(argb)), b = linearized(blueFromArgb(argb));
162
+ return matrixMultiply([r, g, b], SRGB_TO_XYZ);
163
+ }
164
+ function argbFromLstar(lstar) {
165
+ const y = yFromLstar(lstar), component = delinearized(y);
166
+ return argbFromRgb(component, component, component);
167
+ }
168
+ function lstarFromArgb(argb) {
169
+ const y = xyzFromArgb(argb)[1];
170
+ return 116 * labF(y / 100) - 16;
171
+ }
172
+ function yFromLstar(lstar) {
173
+ return 100 * labInvf((lstar + 16) / 116);
174
+ }
175
+ function lstarFromY(y) {
176
+ return labF(y / 100) * 116 - 16;
177
+ }
178
+ function linearized(rgbComponent) {
179
+ const normalized = rgbComponent / 255;
180
+ return normalized <= 0.040449936 ? normalized / 12.92 * 100 : Math.pow((normalized + 0.055) / 1.055, 2.4) * 100;
181
+ }
182
+ function delinearized(rgbComponent) {
183
+ const normalized = rgbComponent / 100;
184
+ let delinearized2 = 0;
185
+ return normalized <= 31308e-7 ? delinearized2 = normalized * 12.92 : delinearized2 = 1.055 * Math.pow(normalized, 1 / 2.4) - 0.055, clampInt(0, 255, Math.round(delinearized2 * 255));
186
+ }
187
+ function whitePointD65() {
188
+ return WHITE_POINT_D65;
189
+ }
190
+ function labF(t) {
191
+ const e = 0.008856451679035631, kappa = 24389 / 27;
192
+ return t > e ? Math.pow(t, 1 / 3) : (kappa * t + 16) / 116;
193
+ }
194
+ function labInvf(ft) {
195
+ const e = 0.008856451679035631, kappa = 24389 / 27, ft3 = ft * ft * ft;
196
+ return ft3 > e ? ft3 : (116 * ft - 16) / kappa;
197
+ }
198
+ /**
199
+ * @license
200
+ * Copyright 2021 Google LLC
201
+ *
202
+ * Licensed under the Apache License, Version 2.0 (the "License");
203
+ * you may not use this file except in compliance with the License.
204
+ * You may obtain a copy of the License at
205
+ *
206
+ * http://www.apache.org/licenses/LICENSE-2.0
207
+ *
208
+ * Unless required by applicable law or agreed to in writing, software
209
+ * distributed under the License is distributed on an "AS IS" BASIS,
210
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
211
+ * See the License for the specific language governing permissions and
212
+ * limitations under the License.
213
+ */
214
+ class ViewingConditions {
215
+ /**
216
+ * Create ViewingConditions from a simple, physically relevant, set of
217
+ * parameters.
218
+ *
219
+ * @param whitePoint White point, measured in the XYZ color space.
220
+ * default = D65, or sunny day afternoon
221
+ * @param adaptingLuminance The luminance of the adapting field. Informally,
222
+ * how bright it is in the room where the color is viewed. Can be
223
+ * calculated from lux by multiplying lux by 0.0586. default = 11.72,
224
+ * or 200 lux.
225
+ * @param backgroundLstar The lightness of the area surrounding the color.
226
+ * measured by L* in L*a*b*. default = 50.0
227
+ * @param surround A general description of the lighting surrounding the
228
+ * color. 0 is pitch dark, like watching a movie in a theater. 1.0 is a
229
+ * dimly light room, like watching TV at home at night. 2.0 means there
230
+ * is no difference between the lighting on the color and around it.
231
+ * default = 2.0
232
+ * @param discountingIlluminant Whether the eye accounts for the tint of the
233
+ * ambient lighting, such as knowing an apple is still red in green light.
234
+ * default = false, the eye does not perform this process on
235
+ * self-luminous objects like displays.
236
+ */
237
+ static make(whitePoint = whitePointD65(), adaptingLuminance = 200 / Math.PI * yFromLstar(50) / 100, backgroundLstar = 50, surround = 2, discountingIlluminant = !1) {
238
+ const xyz = whitePoint, rW = xyz[0] * 0.401288 + xyz[1] * 0.650173 + xyz[2] * -0.051461, gW = xyz[0] * -0.250268 + xyz[1] * 1.204414 + xyz[2] * 0.045854, bW = xyz[0] * -2079e-6 + xyz[1] * 0.048952 + xyz[2] * 0.953127, f = 0.8 + surround / 10, c = f >= 0.9 ? lerp(0.59, 0.69, (f - 0.9) * 10) : lerp(0.525, 0.59, (f - 0.8) * 10);
239
+ let d = discountingIlluminant ? 1 : f * (1 - 1 / 3.6 * Math.exp((-adaptingLuminance - 42) / 92));
240
+ d = d > 1 ? 1 : d < 0 ? 0 : d;
241
+ const nc = f, rgbD = [
242
+ d * (100 / rW) + 1 - d,
243
+ d * (100 / gW) + 1 - d,
244
+ d * (100 / bW) + 1 - d
245
+ ], k = 1 / (5 * adaptingLuminance + 1), k4 = k * k * k * k, k4F = 1 - k4, fl = k4 * adaptingLuminance + 0.1 * k4F * k4F * Math.cbrt(5 * adaptingLuminance), n = yFromLstar(backgroundLstar) / whitePoint[1], z = 1.48 + Math.sqrt(n), nbb = 0.725 / Math.pow(n, 0.2), ncb = nbb, rgbAFactors = [
246
+ Math.pow(fl * rgbD[0] * rW / 100, 0.42),
247
+ Math.pow(fl * rgbD[1] * gW / 100, 0.42),
248
+ Math.pow(fl * rgbD[2] * bW / 100, 0.42)
249
+ ], rgbA = [
250
+ 400 * rgbAFactors[0] / (rgbAFactors[0] + 27.13),
251
+ 400 * rgbAFactors[1] / (rgbAFactors[1] + 27.13),
252
+ 400 * rgbAFactors[2] / (rgbAFactors[2] + 27.13)
253
+ ], aw = (2 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]) * nbb;
254
+ return new ViewingConditions(n, aw, nbb, ncb, c, nc, rgbD, fl, Math.pow(fl, 0.25), z);
255
+ }
256
+ /**
257
+ * Parameters are intermediate values of the CAM16 conversion process. Their
258
+ * names are shorthand for technical color science terminology, this class
259
+ * would not benefit from documenting them individually. A brief overview
260
+ * is available in the CAM16 specification, and a complete overview requires
261
+ * a color science textbook, such as Fairchild's Color Appearance Models.
262
+ */
263
+ constructor(n, aw, nbb, ncb, c, nc, rgbD, fl, fLRoot, z) {
264
+ this.n = n, this.aw = aw, this.nbb = nbb, this.ncb = ncb, this.c = c, this.nc = nc, this.rgbD = rgbD, this.fl = fl, this.fLRoot = fLRoot, this.z = z;
265
+ }
266
+ }
267
+ ViewingConditions.DEFAULT = ViewingConditions.make();
268
+ /**
269
+ * @license
270
+ * Copyright 2021 Google LLC
271
+ *
272
+ * Licensed under the Apache License, Version 2.0 (the "License");
273
+ * you may not use this file except in compliance with the License.
274
+ * You may obtain a copy of the License at
275
+ *
276
+ * http://www.apache.org/licenses/LICENSE-2.0
277
+ *
278
+ * Unless required by applicable law or agreed to in writing, software
279
+ * distributed under the License is distributed on an "AS IS" BASIS,
280
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
281
+ * See the License for the specific language governing permissions and
282
+ * limitations under the License.
283
+ */
284
+ class Cam16 {
285
+ /**
286
+ * All of the CAM16 dimensions can be calculated from 3 of the dimensions, in
287
+ * the following combinations:
288
+ * - {j or q} and {c, m, or s} and hue
289
+ * - jstar, astar, bstar
290
+ * Prefer using a static method that constructs from 3 of those dimensions.
291
+ * This constructor is intended for those methods to use to return all
292
+ * possible dimensions.
293
+ *
294
+ * @param hue
295
+ * @param chroma informally, colorfulness / color intensity. like saturation
296
+ * in HSL, except perceptually accurate.
297
+ * @param j lightness
298
+ * @param q brightness; ratio of lightness to white point's lightness
299
+ * @param m colorfulness
300
+ * @param s saturation; ratio of chroma to white point's chroma
301
+ * @param jstar CAM16-UCS J coordinate
302
+ * @param astar CAM16-UCS a coordinate
303
+ * @param bstar CAM16-UCS b coordinate
304
+ */
305
+ constructor(hue, chroma, j, q, m, s, jstar, astar, bstar) {
306
+ this.hue = hue, this.chroma = chroma, this.j = j, this.q = q, this.m = m, this.s = s, this.jstar = jstar, this.astar = astar, this.bstar = bstar;
307
+ }
308
+ /**
309
+ * CAM16 instances also have coordinates in the CAM16-UCS space, called J*,
310
+ * a*, b*, or jstar, astar, bstar in code. CAM16-UCS is included in the CAM16
311
+ * specification, and is used to measure distances between colors.
312
+ */
313
+ distance(other) {
314
+ const dJ = this.jstar - other.jstar, dA = this.astar - other.astar, dB = this.bstar - other.bstar, dEPrime = Math.sqrt(dJ * dJ + dA * dA + dB * dB);
315
+ return 1.41 * Math.pow(dEPrime, 0.63);
316
+ }
317
+ /**
318
+ * @param argb ARGB representation of a color.
319
+ * @return CAM16 color, assuming the color was viewed in default viewing
320
+ * conditions.
321
+ */
322
+ static fromInt(argb) {
323
+ return Cam16.fromIntInViewingConditions(argb, ViewingConditions.DEFAULT);
324
+ }
325
+ /**
326
+ * @param argb ARGB representation of a color.
327
+ * @param viewingConditions Information about the environment where the color
328
+ * was observed.
329
+ * @return CAM16 color.
330
+ */
331
+ static fromIntInViewingConditions(argb, viewingConditions) {
332
+ const red = (argb & 16711680) >> 16, green = (argb & 65280) >> 8, blue = argb & 255, redL = linearized(red), greenL = linearized(green), blueL = linearized(blue), x = 0.41233895 * redL + 0.35762064 * greenL + 0.18051042 * blueL, y = 0.2126 * redL + 0.7152 * greenL + 0.0722 * blueL, z = 0.01932141 * redL + 0.11916382 * greenL + 0.95034478 * blueL, rC = 0.401288 * x + 0.650173 * y - 0.051461 * z, gC = -0.250268 * x + 1.204414 * y + 0.045854 * z, bC = -2079e-6 * x + 0.048952 * y + 0.953127 * z, rD = viewingConditions.rgbD[0] * rC, gD = viewingConditions.rgbD[1] * gC, bD = viewingConditions.rgbD[2] * bC, rAF = Math.pow(viewingConditions.fl * Math.abs(rD) / 100, 0.42), gAF = Math.pow(viewingConditions.fl * Math.abs(gD) / 100, 0.42), bAF = Math.pow(viewingConditions.fl * Math.abs(bD) / 100, 0.42), rA = signum(rD) * 400 * rAF / (rAF + 27.13), gA = signum(gD) * 400 * gAF / (gAF + 27.13), bA = signum(bD) * 400 * bAF / (bAF + 27.13), a = (11 * rA + -12 * gA + bA) / 11, b = (rA + gA - 2 * bA) / 9, u = (20 * rA + 20 * gA + 21 * bA) / 20, p2 = (40 * rA + 20 * gA + bA) / 20, atanDegrees = Math.atan2(b, a) * 180 / Math.PI, hue = sanitizeDegreesDouble(atanDegrees), hueRadians = hue * Math.PI / 180, ac = p2 * viewingConditions.nbb, j = 100 * Math.pow(ac / viewingConditions.aw, viewingConditions.c * viewingConditions.z), q = 4 / viewingConditions.c * Math.sqrt(j / 100) * (viewingConditions.aw + 4) * viewingConditions.fLRoot, huePrime = hue < 20.14 ? hue + 360 : hue, eHue = 0.25 * (Math.cos(huePrime * Math.PI / 180 + 2) + 3.8), t = 5e4 / 13 * eHue * viewingConditions.nc * viewingConditions.ncb * Math.sqrt(a * a + b * b) / (u + 0.305), alpha = Math.pow(t, 0.9) * Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73), c = alpha * Math.sqrt(j / 100), m = c * viewingConditions.fLRoot, s = 50 * Math.sqrt(alpha * viewingConditions.c / (viewingConditions.aw + 4)), jstar = (1 + 100 * 7e-3) * j / (1 + 7e-3 * j), mstar = 1 / 0.0228 * Math.log(1 + 0.0228 * m), astar = mstar * Math.cos(hueRadians), bstar = mstar * Math.sin(hueRadians);
333
+ return new Cam16(hue, c, j, q, m, s, jstar, astar, bstar);
334
+ }
335
+ /**
336
+ * @param j CAM16 lightness
337
+ * @param c CAM16 chroma
338
+ * @param h CAM16 hue
339
+ */
340
+ static fromJch(j, c, h) {
341
+ return Cam16.fromJchInViewingConditions(j, c, h, ViewingConditions.DEFAULT);
342
+ }
343
+ /**
344
+ * @param j CAM16 lightness
345
+ * @param c CAM16 chroma
346
+ * @param h CAM16 hue
347
+ * @param viewingConditions Information about the environment where the color
348
+ * was observed.
349
+ */
350
+ static fromJchInViewingConditions(j, c, h, viewingConditions) {
351
+ const q = 4 / viewingConditions.c * Math.sqrt(j / 100) * (viewingConditions.aw + 4) * viewingConditions.fLRoot, m = c * viewingConditions.fLRoot, alpha = c / Math.sqrt(j / 100), s = 50 * Math.sqrt(alpha * viewingConditions.c / (viewingConditions.aw + 4)), hueRadians = h * Math.PI / 180, jstar = (1 + 100 * 7e-3) * j / (1 + 7e-3 * j), mstar = 1 / 0.0228 * Math.log(1 + 0.0228 * m), astar = mstar * Math.cos(hueRadians), bstar = mstar * Math.sin(hueRadians);
352
+ return new Cam16(h, c, j, q, m, s, jstar, astar, bstar);
353
+ }
354
+ /**
355
+ * @param jstar CAM16-UCS lightness.
356
+ * @param astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian
357
+ * coordinate on the Y axis.
358
+ * @param bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian
359
+ * coordinate on the X axis.
360
+ */
361
+ static fromUcs(jstar, astar, bstar) {
362
+ return Cam16.fromUcsInViewingConditions(jstar, astar, bstar, ViewingConditions.DEFAULT);
363
+ }
364
+ /**
365
+ * @param jstar CAM16-UCS lightness.
366
+ * @param astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian
367
+ * coordinate on the Y axis.
368
+ * @param bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian
369
+ * coordinate on the X axis.
370
+ * @param viewingConditions Information about the environment where the color
371
+ * was observed.
372
+ */
373
+ static fromUcsInViewingConditions(jstar, astar, bstar, viewingConditions) {
374
+ const a = astar, b = bstar, m = Math.sqrt(a * a + b * b), c = (Math.exp(m * 0.0228) - 1) / 0.0228 / viewingConditions.fLRoot;
375
+ let h = Math.atan2(b, a) * (180 / Math.PI);
376
+ h < 0 && (h += 360);
377
+ const j = jstar / (1 - (jstar - 100) * 7e-3);
378
+ return Cam16.fromJchInViewingConditions(j, c, h, viewingConditions);
379
+ }
380
+ /**
381
+ * @return ARGB representation of color, assuming the color was viewed in
382
+ * default viewing conditions, which are near-identical to the default
383
+ * viewing conditions for sRGB.
384
+ */
385
+ toInt() {
386
+ return this.viewed(ViewingConditions.DEFAULT);
387
+ }
388
+ /**
389
+ * @param viewingConditions Information about the environment where the color
390
+ * will be viewed.
391
+ * @return ARGB representation of color
392
+ */
393
+ viewed(viewingConditions) {
394
+ const alpha = this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100), t = Math.pow(alpha / Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73), 1 / 0.9), hRad = this.hue * Math.PI / 180, eHue = 0.25 * (Math.cos(hRad + 2) + 3.8), ac = viewingConditions.aw * Math.pow(this.j / 100, 1 / viewingConditions.c / viewingConditions.z), p1 = eHue * (5e4 / 13) * viewingConditions.nc * viewingConditions.ncb, p2 = ac / viewingConditions.nbb, hSin = Math.sin(hRad), hCos = Math.cos(hRad), gamma = 23 * (p2 + 0.305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin), a = gamma * hCos, b = gamma * hSin, rA = (460 * p2 + 451 * a + 288 * b) / 1403, gA = (460 * p2 - 891 * a - 261 * b) / 1403, bA = (460 * p2 - 220 * a - 6300 * b) / 1403, rCBase = Math.max(0, 27.13 * Math.abs(rA) / (400 - Math.abs(rA))), rC = signum(rA) * (100 / viewingConditions.fl) * Math.pow(rCBase, 1 / 0.42), gCBase = Math.max(0, 27.13 * Math.abs(gA) / (400 - Math.abs(gA))), gC = signum(gA) * (100 / viewingConditions.fl) * Math.pow(gCBase, 1 / 0.42), bCBase = Math.max(0, 27.13 * Math.abs(bA) / (400 - Math.abs(bA))), bC = signum(bA) * (100 / viewingConditions.fl) * Math.pow(bCBase, 1 / 0.42), rF = rC / viewingConditions.rgbD[0], gF = gC / viewingConditions.rgbD[1], bF = bC / viewingConditions.rgbD[2], x = 1.86206786 * rF - 1.01125463 * gF + 0.14918677 * bF, y = 0.38752654 * rF + 0.62144744 * gF - 897398e-8 * bF, z = -0.0158415 * rF - 0.03412294 * gF + 1.04996444 * bF;
395
+ return argbFromXyz(x, y, z);
396
+ }
397
+ /// Given color expressed in XYZ and viewed in [viewingConditions], convert to
398
+ /// CAM16.
399
+ static fromXyzInViewingConditions(x, y, z, viewingConditions) {
400
+ const rC = 0.401288 * x + 0.650173 * y - 0.051461 * z, gC = -0.250268 * x + 1.204414 * y + 0.045854 * z, bC = -2079e-6 * x + 0.048952 * y + 0.953127 * z, rD = viewingConditions.rgbD[0] * rC, gD = viewingConditions.rgbD[1] * gC, bD = viewingConditions.rgbD[2] * bC, rAF = Math.pow(viewingConditions.fl * Math.abs(rD) / 100, 0.42), gAF = Math.pow(viewingConditions.fl * Math.abs(gD) / 100, 0.42), bAF = Math.pow(viewingConditions.fl * Math.abs(bD) / 100, 0.42), rA = signum(rD) * 400 * rAF / (rAF + 27.13), gA = signum(gD) * 400 * gAF / (gAF + 27.13), bA = signum(bD) * 400 * bAF / (bAF + 27.13), a = (11 * rA + -12 * gA + bA) / 11, b = (rA + gA - 2 * bA) / 9, u = (20 * rA + 20 * gA + 21 * bA) / 20, p2 = (40 * rA + 20 * gA + bA) / 20, atanDegrees = Math.atan2(b, a) * 180 / Math.PI, hue = atanDegrees < 0 ? atanDegrees + 360 : atanDegrees >= 360 ? atanDegrees - 360 : atanDegrees, hueRadians = hue * Math.PI / 180, ac = p2 * viewingConditions.nbb, J = 100 * Math.pow(ac / viewingConditions.aw, viewingConditions.c * viewingConditions.z), Q = 4 / viewingConditions.c * Math.sqrt(J / 100) * (viewingConditions.aw + 4) * viewingConditions.fLRoot, huePrime = hue < 20.14 ? hue + 360 : hue, eHue = 1 / 4 * (Math.cos(huePrime * Math.PI / 180 + 2) + 3.8), t = 5e4 / 13 * eHue * viewingConditions.nc * viewingConditions.ncb * Math.sqrt(a * a + b * b) / (u + 0.305), alpha = Math.pow(t, 0.9) * Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73), C = alpha * Math.sqrt(J / 100), M = C * viewingConditions.fLRoot, s = 50 * Math.sqrt(alpha * viewingConditions.c / (viewingConditions.aw + 4)), jstar = (1 + 100 * 7e-3) * J / (1 + 7e-3 * J), mstar = Math.log(1 + 0.0228 * M) / 0.0228, astar = mstar * Math.cos(hueRadians), bstar = mstar * Math.sin(hueRadians);
401
+ return new Cam16(hue, C, J, Q, M, s, jstar, astar, bstar);
402
+ }
403
+ /// XYZ representation of CAM16 seen in [viewingConditions].
404
+ xyzInViewingConditions(viewingConditions) {
405
+ const alpha = this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100), t = Math.pow(alpha / Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73), 1 / 0.9), hRad = this.hue * Math.PI / 180, eHue = 0.25 * (Math.cos(hRad + 2) + 3.8), ac = viewingConditions.aw * Math.pow(this.j / 100, 1 / viewingConditions.c / viewingConditions.z), p1 = eHue * (5e4 / 13) * viewingConditions.nc * viewingConditions.ncb, p2 = ac / viewingConditions.nbb, hSin = Math.sin(hRad), hCos = Math.cos(hRad), gamma = 23 * (p2 + 0.305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin), a = gamma * hCos, b = gamma * hSin, rA = (460 * p2 + 451 * a + 288 * b) / 1403, gA = (460 * p2 - 891 * a - 261 * b) / 1403, bA = (460 * p2 - 220 * a - 6300 * b) / 1403, rCBase = Math.max(0, 27.13 * Math.abs(rA) / (400 - Math.abs(rA))), rC = signum(rA) * (100 / viewingConditions.fl) * Math.pow(rCBase, 1 / 0.42), gCBase = Math.max(0, 27.13 * Math.abs(gA) / (400 - Math.abs(gA))), gC = signum(gA) * (100 / viewingConditions.fl) * Math.pow(gCBase, 1 / 0.42), bCBase = Math.max(0, 27.13 * Math.abs(bA) / (400 - Math.abs(bA))), bC = signum(bA) * (100 / viewingConditions.fl) * Math.pow(bCBase, 1 / 0.42), rF = rC / viewingConditions.rgbD[0], gF = gC / viewingConditions.rgbD[1], bF = bC / viewingConditions.rgbD[2], x = 1.86206786 * rF - 1.01125463 * gF + 0.14918677 * bF, y = 0.38752654 * rF + 0.62144744 * gF - 897398e-8 * bF, z = -0.0158415 * rF - 0.03412294 * gF + 1.04996444 * bF;
406
+ return [x, y, z];
407
+ }
408
+ }
409
+ /**
410
+ * @license
411
+ * Copyright 2021 Google LLC
412
+ *
413
+ * Licensed under the Apache License, Version 2.0 (the "License");
414
+ * you may not use this file except in compliance with the License.
415
+ * You may obtain a copy of the License at
416
+ *
417
+ * http://www.apache.org/licenses/LICENSE-2.0
418
+ *
419
+ * Unless required by applicable law or agreed to in writing, software
420
+ * distributed under the License is distributed on an "AS IS" BASIS,
421
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
422
+ * See the License for the specific language governing permissions and
423
+ * limitations under the License.
424
+ */
425
+ class HctSolver {
426
+ /**
427
+ * Sanitizes a small enough angle in radians.
428
+ *
429
+ * @param angle An angle in radians; must not deviate too much
430
+ * from 0.
431
+ * @return A coterminal angle between 0 and 2pi.
432
+ */
433
+ static sanitizeRadians(angle) {
434
+ return (angle + Math.PI * 8) % (Math.PI * 2);
435
+ }
436
+ /**
437
+ * Delinearizes an RGB component, returning a floating-point
438
+ * number.
439
+ *
440
+ * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
441
+ * linear R/G/B channel
442
+ * @return 0.0 <= output <= 255.0, color channel converted to
443
+ * regular RGB space
444
+ */
445
+ static trueDelinearized(rgbComponent) {
446
+ const normalized = rgbComponent / 100;
447
+ let delinearized2 = 0;
448
+ return normalized <= 31308e-7 ? delinearized2 = normalized * 12.92 : delinearized2 = 1.055 * Math.pow(normalized, 1 / 2.4) - 0.055, delinearized2 * 255;
449
+ }
450
+ static chromaticAdaptation(component) {
451
+ const af = Math.pow(Math.abs(component), 0.42);
452
+ return signum(component) * 400 * af / (af + 27.13);
453
+ }
454
+ /**
455
+ * Returns the hue of a linear RGB color in CAM16.
456
+ *
457
+ * @param linrgb The linear RGB coordinates of a color.
458
+ * @return The hue of the color in CAM16, in radians.
459
+ */
460
+ static hueOf(linrgb) {
461
+ const scaledDiscount = matrixMultiply(linrgb, HctSolver.SCALED_DISCOUNT_FROM_LINRGB), rA = HctSolver.chromaticAdaptation(scaledDiscount[0]), gA = HctSolver.chromaticAdaptation(scaledDiscount[1]), bA = HctSolver.chromaticAdaptation(scaledDiscount[2]), a = (11 * rA + -12 * gA + bA) / 11, b = (rA + gA - 2 * bA) / 9;
462
+ return Math.atan2(b, a);
463
+ }
464
+ static areInCyclicOrder(a, b, c) {
465
+ const deltaAB = HctSolver.sanitizeRadians(b - a), deltaAC = HctSolver.sanitizeRadians(c - a);
466
+ return deltaAB < deltaAC;
467
+ }
468
+ /**
469
+ * Solves the lerp equation.
470
+ *
471
+ * @param source The starting number.
472
+ * @param mid The number in the middle.
473
+ * @param target The ending number.
474
+ * @return A number t such that lerp(source, target, t) = mid.
475
+ */
476
+ static intercept(source, mid, target) {
477
+ return (mid - source) / (target - source);
478
+ }
479
+ static lerpPoint(source, t, target) {
480
+ return [
481
+ source[0] + (target[0] - source[0]) * t,
482
+ source[1] + (target[1] - source[1]) * t,
483
+ source[2] + (target[2] - source[2]) * t
484
+ ];
485
+ }
486
+ /**
487
+ * Intersects a segment with a plane.
488
+ *
489
+ * @param source The coordinates of point A.
490
+ * @param coordinate The R-, G-, or B-coordinate of the plane.
491
+ * @param target The coordinates of point B.
492
+ * @param axis The axis the plane is perpendicular with. (0: R, 1:
493
+ * G, 2: B)
494
+ * @return The intersection point of the segment AB with the plane
495
+ * R=coordinate, G=coordinate, or B=coordinate
496
+ */
497
+ static setCoordinate(source, coordinate, target, axis) {
498
+ const t = HctSolver.intercept(source[axis], coordinate, target[axis]);
499
+ return HctSolver.lerpPoint(source, t, target);
500
+ }
501
+ static isBounded(x) {
502
+ return 0 <= x && x <= 100;
503
+ }
504
+ /**
505
+ * Returns the nth possible vertex of the polygonal intersection.
506
+ *
507
+ * @param y The Y value of the plane.
508
+ * @param n The zero-based index of the point. 0 <= n <= 11.
509
+ * @return The nth possible vertex of the polygonal intersection
510
+ * of the y plane and the RGB cube, in linear RGB coordinates, if
511
+ * it exists. If this possible vertex lies outside of the cube,
512
+ * [-1.0, -1.0, -1.0] is returned.
513
+ */
514
+ static nthVertex(y, n) {
515
+ const kR = HctSolver.Y_FROM_LINRGB[0], kG = HctSolver.Y_FROM_LINRGB[1], kB = HctSolver.Y_FROM_LINRGB[2], coordA = n % 4 <= 1 ? 0 : 100, coordB = n % 2 === 0 ? 0 : 100;
516
+ if (n < 4) {
517
+ const g = coordA, b = coordB, r = (y - g * kG - b * kB) / kR;
518
+ return HctSolver.isBounded(r) ? [r, g, b] : [-1, -1, -1];
519
+ } else if (n < 8) {
520
+ const b = coordA, r = coordB, g = (y - r * kR - b * kB) / kG;
521
+ return HctSolver.isBounded(g) ? [r, g, b] : [-1, -1, -1];
522
+ } else {
523
+ const r = coordA, g = coordB, b = (y - r * kR - g * kG) / kB;
524
+ return HctSolver.isBounded(b) ? [r, g, b] : [-1, -1, -1];
525
+ }
526
+ }
527
+ /**
528
+ * Finds the segment containing the desired color.
529
+ *
530
+ * @param y The Y value of the color.
531
+ * @param targetHue The hue of the color.
532
+ * @return A list of two sets of linear RGB coordinates, each
533
+ * corresponding to an endpoint of the segment containing the
534
+ * desired color.
535
+ */
536
+ static bisectToSegment(y, targetHue) {
537
+ let left = [-1, -1, -1], right = left, leftHue = 0, rightHue = 0, initialized = !1, uncut = !0;
538
+ for (let n = 0; n < 12; n++) {
539
+ const mid = HctSolver.nthVertex(y, n);
540
+ if (mid[0] < 0)
541
+ continue;
542
+ const midHue = HctSolver.hueOf(mid);
543
+ if (!initialized) {
544
+ left = mid, right = mid, leftHue = midHue, rightHue = midHue, initialized = !0;
545
+ continue;
546
+ }
547
+ (uncut || HctSolver.areInCyclicOrder(leftHue, midHue, rightHue)) && (uncut = !1, HctSolver.areInCyclicOrder(leftHue, targetHue, midHue) ? (right = mid, rightHue = midHue) : (left = mid, leftHue = midHue));
548
+ }
549
+ return [left, right];
550
+ }
551
+ static midpoint(a, b) {
552
+ return [
553
+ (a[0] + b[0]) / 2,
554
+ (a[1] + b[1]) / 2,
555
+ (a[2] + b[2]) / 2
556
+ ];
557
+ }
558
+ static criticalPlaneBelow(x) {
559
+ return Math.floor(x - 0.5);
560
+ }
561
+ static criticalPlaneAbove(x) {
562
+ return Math.ceil(x - 0.5);
563
+ }
564
+ /**
565
+ * Finds a color with the given Y and hue on the boundary of the
566
+ * cube.
567
+ *
568
+ * @param y The Y value of the color.
569
+ * @param targetHue The hue of the color.
570
+ * @return The desired color, in linear RGB coordinates.
571
+ */
572
+ static bisectToLimit(y, targetHue) {
573
+ const segment = HctSolver.bisectToSegment(y, targetHue);
574
+ let left = segment[0], leftHue = HctSolver.hueOf(left), right = segment[1];
575
+ for (let axis = 0; axis < 3; axis++)
576
+ if (left[axis] !== right[axis]) {
577
+ let lPlane = -1, rPlane = 255;
578
+ left[axis] < right[axis] ? (lPlane = HctSolver.criticalPlaneBelow(HctSolver.trueDelinearized(left[axis])), rPlane = HctSolver.criticalPlaneAbove(HctSolver.trueDelinearized(right[axis]))) : (lPlane = HctSolver.criticalPlaneAbove(HctSolver.trueDelinearized(left[axis])), rPlane = HctSolver.criticalPlaneBelow(HctSolver.trueDelinearized(right[axis])));
579
+ for (let i = 0; i < 8 && !(Math.abs(rPlane - lPlane) <= 1); i++) {
580
+ const mPlane = Math.floor((lPlane + rPlane) / 2), midPlaneCoordinate = HctSolver.CRITICAL_PLANES[mPlane], mid = HctSolver.setCoordinate(left, midPlaneCoordinate, right, axis), midHue = HctSolver.hueOf(mid);
581
+ HctSolver.areInCyclicOrder(leftHue, targetHue, midHue) ? (right = mid, rPlane = mPlane) : (left = mid, leftHue = midHue, lPlane = mPlane);
582
+ }
583
+ }
584
+ return HctSolver.midpoint(left, right);
585
+ }
586
+ static inverseChromaticAdaptation(adapted) {
587
+ const adaptedAbs = Math.abs(adapted), base = Math.max(0, 27.13 * adaptedAbs / (400 - adaptedAbs));
588
+ return signum(adapted) * Math.pow(base, 1 / 0.42);
589
+ }
590
+ /**
591
+ * Finds a color with the given hue, chroma, and Y.
592
+ *
593
+ * @param hueRadians The desired hue in radians.
594
+ * @param chroma The desired chroma.
595
+ * @param y The desired Y.
596
+ * @return The desired color as a hexadecimal integer, if found; 0
597
+ * otherwise.
598
+ */
599
+ static findResultByJ(hueRadians, chroma, y) {
600
+ let j = Math.sqrt(y) * 11;
601
+ const viewingConditions = ViewingConditions.DEFAULT, tInnerCoeff = 1 / Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73), p1 = 0.25 * (Math.cos(hueRadians + 2) + 3.8) * (5e4 / 13) * viewingConditions.nc * viewingConditions.ncb, hSin = Math.sin(hueRadians), hCos = Math.cos(hueRadians);
602
+ for (let iterationRound = 0; iterationRound < 5; iterationRound++) {
603
+ const jNormalized = j / 100, alpha = chroma === 0 || j === 0 ? 0 : chroma / Math.sqrt(jNormalized), t = Math.pow(alpha * tInnerCoeff, 1 / 0.9), p2 = viewingConditions.aw * Math.pow(jNormalized, 1 / viewingConditions.c / viewingConditions.z) / viewingConditions.nbb, gamma = 23 * (p2 + 0.305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin), a = gamma * hCos, b = gamma * hSin, rA = (460 * p2 + 451 * a + 288 * b) / 1403, gA = (460 * p2 - 891 * a - 261 * b) / 1403, bA = (460 * p2 - 220 * a - 6300 * b) / 1403, rCScaled = HctSolver.inverseChromaticAdaptation(rA), gCScaled = HctSolver.inverseChromaticAdaptation(gA), bCScaled = HctSolver.inverseChromaticAdaptation(bA), linrgb = matrixMultiply([rCScaled, gCScaled, bCScaled], HctSolver.LINRGB_FROM_SCALED_DISCOUNT);
604
+ if (linrgb[0] < 0 || linrgb[1] < 0 || linrgb[2] < 0)
605
+ return 0;
606
+ const kR = HctSolver.Y_FROM_LINRGB[0], kG = HctSolver.Y_FROM_LINRGB[1], kB = HctSolver.Y_FROM_LINRGB[2], fnj = kR * linrgb[0] + kG * linrgb[1] + kB * linrgb[2];
607
+ if (fnj <= 0)
608
+ return 0;
609
+ if (iterationRound === 4 || Math.abs(fnj - y) < 2e-3)
610
+ return linrgb[0] > 100.01 || linrgb[1] > 100.01 || linrgb[2] > 100.01 ? 0 : argbFromLinrgb(linrgb);
611
+ j = j - (fnj - y) * j / (2 * fnj);
612
+ }
613
+ return 0;
614
+ }
615
+ /**
616
+ * Finds an sRGB color with the given hue, chroma, and L*, if
617
+ * possible.
618
+ *
619
+ * @param hueDegrees The desired hue, in degrees.
620
+ * @param chroma The desired chroma.
621
+ * @param lstar The desired L*.
622
+ * @return A hexadecimal representing the sRGB color. The color
623
+ * has sufficiently close hue, chroma, and L* to the desired
624
+ * values, if possible; otherwise, the hue and L* will be
625
+ * sufficiently close, and chroma will be maximized.
626
+ */
627
+ static solveToInt(hueDegrees, chroma, lstar) {
628
+ if (chroma < 1e-4 || lstar < 1e-4 || lstar > 99.9999)
629
+ return argbFromLstar(lstar);
630
+ hueDegrees = sanitizeDegreesDouble(hueDegrees);
631
+ const hueRadians = hueDegrees / 180 * Math.PI, y = yFromLstar(lstar), exactAnswer = HctSolver.findResultByJ(hueRadians, chroma, y);
632
+ if (exactAnswer !== 0)
633
+ return exactAnswer;
634
+ const linrgb = HctSolver.bisectToLimit(y, hueRadians);
635
+ return argbFromLinrgb(linrgb);
636
+ }
637
+ /**
638
+ * Finds an sRGB color with the given hue, chroma, and L*, if
639
+ * possible.
640
+ *
641
+ * @param hueDegrees The desired hue, in degrees.
642
+ * @param chroma The desired chroma.
643
+ * @param lstar The desired L*.
644
+ * @return An CAM16 object representing the sRGB color. The color
645
+ * has sufficiently close hue, chroma, and L* to the desired
646
+ * values, if possible; otherwise, the hue and L* will be
647
+ * sufficiently close, and chroma will be maximized.
648
+ */
649
+ static solveToCam(hueDegrees, chroma, lstar) {
650
+ return Cam16.fromInt(HctSolver.solveToInt(hueDegrees, chroma, lstar));
651
+ }
652
+ }
653
+ HctSolver.SCALED_DISCOUNT_FROM_LINRGB = [
654
+ [
655
+ 0.001200833568784504,
656
+ 0.002389694492170889,
657
+ 2795742885861124e-19
658
+ ],
659
+ [
660
+ 5891086651375999e-19,
661
+ 0.0029785502573438758,
662
+ 3270666104008398e-19
663
+ ],
664
+ [
665
+ 10146692491640572e-20,
666
+ 5364214359186694e-19,
667
+ 0.0032979401770712076
668
+ ]
669
+ ];
670
+ HctSolver.LINRGB_FROM_SCALED_DISCOUNT = [
671
+ [
672
+ 1373.2198709594231,
673
+ -1100.4251190754821,
674
+ -7.278681089101213
675
+ ],
676
+ [
677
+ -271.815969077903,
678
+ 559.6580465940733,
679
+ -32.46047482791194
680
+ ],
681
+ [
682
+ 1.9622899599665666,
683
+ -57.173814538844006,
684
+ 308.7233197812385
685
+ ]
686
+ ];
687
+ HctSolver.Y_FROM_LINRGB = [0.2126, 0.7152, 0.0722];
688
+ HctSolver.CRITICAL_PLANES = [
689
+ 0.015176349177441876,
690
+ 0.045529047532325624,
691
+ 0.07588174588720938,
692
+ 0.10623444424209313,
693
+ 0.13658714259697685,
694
+ 0.16693984095186062,
695
+ 0.19729253930674434,
696
+ 0.2276452376616281,
697
+ 0.2579979360165119,
698
+ 0.28835063437139563,
699
+ 0.3188300904430532,
700
+ 0.350925934958123,
701
+ 0.3848314933096426,
702
+ 0.42057480301049466,
703
+ 0.458183274052838,
704
+ 0.4976837250274023,
705
+ 0.5391024159806381,
706
+ 0.5824650784040898,
707
+ 0.6277969426914107,
708
+ 0.6751227633498623,
709
+ 0.7244668422128921,
710
+ 0.775853049866786,
711
+ 0.829304845476233,
712
+ 0.8848452951698498,
713
+ 0.942497089126609,
714
+ 1.0022825574869039,
715
+ 1.0642236851973577,
716
+ 1.1283421258858297,
717
+ 1.1946592148522128,
718
+ 1.2631959812511864,
719
+ 1.3339731595349034,
720
+ 1.407011200216447,
721
+ 1.4823302800086415,
722
+ 1.5599503113873272,
723
+ 1.6398909516233677,
724
+ 1.7221716113234105,
725
+ 1.8068114625156377,
726
+ 1.8938294463134073,
727
+ 1.9832442801866852,
728
+ 2.075074464868551,
729
+ 2.1693382909216234,
730
+ 2.2660538449872063,
731
+ 2.36523901573795,
732
+ 2.4669114995532007,
733
+ 2.5710888059345764,
734
+ 2.6777882626779785,
735
+ 2.7870270208169257,
736
+ 2.898822059350997,
737
+ 3.0131901897720907,
738
+ 3.1301480604002863,
739
+ 3.2497121605402226,
740
+ 3.3718988244681087,
741
+ 3.4967242352587946,
742
+ 3.624204428461639,
743
+ 3.754355295633311,
744
+ 3.887192587735158,
745
+ 4.022731918402185,
746
+ 4.160988767090289,
747
+ 4.301978482107941,
748
+ 4.445716283538092,
749
+ 4.592217266055746,
750
+ 4.741496401646282,
751
+ 4.893568542229298,
752
+ 5.048448422192488,
753
+ 5.20615066083972,
754
+ 5.3666897647573375,
755
+ 5.5300801301023865,
756
+ 5.696336044816294,
757
+ 5.865471690767354,
758
+ 6.037501145825082,
759
+ 6.212438385869475,
760
+ 6.390297286737924,
761
+ 6.571091626112461,
762
+ 6.7548350853498045,
763
+ 6.941541251256611,
764
+ 7.131223617812143,
765
+ 7.323895587840543,
766
+ 7.5195704746346665,
767
+ 7.7182615035334345,
768
+ 7.919981813454504,
769
+ 8.124744458384042,
770
+ 8.332562408825165,
771
+ 8.543448553206703,
772
+ 8.757415699253682,
773
+ 8.974476575321063,
774
+ 9.194643831691977,
775
+ 9.417930041841839,
776
+ 9.644347703669503,
777
+ 9.873909240696694,
778
+ 10.106627003236781,
779
+ 10.342513269534024,
780
+ 10.58158024687427,
781
+ 10.8238400726681,
782
+ 11.069304815507364,
783
+ 11.317986476196008,
784
+ 11.569896988756009,
785
+ 11.825048221409341,
786
+ 12.083451977536606,
787
+ 12.345119996613247,
788
+ 12.610063955123938,
789
+ 12.878295467455942,
790
+ 13.149826086772048,
791
+ 13.42466730586372,
792
+ 13.702830557985108,
793
+ 13.984327217668513,
794
+ 14.269168601521828,
795
+ 14.55736596900856,
796
+ 14.848930523210871,
797
+ 15.143873411576273,
798
+ 15.44220572664832,
799
+ 15.743938506781891,
800
+ 16.04908273684337,
801
+ 16.35764934889634,
802
+ 16.66964922287304,
803
+ 16.985093187232053,
804
+ 17.30399201960269,
805
+ 17.62635644741625,
806
+ 17.95219714852476,
807
+ 18.281524751807332,
808
+ 18.614349837764564,
809
+ 18.95068293910138,
810
+ 19.290534541298456,
811
+ 19.633915083172692,
812
+ 19.98083495742689,
813
+ 20.331304511189067,
814
+ 20.685334046541502,
815
+ 21.042933821039977,
816
+ 21.404114048223256,
817
+ 21.76888489811322,
818
+ 22.137256497705877,
819
+ 22.50923893145328,
820
+ 22.884842241736916,
821
+ 23.264076429332462,
822
+ 23.6469514538663,
823
+ 24.033477234264016,
824
+ 24.42366364919083,
825
+ 24.817520537484558,
826
+ 25.21505769858089,
827
+ 25.61628489293138,
828
+ 26.021211842414342,
829
+ 26.429848230738664,
830
+ 26.842203703840827,
831
+ 27.258287870275353,
832
+ 27.678110301598522,
833
+ 28.10168053274597,
834
+ 28.529008062403893,
835
+ 28.96010235337422,
836
+ 29.39497283293396,
837
+ 29.83362889318845,
838
+ 30.276079891419332,
839
+ 30.722335150426627,
840
+ 31.172403958865512,
841
+ 31.62629557157785,
842
+ 32.08401920991837,
843
+ 32.54558406207592,
844
+ 33.010999283389665,
845
+ 33.4802739966603,
846
+ 33.953417292456834,
847
+ 34.430438229418264,
848
+ 34.911345834551085,
849
+ 35.39614910352207,
850
+ 35.88485700094671,
851
+ 36.37747846067349,
852
+ 36.87402238606382,
853
+ 37.37449765026789,
854
+ 37.87891309649659,
855
+ 38.38727753828926,
856
+ 38.89959975977785,
857
+ 39.41588851594697,
858
+ 39.93615253289054,
859
+ 40.460400508064545,
860
+ 40.98864111053629,
861
+ 41.520882981230194,
862
+ 42.05713473317016,
863
+ 42.597404951718396,
864
+ 43.141702194811224,
865
+ 43.6900349931913,
866
+ 44.24241185063697,
867
+ 44.798841244188324,
868
+ 45.35933162437017,
869
+ 45.92389141541209,
870
+ 46.49252901546552,
871
+ 47.065252796817916,
872
+ 47.64207110610409,
873
+ 48.22299226451468,
874
+ 48.808024568002054,
875
+ 49.3971762874833,
876
+ 49.9904556690408,
877
+ 50.587870934119984,
878
+ 51.189430279724725,
879
+ 51.79514187861014,
880
+ 52.40501387947288,
881
+ 53.0190544071392,
882
+ 53.637271562750364,
883
+ 54.259673423945976,
884
+ 54.88626804504493,
885
+ 55.517063457223934,
886
+ 56.15206766869424,
887
+ 56.79128866487574,
888
+ 57.43473440856916,
889
+ 58.08241284012621,
890
+ 58.734331877617365,
891
+ 59.39049941699807,
892
+ 60.05092333227251,
893
+ 60.715611475655585,
894
+ 61.38457167773311,
895
+ 62.057811747619894,
896
+ 62.7353394731159,
897
+ 63.417162620860914,
898
+ 64.10328893648692,
899
+ 64.79372614476921,
900
+ 65.48848194977529,
901
+ 66.18756403501224,
902
+ 66.89098006357258,
903
+ 67.59873767827808,
904
+ 68.31084450182222,
905
+ 69.02730813691093,
906
+ 69.74813616640164,
907
+ 70.47333615344107,
908
+ 71.20291564160104,
909
+ 71.93688215501312,
910
+ 72.67524319850172,
911
+ 73.41800625771542,
912
+ 74.16517879925733,
913
+ 74.9167682708136,
914
+ 75.67278210128072,
915
+ 76.43322770089146,
916
+ 77.1981124613393,
917
+ 77.96744375590167,
918
+ 78.74122893956174,
919
+ 79.51947534912904,
920
+ 80.30219030335869,
921
+ 81.08938110306934,
922
+ 81.88105503125999,
923
+ 82.67721935322541,
924
+ 83.4778813166706,
925
+ 84.28304815182372,
926
+ 85.09272707154808,
927
+ 85.90692527145302,
928
+ 86.72564993000343,
929
+ 87.54890820862819,
930
+ 88.3767072518277,
931
+ 89.2090541872801,
932
+ 90.04595612594655,
933
+ 90.88742016217518,
934
+ 91.73345337380438,
935
+ 92.58406282226491,
936
+ 93.43925555268066,
937
+ 94.29903859396902,
938
+ 95.16341895893969,
939
+ 96.03240364439274,
940
+ 96.9059996312159,
941
+ 97.78421388448044,
942
+ 98.6670533535366,
943
+ 99.55452497210776
944
+ ];
945
+ /**
946
+ * @license
947
+ * Copyright 2021 Google LLC
948
+ *
949
+ * Licensed under the Apache License, Version 2.0 (the "License");
950
+ * you may not use this file except in compliance with the License.
951
+ * You may obtain a copy of the License at
952
+ *
953
+ * http://www.apache.org/licenses/LICENSE-2.0
954
+ *
955
+ * Unless required by applicable law or agreed to in writing, software
956
+ * distributed under the License is distributed on an "AS IS" BASIS,
957
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
958
+ * See the License for the specific language governing permissions and
959
+ * limitations under the License.
960
+ */
961
+ class Hct {
962
+ static from(hue, chroma, tone) {
963
+ return new Hct(HctSolver.solveToInt(hue, chroma, tone));
964
+ }
965
+ /**
966
+ * @param argb ARGB representation of a color.
967
+ * @return HCT representation of a color in default viewing conditions
968
+ */
969
+ static fromInt(argb) {
970
+ return new Hct(argb);
971
+ }
972
+ toInt() {
973
+ return this.argb;
974
+ }
975
+ /**
976
+ * A number, in degrees, representing ex. red, orange, yellow, etc.
977
+ * Ranges from 0 <= hue < 360.
978
+ */
979
+ get hue() {
980
+ return this.internalHue;
981
+ }
982
+ /**
983
+ * @param newHue 0 <= newHue < 360; invalid values are corrected.
984
+ * Chroma may decrease because chroma has a different maximum for any given
985
+ * hue and tone.
986
+ */
987
+ set hue(newHue) {
988
+ this.setInternalState(HctSolver.solveToInt(newHue, this.internalChroma, this.internalTone));
989
+ }
990
+ get chroma() {
991
+ return this.internalChroma;
992
+ }
993
+ /**
994
+ * @param newChroma 0 <= newChroma < ?
995
+ * Chroma may decrease because chroma has a different maximum for any given
996
+ * hue and tone.
997
+ */
998
+ set chroma(newChroma) {
999
+ this.setInternalState(HctSolver.solveToInt(this.internalHue, newChroma, this.internalTone));
1000
+ }
1001
+ /** Lightness. Ranges from 0 to 100. */
1002
+ get tone() {
1003
+ return this.internalTone;
1004
+ }
1005
+ /**
1006
+ * @param newTone 0 <= newTone <= 100; invalid valids are corrected.
1007
+ * Chroma may decrease because chroma has a different maximum for any given
1008
+ * hue and tone.
1009
+ */
1010
+ set tone(newTone) {
1011
+ this.setInternalState(HctSolver.solveToInt(this.internalHue, this.internalChroma, newTone));
1012
+ }
1013
+ /** Sets a property of the Hct object. */
1014
+ setValue(propertyName, value) {
1015
+ this[propertyName] = value;
1016
+ }
1017
+ toString() {
1018
+ return `HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`;
1019
+ }
1020
+ static isBlue(hue) {
1021
+ return hue >= 250 && hue < 270;
1022
+ }
1023
+ static isYellow(hue) {
1024
+ return hue >= 105 && hue < 125;
1025
+ }
1026
+ static isCyan(hue) {
1027
+ return hue >= 170 && hue < 207;
1028
+ }
1029
+ constructor(argb) {
1030
+ this.argb = argb;
1031
+ const cam = Cam16.fromInt(argb);
1032
+ this.internalHue = cam.hue, this.internalChroma = cam.chroma, this.internalTone = lstarFromArgb(argb), this.argb = argb;
1033
+ }
1034
+ setInternalState(argb) {
1035
+ const cam = Cam16.fromInt(argb);
1036
+ this.internalHue = cam.hue, this.internalChroma = cam.chroma, this.internalTone = lstarFromArgb(argb), this.argb = argb;
1037
+ }
1038
+ /**
1039
+ * Translates a color into different [ViewingConditions].
1040
+ *
1041
+ * Colors change appearance. They look different with lights on versus off,
1042
+ * the same color, as in hex code, on white looks different when on black.
1043
+ * This is called color relativity, most famously explicated by Josef Albers
1044
+ * in Interaction of Color.
1045
+ *
1046
+ * In color science, color appearance models can account for this and
1047
+ * calculate the appearance of a color in different settings. HCT is based on
1048
+ * CAM16, a color appearance model, and uses it to make these calculations.
1049
+ *
1050
+ * See [ViewingConditions.make] for parameters affecting color appearance.
1051
+ */
1052
+ inViewingConditions(vc) {
1053
+ const viewedInVc = Cam16.fromInt(this.toInt()).xyzInViewingConditions(vc), recastInVc = Cam16.fromXyzInViewingConditions(viewedInVc[0], viewedInVc[1], viewedInVc[2], ViewingConditions.make());
1054
+ return Hct.from(recastInVc.hue, recastInVc.chroma, lstarFromY(viewedInVc[1]));
1055
+ }
1056
+ }
1057
+ /**
1058
+ * @license
1059
+ * Copyright 2021 Google LLC
1060
+ *
1061
+ * Licensed under the Apache License, Version 2.0 (the "License");
1062
+ * you may not use this file except in compliance with the License.
1063
+ * You may obtain a copy of the License at
1064
+ *
1065
+ * http://www.apache.org/licenses/LICENSE-2.0
1066
+ *
1067
+ * Unless required by applicable law or agreed to in writing, software
1068
+ * distributed under the License is distributed on an "AS IS" BASIS,
1069
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1070
+ * See the License for the specific language governing permissions and
1071
+ * limitations under the License.
1072
+ */
1073
+ class Blend {
1074
+ /**
1075
+ * Blend the design color's HCT hue towards the key color's HCT
1076
+ * hue, in a way that leaves the original color recognizable and
1077
+ * recognizably shifted towards the key color.
1078
+ *
1079
+ * @param designColor ARGB representation of an arbitrary color.
1080
+ * @param sourceColor ARGB representation of the main theme color.
1081
+ * @return The design color with a hue shifted towards the
1082
+ * system's color, a slightly warmer/cooler variant of the design
1083
+ * color's hue.
1084
+ */
1085
+ static harmonize(designColor, sourceColor) {
1086
+ const fromHct = Hct.fromInt(designColor), toHct = Hct.fromInt(sourceColor), differenceDegrees$1 = differenceDegrees(fromHct.hue, toHct.hue), rotationDegrees = Math.min(differenceDegrees$1 * 0.5, 15), outputHue = sanitizeDegreesDouble(fromHct.hue + rotationDegrees * rotationDirection(fromHct.hue, toHct.hue));
1087
+ return Hct.from(outputHue, fromHct.chroma, fromHct.tone).toInt();
1088
+ }
1089
+ /**
1090
+ * Blends hue from one color into another. The chroma and tone of
1091
+ * the original color are maintained.
1092
+ *
1093
+ * @param from ARGB representation of color
1094
+ * @param to ARGB representation of color
1095
+ * @param amount how much blending to perform; 0.0 >= and <= 1.0
1096
+ * @return from, with a hue blended towards to. Chroma and tone
1097
+ * are constant.
1098
+ */
1099
+ static hctHue(from, to, amount) {
1100
+ const ucs = Blend.cam16Ucs(from, to, amount), ucsCam = Cam16.fromInt(ucs), fromCam = Cam16.fromInt(from);
1101
+ return Hct.from(ucsCam.hue, fromCam.chroma, lstarFromArgb(from)).toInt();
1102
+ }
1103
+ /**
1104
+ * Blend in CAM16-UCS space.
1105
+ *
1106
+ * @param from ARGB representation of color
1107
+ * @param to ARGB representation of color
1108
+ * @param amount how much blending to perform; 0.0 >= and <= 1.0
1109
+ * @return from, blended towards to. Hue, chroma, and tone will
1110
+ * change.
1111
+ */
1112
+ static cam16Ucs(from, to, amount) {
1113
+ const fromCam = Cam16.fromInt(from), toCam = Cam16.fromInt(to), fromJ = fromCam.jstar, fromA = fromCam.astar, fromB = fromCam.bstar, toJ = toCam.jstar, toA = toCam.astar, toB = toCam.bstar, jstar = fromJ + (toJ - fromJ) * amount, astar = fromA + (toA - fromA) * amount, bstar = fromB + (toB - fromB) * amount;
1114
+ return Cam16.fromUcs(jstar, astar, bstar).toInt();
1115
+ }
1116
+ }
1117
+ /**
1118
+ * @license
1119
+ * Copyright 2022 Google LLC
1120
+ *
1121
+ * Licensed under the Apache License, Version 2.0 (the "License");
1122
+ * you may not use this file except in compliance with the License.
1123
+ * You may obtain a copy of the License at
1124
+ *
1125
+ * http://www.apache.org/licenses/LICENSE-2.0
1126
+ *
1127
+ * Unless required by applicable law or agreed to in writing, software
1128
+ * distributed under the License is distributed on an "AS IS" BASIS,
1129
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1130
+ * See the License for the specific language governing permissions and
1131
+ * limitations under the License.
1132
+ */
1133
+ class Contrast {
1134
+ /**
1135
+ * Returns a contrast ratio, which ranges from 1 to 21.
1136
+ *
1137
+ * @param toneA Tone between 0 and 100. Values outside will be clamped.
1138
+ * @param toneB Tone between 0 and 100. Values outside will be clamped.
1139
+ */
1140
+ static ratioOfTones(toneA, toneB) {
1141
+ return toneA = clampDouble(0, 100, toneA), toneB = clampDouble(0, 100, toneB), Contrast.ratioOfYs(yFromLstar(toneA), yFromLstar(toneB));
1142
+ }
1143
+ static ratioOfYs(y1, y2) {
1144
+ const lighter = y1 > y2 ? y1 : y2, darker = lighter === y2 ? y1 : y2;
1145
+ return (lighter + 5) / (darker + 5);
1146
+ }
1147
+ /**
1148
+ * Returns a tone >= tone parameter that ensures ratio parameter.
1149
+ * Return value is between 0 and 100.
1150
+ * Returns -1 if ratio cannot be achieved with tone parameter.
1151
+ *
1152
+ * @param tone Tone return value must contrast with.
1153
+ * Range is 0 to 100. Invalid values will result in -1 being returned.
1154
+ * @param ratio Contrast ratio of return value and tone.
1155
+ * Range is 1 to 21, invalid values have undefined behavior.
1156
+ */
1157
+ static lighter(tone, ratio) {
1158
+ if (tone < 0 || tone > 100)
1159
+ return -1;
1160
+ const darkY = yFromLstar(tone), lightY = ratio * (darkY + 5) - 5, realContrast = Contrast.ratioOfYs(lightY, darkY), delta = Math.abs(realContrast - ratio);
1161
+ if (realContrast < ratio && delta > 0.04)
1162
+ return -1;
1163
+ const returnValue = lstarFromY(lightY) + 0.4;
1164
+ return returnValue < 0 || returnValue > 100 ? -1 : returnValue;
1165
+ }
1166
+ /**
1167
+ * Returns a tone <= tone parameter that ensures ratio parameter.
1168
+ * Return value is between 0 and 100.
1169
+ * Returns -1 if ratio cannot be achieved with tone parameter.
1170
+ *
1171
+ * @param tone Tone return value must contrast with.
1172
+ * Range is 0 to 100. Invalid values will result in -1 being returned.
1173
+ * @param ratio Contrast ratio of return value and tone.
1174
+ * Range is 1 to 21, invalid values have undefined behavior.
1175
+ */
1176
+ static darker(tone, ratio) {
1177
+ if (tone < 0 || tone > 100)
1178
+ return -1;
1179
+ const lightY = yFromLstar(tone), darkY = (lightY + 5) / ratio - 5, realContrast = Contrast.ratioOfYs(lightY, darkY), delta = Math.abs(realContrast - ratio);
1180
+ if (realContrast < ratio && delta > 0.04)
1181
+ return -1;
1182
+ const returnValue = lstarFromY(darkY) - 0.4;
1183
+ return returnValue < 0 || returnValue > 100 ? -1 : returnValue;
1184
+ }
1185
+ /**
1186
+ * Returns a tone >= tone parameter that ensures ratio parameter.
1187
+ * Return value is between 0 and 100.
1188
+ * Returns 100 if ratio cannot be achieved with tone parameter.
1189
+ *
1190
+ * This method is unsafe because the returned value is guaranteed to be in
1191
+ * bounds for tone, i.e. between 0 and 100. However, that value may not reach
1192
+ * the ratio with tone. For example, there is no color lighter than T100.
1193
+ *
1194
+ * @param tone Tone return value must contrast with.
1195
+ * Range is 0 to 100. Invalid values will result in 100 being returned.
1196
+ * @param ratio Desired contrast ratio of return value and tone parameter.
1197
+ * Range is 1 to 21, invalid values have undefined behavior.
1198
+ */
1199
+ static lighterUnsafe(tone, ratio) {
1200
+ const lighterSafe = Contrast.lighter(tone, ratio);
1201
+ return lighterSafe < 0 ? 100 : lighterSafe;
1202
+ }
1203
+ /**
1204
+ * Returns a tone >= tone parameter that ensures ratio parameter.
1205
+ * Return value is between 0 and 100.
1206
+ * Returns 100 if ratio cannot be achieved with tone parameter.
1207
+ *
1208
+ * This method is unsafe because the returned value is guaranteed to be in
1209
+ * bounds for tone, i.e. between 0 and 100. However, that value may not reach
1210
+ * the [ratio with [tone]. For example, there is no color darker than T0.
1211
+ *
1212
+ * @param tone Tone return value must contrast with.
1213
+ * Range is 0 to 100. Invalid values will result in 0 being returned.
1214
+ * @param ratio Desired contrast ratio of return value and tone parameter.
1215
+ * Range is 1 to 21, invalid values have undefined behavior.
1216
+ */
1217
+ static darkerUnsafe(tone, ratio) {
1218
+ const darkerSafe = Contrast.darker(tone, ratio);
1219
+ return darkerSafe < 0 ? 0 : darkerSafe;
1220
+ }
1221
+ }
1222
+ /**
1223
+ * @license
1224
+ * Copyright 2023 Google LLC
1225
+ *
1226
+ * Licensed under the Apache License, Version 2.0 (the "License");
1227
+ * you may not use this file except in compliance with the License.
1228
+ * You may obtain a copy of the License at
1229
+ *
1230
+ * http://www.apache.org/licenses/LICENSE-2.0
1231
+ *
1232
+ * Unless required by applicable law or agreed to in writing, software
1233
+ * distributed under the License is distributed on an "AS IS" BASIS,
1234
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1235
+ * See the License for the specific language governing permissions and
1236
+ * limitations under the License.
1237
+ */
1238
+ class DislikeAnalyzer {
1239
+ /**
1240
+ * Returns true if a color is disliked.
1241
+ *
1242
+ * @param hct A color to be judged.
1243
+ * @return Whether the color is disliked.
1244
+ *
1245
+ * Disliked is defined as a dark yellow-green that is not neutral.
1246
+ */
1247
+ static isDisliked(hct) {
1248
+ const huePasses = Math.round(hct.hue) >= 90 && Math.round(hct.hue) <= 111, chromaPasses = Math.round(hct.chroma) > 16, tonePasses = Math.round(hct.tone) < 65;
1249
+ return huePasses && chromaPasses && tonePasses;
1250
+ }
1251
+ /**
1252
+ * If a color is disliked, lighten it to make it likable.
1253
+ *
1254
+ * @param hct A color to be judged.
1255
+ * @return A new color if the original color is disliked, or the original
1256
+ * color if it is acceptable.
1257
+ */
1258
+ static fixIfDisliked(hct) {
1259
+ return DislikeAnalyzer.isDisliked(hct) ? Hct.from(hct.hue, hct.chroma, 70) : hct;
1260
+ }
1261
+ }
1262
+ /**
1263
+ * @license
1264
+ * Copyright 2022 Google LLC
1265
+ *
1266
+ * Licensed under the Apache License, Version 2.0 (the "License");
1267
+ * you may not use this file except in compliance with the License.
1268
+ * You may obtain a copy of the License at
1269
+ *
1270
+ * http://www.apache.org/licenses/LICENSE-2.0
1271
+ *
1272
+ * Unless required by applicable law or agreed to in writing, software
1273
+ * distributed under the License is distributed on an "AS IS" BASIS,
1274
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1275
+ * See the License for the specific language governing permissions and
1276
+ * limitations under the License.
1277
+ */
1278
+ function validateExtendedColor(originalColor, specVersion, extendedColor) {
1279
+ if (originalColor.name !== extendedColor.name)
1280
+ throw new Error(`Attempting to extend color ${originalColor.name} with color ${extendedColor.name} of different name for spec version ${specVersion}.`);
1281
+ if (originalColor.isBackground !== extendedColor.isBackground)
1282
+ throw new Error(`Attempting to extend color ${originalColor.name} as a ${originalColor.isBackground ? "background" : "foreground"} with color ${extendedColor.name} as a ${extendedColor.isBackground ? "background" : "foreground"} for spec version ${specVersion}.`);
1283
+ }
1284
+ function extendSpecVersion(originlColor, specVersion, extendedColor) {
1285
+ return validateExtendedColor(originlColor, specVersion, extendedColor), DynamicColor.fromPalette({
1286
+ name: originlColor.name,
1287
+ palette: (s) => s.specVersion === specVersion ? extendedColor.palette(s) : originlColor.palette(s),
1288
+ tone: (s) => s.specVersion === specVersion ? extendedColor.tone(s) : originlColor.tone(s),
1289
+ isBackground: originlColor.isBackground,
1290
+ chromaMultiplier: (s) => {
1291
+ const chromaMultiplier = s.specVersion === specVersion ? extendedColor.chromaMultiplier : originlColor.chromaMultiplier;
1292
+ return chromaMultiplier !== void 0 ? chromaMultiplier(s) : 1;
1293
+ },
1294
+ background: (s) => {
1295
+ const background = s.specVersion === specVersion ? extendedColor.background : originlColor.background;
1296
+ return background !== void 0 ? background(s) : void 0;
1297
+ },
1298
+ secondBackground: (s) => {
1299
+ const secondBackground = s.specVersion === specVersion ? extendedColor.secondBackground : originlColor.secondBackground;
1300
+ return secondBackground !== void 0 ? secondBackground(s) : void 0;
1301
+ },
1302
+ contrastCurve: (s) => {
1303
+ const contrastCurve = s.specVersion === specVersion ? extendedColor.contrastCurve : originlColor.contrastCurve;
1304
+ return contrastCurve !== void 0 ? contrastCurve(s) : void 0;
1305
+ },
1306
+ toneDeltaPair: (s) => {
1307
+ const toneDeltaPair = s.specVersion === specVersion ? extendedColor.toneDeltaPair : originlColor.toneDeltaPair;
1308
+ return toneDeltaPair !== void 0 ? toneDeltaPair(s) : void 0;
1309
+ }
1310
+ });
1311
+ }
1312
+ class DynamicColor {
1313
+ /**
1314
+ * Create a DynamicColor defined by a TonalPalette and HCT tone.
1315
+ *
1316
+ * @param args Functions with DynamicScheme as input. Must provide a palette
1317
+ * and tone. May provide a background DynamicColor and ToneDeltaPair.
1318
+ */
1319
+ static fromPalette(args) {
1320
+ return new DynamicColor(args.name ?? "", args.palette, args.tone ?? DynamicColor.getInitialToneFromBackground(args.background), args.isBackground ?? !1, args.chromaMultiplier, args.background, args.secondBackground, args.contrastCurve, args.toneDeltaPair);
1321
+ }
1322
+ static getInitialToneFromBackground(background) {
1323
+ return background === void 0 ? (s) => 50 : (s) => background(s) ? background(s).getTone(s) : 50;
1324
+ }
1325
+ /**
1326
+ * The base constructor for DynamicColor.
1327
+ *
1328
+ * _Strongly_ prefer using one of the convenience constructors. This class is
1329
+ * arguably too flexible to ensure it can support any scenario. Functional
1330
+ * arguments allow overriding without risks that come with subclasses.
1331
+ *
1332
+ * For example, the default behavior of adjust tone at max contrast
1333
+ * to be at a 7.0 ratio with its background is principled and
1334
+ * matches accessibility guidance. That does not mean it's the desired
1335
+ * approach for _every_ design system, and every color pairing,
1336
+ * always, in every case.
1337
+ *
1338
+ * @param name The name of the dynamic color. Defaults to empty.
1339
+ * @param palette Function that provides a TonalPalette given DynamicScheme. A
1340
+ * TonalPalette is defined by a hue and chroma, so this replaces the need
1341
+ * to specify hue/chroma. By providing a tonal palette, when contrast
1342
+ * adjustments are made, intended chroma can be preserved.
1343
+ * @param tone Function that provides a tone, given a DynamicScheme.
1344
+ * @param isBackground Whether this dynamic color is a background, with some
1345
+ * other color as the foreground. Defaults to false.
1346
+ * @param chromaMultiplier A factor that multiplies the chroma for this color.
1347
+ * @param background The background of the dynamic color (as a function of a
1348
+ * `DynamicScheme`), if it exists.
1349
+ * @param secondBackground A second background of the dynamic color (as a
1350
+ * function of a `DynamicScheme`), if it exists.
1351
+ * @param contrastCurve A `ContrastCurve` object specifying how its contrast
1352
+ * against its background should behave in various contrast levels
1353
+ * options.
1354
+ * @param toneDeltaPair A `ToneDeltaPair` object specifying a tone delta
1355
+ * constraint between two colors. One of them must be the color being
1356
+ * constructed.
1357
+ */
1358
+ constructor(name, palette, tone, isBackground, chromaMultiplier, background, secondBackground, contrastCurve, toneDeltaPair) {
1359
+ if (this.name = name, this.palette = palette, this.tone = tone, this.isBackground = isBackground, this.chromaMultiplier = chromaMultiplier, this.background = background, this.secondBackground = secondBackground, this.contrastCurve = contrastCurve, this.toneDeltaPair = toneDeltaPair, this.hctCache = /* @__PURE__ */ new Map(), !background && secondBackground)
1360
+ throw new Error(`Color ${name} has secondBackgrounddefined, but background is not defined.`);
1361
+ if (!background && contrastCurve)
1362
+ throw new Error(`Color ${name} has contrastCurvedefined, but background is not defined.`);
1363
+ if (background && !contrastCurve)
1364
+ throw new Error(`Color ${name} has backgrounddefined, but contrastCurve is not defined.`);
1365
+ }
1366
+ /**
1367
+ * Returns a deep copy of this DynamicColor.
1368
+ */
1369
+ clone() {
1370
+ return DynamicColor.fromPalette({
1371
+ name: this.name,
1372
+ palette: this.palette,
1373
+ tone: this.tone,
1374
+ isBackground: this.isBackground,
1375
+ chromaMultiplier: this.chromaMultiplier,
1376
+ background: this.background,
1377
+ secondBackground: this.secondBackground,
1378
+ contrastCurve: this.contrastCurve,
1379
+ toneDeltaPair: this.toneDeltaPair
1380
+ });
1381
+ }
1382
+ /**
1383
+ * Clears the cache of HCT values for this color. For testing or debugging
1384
+ * purposes.
1385
+ */
1386
+ clearCache() {
1387
+ this.hctCache.clear();
1388
+ }
1389
+ /**
1390
+ * Returns a ARGB integer (i.e. a hex code).
1391
+ *
1392
+ * @param scheme Defines the conditions of the user interface, for example,
1393
+ * whether or not it is dark mode or light mode, and what the desired
1394
+ * contrast level is.
1395
+ */
1396
+ getArgb(scheme) {
1397
+ return this.getHct(scheme).toInt();
1398
+ }
1399
+ /**
1400
+ * Returns a color, expressed in the HCT color space, that this
1401
+ * DynamicColor is under the conditions in scheme.
1402
+ *
1403
+ * @param scheme Defines the conditions of the user interface, for example,
1404
+ * whether or not it is dark mode or light mode, and what the desired
1405
+ * contrast level is.
1406
+ */
1407
+ getHct(scheme) {
1408
+ const cachedAnswer = this.hctCache.get(scheme);
1409
+ if (cachedAnswer != null)
1410
+ return cachedAnswer;
1411
+ const answer = getSpec(scheme.specVersion).getHct(scheme, this);
1412
+ return this.hctCache.size > 4 && this.hctCache.clear(), this.hctCache.set(scheme, answer), answer;
1413
+ }
1414
+ /**
1415
+ * Returns a tone, T in the HCT color space, that this DynamicColor is under
1416
+ * the conditions in scheme.
1417
+ *
1418
+ * @param scheme Defines the conditions of the user interface, for example,
1419
+ * whether or not it is dark mode or light mode, and what the desired
1420
+ * contrast level is.
1421
+ */
1422
+ getTone(scheme) {
1423
+ return getSpec(scheme.specVersion).getTone(scheme, this);
1424
+ }
1425
+ /**
1426
+ * Given a background tone, finds a foreground tone, while ensuring they reach
1427
+ * a contrast ratio that is as close to [ratio] as possible.
1428
+ *
1429
+ * @param bgTone Tone in HCT. Range is 0 to 100, undefined behavior when it
1430
+ * falls outside that range.
1431
+ * @param ratio The contrast ratio desired between bgTone and the return
1432
+ * value.
1433
+ */
1434
+ static foregroundTone(bgTone, ratio) {
1435
+ const lighterTone = Contrast.lighterUnsafe(bgTone, ratio), darkerTone = Contrast.darkerUnsafe(bgTone, ratio), lighterRatio = Contrast.ratioOfTones(lighterTone, bgTone), darkerRatio = Contrast.ratioOfTones(darkerTone, bgTone);
1436
+ if (DynamicColor.tonePrefersLightForeground(bgTone)) {
1437
+ const negligibleDifference = Math.abs(lighterRatio - darkerRatio) < 0.1 && lighterRatio < ratio && darkerRatio < ratio;
1438
+ return lighterRatio >= ratio || lighterRatio >= darkerRatio || negligibleDifference ? lighterTone : darkerTone;
1439
+ } else
1440
+ return darkerRatio >= ratio || darkerRatio >= lighterRatio ? darkerTone : lighterTone;
1441
+ }
1442
+ /**
1443
+ * Returns whether [tone] prefers a light foreground.
1444
+ *
1445
+ * People prefer white foregrounds on ~T60-70. Observed over time, and also
1446
+ * by Andrew Somers during research for APCA.
1447
+ *
1448
+ * T60 used as to create the smallest discontinuity possible when skipping
1449
+ * down to T49 in order to ensure light foregrounds.
1450
+ * Since `tertiaryContainer` in dark monochrome scheme requires a tone of
1451
+ * 60, it should not be adjusted. Therefore, 60 is excluded here.
1452
+ */
1453
+ static tonePrefersLightForeground(tone) {
1454
+ return Math.round(tone) < 60;
1455
+ }
1456
+ /**
1457
+ * Returns whether [tone] can reach a contrast ratio of 4.5 with a lighter
1458
+ * color.
1459
+ */
1460
+ static toneAllowsLightForeground(tone) {
1461
+ return Math.round(tone) <= 49;
1462
+ }
1463
+ /**
1464
+ * Adjusts a tone such that white has 4.5 contrast, if the tone is
1465
+ * reasonably close to supporting it.
1466
+ */
1467
+ static enableLightForeground(tone) {
1468
+ return DynamicColor.tonePrefersLightForeground(tone) && !DynamicColor.toneAllowsLightForeground(tone) ? 49 : tone;
1469
+ }
1470
+ }
1471
+ class ColorCalculationDelegateImpl2021 {
1472
+ getHct(scheme, color) {
1473
+ const tone = color.getTone(scheme);
1474
+ return color.palette(scheme).getHct(tone);
1475
+ }
1476
+ getTone(scheme, color) {
1477
+ const decreasingContrast = scheme.contrastLevel < 0, toneDeltaPair = color.toneDeltaPair ? color.toneDeltaPair(scheme) : void 0;
1478
+ if (toneDeltaPair) {
1479
+ const roleA = toneDeltaPair.roleA, roleB = toneDeltaPair.roleB, delta = toneDeltaPair.delta, polarity = toneDeltaPair.polarity, stayTogether = toneDeltaPair.stayTogether, aIsNearer = polarity === "nearer" || polarity === "lighter" && !scheme.isDark || polarity === "darker" && scheme.isDark, nearer = aIsNearer ? roleA : roleB, farther = aIsNearer ? roleB : roleA, amNearer = color.name === nearer.name, expansionDir = scheme.isDark ? 1 : -1;
1480
+ let nTone = nearer.tone(scheme), fTone = farther.tone(scheme);
1481
+ if (color.background && nearer.contrastCurve && farther.contrastCurve) {
1482
+ const bg = color.background(scheme), nContrastCurve = nearer.contrastCurve(scheme), fContrastCurve = farther.contrastCurve(scheme);
1483
+ if (bg && nContrastCurve && fContrastCurve) {
1484
+ const bgTone = bg.getTone(scheme), nContrast = nContrastCurve.get(scheme.contrastLevel), fContrast = fContrastCurve.get(scheme.contrastLevel);
1485
+ Contrast.ratioOfTones(bgTone, nTone) < nContrast && (nTone = DynamicColor.foregroundTone(bgTone, nContrast)), Contrast.ratioOfTones(bgTone, fTone) < fContrast && (fTone = DynamicColor.foregroundTone(bgTone, fContrast)), decreasingContrast && (nTone = DynamicColor.foregroundTone(bgTone, nContrast), fTone = DynamicColor.foregroundTone(bgTone, fContrast));
1486
+ }
1487
+ }
1488
+ return (fTone - nTone) * expansionDir < delta && (fTone = clampDouble(0, 100, nTone + delta * expansionDir), (fTone - nTone) * expansionDir >= delta || (nTone = clampDouble(0, 100, fTone - delta * expansionDir))), 50 <= nTone && nTone < 60 ? expansionDir > 0 ? (nTone = 60, fTone = Math.max(fTone, nTone + delta * expansionDir)) : (nTone = 49, fTone = Math.min(fTone, nTone + delta * expansionDir)) : 50 <= fTone && fTone < 60 && (stayTogether ? expansionDir > 0 ? (nTone = 60, fTone = Math.max(fTone, nTone + delta * expansionDir)) : (nTone = 49, fTone = Math.min(fTone, nTone + delta * expansionDir)) : expansionDir > 0 ? fTone = 60 : fTone = 49), amNearer ? nTone : fTone;
1489
+ } else {
1490
+ let answer = color.tone(scheme);
1491
+ if (color.background == null || color.background(scheme) === void 0 || color.contrastCurve == null || color.contrastCurve(scheme) === void 0)
1492
+ return answer;
1493
+ const bgTone = color.background(scheme).getTone(scheme), desiredRatio = color.contrastCurve(scheme).get(scheme.contrastLevel);
1494
+ if (Contrast.ratioOfTones(bgTone, answer) >= desiredRatio || (answer = DynamicColor.foregroundTone(bgTone, desiredRatio)), decreasingContrast && (answer = DynamicColor.foregroundTone(bgTone, desiredRatio)), color.isBackground && 50 <= answer && answer < 60 && (Contrast.ratioOfTones(49, bgTone) >= desiredRatio ? answer = 49 : answer = 60), color.secondBackground == null || color.secondBackground(scheme) === void 0)
1495
+ return answer;
1496
+ const [bg1, bg2] = [color.background, color.secondBackground], [bgTone1, bgTone2] = [bg1(scheme).getTone(scheme), bg2(scheme).getTone(scheme)], [upper, lower] = [Math.max(bgTone1, bgTone2), Math.min(bgTone1, bgTone2)];
1497
+ if (Contrast.ratioOfTones(upper, answer) >= desiredRatio && Contrast.ratioOfTones(lower, answer) >= desiredRatio)
1498
+ return answer;
1499
+ const lightOption = Contrast.lighter(upper, desiredRatio), darkOption = Contrast.darker(lower, desiredRatio), availables = [];
1500
+ return lightOption !== -1 && availables.push(lightOption), darkOption !== -1 && availables.push(darkOption), DynamicColor.tonePrefersLightForeground(bgTone1) || DynamicColor.tonePrefersLightForeground(bgTone2) ? lightOption < 0 ? 100 : lightOption : availables.length === 1 ? availables[0] : darkOption < 0 ? 0 : darkOption;
1501
+ }
1502
+ }
1503
+ }
1504
+ class ColorCalculationDelegateImpl2025 {
1505
+ getHct(scheme, color) {
1506
+ const palette = color.palette(scheme), tone = color.getTone(scheme), hue = palette.hue, chroma = palette.chroma * (color.chromaMultiplier ? color.chromaMultiplier(scheme) : 1);
1507
+ return Hct.from(hue, chroma, tone);
1508
+ }
1509
+ getTone(scheme, color) {
1510
+ const toneDeltaPair = color.toneDeltaPair ? color.toneDeltaPair(scheme) : void 0;
1511
+ if (toneDeltaPair) {
1512
+ const roleA = toneDeltaPair.roleA, roleB = toneDeltaPair.roleB, polarity = toneDeltaPair.polarity, constraint = toneDeltaPair.constraint, absoluteDelta = polarity === "darker" || polarity === "relative_lighter" && scheme.isDark || polarity === "relative_darker" && !scheme.isDark ? -toneDeltaPair.delta : toneDeltaPair.delta, amRoleA = color.name === roleA.name, selfRole = amRoleA ? roleA : roleB, refRole = amRoleA ? roleB : roleA;
1513
+ let selfTone = selfRole.tone(scheme), refTone = refRole.getTone(scheme);
1514
+ const relativeDelta = absoluteDelta * (amRoleA ? 1 : -1);
1515
+ if (constraint === "exact" ? selfTone = clampDouble(0, 100, refTone + relativeDelta) : constraint === "nearer" ? relativeDelta > 0 ? selfTone = clampDouble(0, 100, clampDouble(refTone, refTone + relativeDelta, selfTone)) : selfTone = clampDouble(0, 100, clampDouble(refTone + relativeDelta, refTone, selfTone)) : constraint === "farther" && (relativeDelta > 0 ? selfTone = clampDouble(refTone + relativeDelta, 100, selfTone) : selfTone = clampDouble(0, refTone + relativeDelta, selfTone)), color.background && color.contrastCurve) {
1516
+ const background = color.background(scheme), contrastCurve = color.contrastCurve(scheme);
1517
+ if (background && contrastCurve) {
1518
+ const bgTone = background.getTone(scheme), selfContrast = contrastCurve.get(scheme.contrastLevel);
1519
+ selfTone = Contrast.ratioOfTones(bgTone, selfTone) >= selfContrast && scheme.contrastLevel >= 0 ? selfTone : DynamicColor.foregroundTone(bgTone, selfContrast);
1520
+ }
1521
+ }
1522
+ return color.isBackground && !color.name.endsWith("_fixed_dim") && (selfTone >= 57 ? selfTone = clampDouble(65, 100, selfTone) : selfTone = clampDouble(0, 49, selfTone)), selfTone;
1523
+ } else {
1524
+ let answer = color.tone(scheme);
1525
+ if (color.background == null || color.background(scheme) === void 0 || color.contrastCurve == null || color.contrastCurve(scheme) === void 0)
1526
+ return answer;
1527
+ const bgTone = color.background(scheme).getTone(scheme), desiredRatio = color.contrastCurve(scheme).get(scheme.contrastLevel);
1528
+ if (answer = Contrast.ratioOfTones(bgTone, answer) >= desiredRatio && scheme.contrastLevel >= 0 ? answer : DynamicColor.foregroundTone(bgTone, desiredRatio), color.isBackground && !color.name.endsWith("_fixed_dim") && (answer >= 57 ? answer = clampDouble(65, 100, answer) : answer = clampDouble(0, 49, answer)), color.secondBackground == null || color.secondBackground(scheme) === void 0)
1529
+ return answer;
1530
+ const [bg1, bg2] = [color.background, color.secondBackground], [bgTone1, bgTone2] = [bg1(scheme).getTone(scheme), bg2(scheme).getTone(scheme)], [upper, lower] = [Math.max(bgTone1, bgTone2), Math.min(bgTone1, bgTone2)];
1531
+ if (Contrast.ratioOfTones(upper, answer) >= desiredRatio && Contrast.ratioOfTones(lower, answer) >= desiredRatio)
1532
+ return answer;
1533
+ const lightOption = Contrast.lighter(upper, desiredRatio), darkOption = Contrast.darker(lower, desiredRatio), availables = [];
1534
+ return lightOption !== -1 && availables.push(lightOption), darkOption !== -1 && availables.push(darkOption), DynamicColor.tonePrefersLightForeground(bgTone1) || DynamicColor.tonePrefersLightForeground(bgTone2) ? lightOption < 0 ? 100 : lightOption : availables.length === 1 ? availables[0] : darkOption < 0 ? 0 : darkOption;
1535
+ }
1536
+ }
1537
+ }
1538
+ const spec2021 = new ColorCalculationDelegateImpl2021(), spec2025 = new ColorCalculationDelegateImpl2025();
1539
+ function getSpec(specVersion) {
1540
+ return specVersion === "2025" ? spec2025 : spec2021;
1541
+ }
1542
+ /**
1543
+ * @license
1544
+ * Copyright 2021 Google LLC
1545
+ *
1546
+ * Licensed under the Apache License, Version 2.0 (the "License");
1547
+ * you may not use this file except in compliance with the License.
1548
+ * You may obtain a copy of the License at
1549
+ *
1550
+ * http://www.apache.org/licenses/LICENSE-2.0
1551
+ *
1552
+ * Unless required by applicable law or agreed to in writing, software
1553
+ * distributed under the License is distributed on an "AS IS" BASIS,
1554
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1555
+ * See the License for the specific language governing permissions and
1556
+ * limitations under the License.
1557
+ */
1558
+ class TonalPalette {
1559
+ /**
1560
+ * @param argb ARGB representation of a color
1561
+ * @return Tones matching that color's hue and chroma.
1562
+ */
1563
+ static fromInt(argb) {
1564
+ const hct = Hct.fromInt(argb);
1565
+ return TonalPalette.fromHct(hct);
1566
+ }
1567
+ /**
1568
+ * @param hct Hct
1569
+ * @return Tones matching that color's hue and chroma.
1570
+ */
1571
+ static fromHct(hct) {
1572
+ return new TonalPalette(hct.hue, hct.chroma, hct);
1573
+ }
1574
+ /**
1575
+ * @param hue HCT hue
1576
+ * @param chroma HCT chroma
1577
+ * @return Tones matching hue and chroma.
1578
+ */
1579
+ static fromHueAndChroma(hue, chroma) {
1580
+ const keyColor = new KeyColor(hue, chroma).create();
1581
+ return new TonalPalette(hue, chroma, keyColor);
1582
+ }
1583
+ constructor(hue, chroma, keyColor) {
1584
+ this.hue = hue, this.chroma = chroma, this.keyColor = keyColor, this.cache = /* @__PURE__ */ new Map();
1585
+ }
1586
+ /**
1587
+ * @param tone HCT tone, measured from 0 to 100.
1588
+ * @return ARGB representation of a color with that tone.
1589
+ */
1590
+ tone(tone) {
1591
+ let argb = this.cache.get(tone);
1592
+ return argb === void 0 && (tone == 99 && Hct.isYellow(this.hue) ? argb = this.averageArgb(this.tone(98), this.tone(100)) : argb = Hct.from(this.hue, this.chroma, tone).toInt(), this.cache.set(tone, argb)), argb;
1593
+ }
1594
+ /**
1595
+ * @param tone HCT tone.
1596
+ * @return HCT representation of a color with that tone.
1597
+ */
1598
+ getHct(tone) {
1599
+ return Hct.fromInt(this.tone(tone));
1600
+ }
1601
+ averageArgb(argb1, argb2) {
1602
+ const red1 = argb1 >>> 16 & 255, green1 = argb1 >>> 8 & 255, blue1 = argb1 & 255, red2 = argb2 >>> 16 & 255, green2 = argb2 >>> 8 & 255, blue2 = argb2 & 255, red = Math.round((red1 + red2) / 2), green = Math.round((green1 + green2) / 2), blue = Math.round((blue1 + blue2) / 2);
1603
+ return (255 << 24 | (red & 255) << 16 | (green & 255) << 8 | blue & 255) >>> 0;
1604
+ }
1605
+ }
1606
+ class KeyColor {
1607
+ constructor(hue, requestedChroma) {
1608
+ this.hue = hue, this.requestedChroma = requestedChroma, this.chromaCache = /* @__PURE__ */ new Map(), this.maxChromaValue = 200;
1609
+ }
1610
+ /**
1611
+ * Creates a key color from a [hue] and a [chroma].
1612
+ * The key color is the first tone, starting from T50, matching the given hue
1613
+ * and chroma.
1614
+ *
1615
+ * @return Key color [Hct]
1616
+ */
1617
+ create() {
1618
+ let lowerTone = 0, upperTone = 100;
1619
+ for (; lowerTone < upperTone; ) {
1620
+ const midTone = Math.floor((lowerTone + upperTone) / 2), isAscending = this.maxChroma(midTone) < this.maxChroma(midTone + 1);
1621
+ if (this.maxChroma(midTone) >= this.requestedChroma - 0.01)
1622
+ if (Math.abs(lowerTone - 50) < Math.abs(upperTone - 50))
1623
+ upperTone = midTone;
1624
+ else {
1625
+ if (lowerTone === midTone)
1626
+ return Hct.from(this.hue, this.requestedChroma, lowerTone);
1627
+ lowerTone = midTone;
1628
+ }
1629
+ else
1630
+ isAscending ? lowerTone = midTone + 1 : upperTone = midTone;
1631
+ }
1632
+ return Hct.from(this.hue, this.requestedChroma, lowerTone);
1633
+ }
1634
+ // Find the maximum chroma for a given tone
1635
+ maxChroma(tone) {
1636
+ if (this.chromaCache.has(tone))
1637
+ return this.chromaCache.get(tone);
1638
+ const chroma = Hct.from(this.hue, this.maxChromaValue, tone).chroma;
1639
+ return this.chromaCache.set(tone, chroma), chroma;
1640
+ }
1641
+ }
1642
+ /**
1643
+ * @license
1644
+ * Copyright 2023 Google LLC
1645
+ *
1646
+ * Licensed under the Apache License, Version 2.0 (the "License");
1647
+ * you may not use this file except in compliance with the License.
1648
+ * You may obtain a copy of the License at
1649
+ *
1650
+ * http://www.apache.org/licenses/LICENSE-2.0
1651
+ *
1652
+ * Unless required by applicable law or agreed to in writing, software
1653
+ * distributed under the License is distributed on an "AS IS" BASIS,
1654
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1655
+ * See the License for the specific language governing permissions and
1656
+ * limitations under the License.
1657
+ */
1658
+ class ContrastCurve {
1659
+ /**
1660
+ * Creates a `ContrastCurve` object.
1661
+ *
1662
+ * @param low Value for contrast level -1.0
1663
+ * @param normal Value for contrast level 0.0
1664
+ * @param medium Value for contrast level 0.5
1665
+ * @param high Value for contrast level 1.0
1666
+ */
1667
+ constructor(low, normal, medium, high) {
1668
+ this.low = low, this.normal = normal, this.medium = medium, this.high = high;
1669
+ }
1670
+ /**
1671
+ * Returns the value at a given contrast level.
1672
+ *
1673
+ * @param contrastLevel The contrast level. 0.0 is the default (normal); -1.0
1674
+ * is the lowest; 1.0 is the highest.
1675
+ * @return The value. For contrast ratios, a number between 1.0 and 21.0.
1676
+ */
1677
+ get(contrastLevel) {
1678
+ return contrastLevel <= -1 ? this.low : contrastLevel < 0 ? lerp(this.low, this.normal, (contrastLevel - -1) / 1) : contrastLevel < 0.5 ? lerp(this.normal, this.medium, (contrastLevel - 0) / 0.5) : contrastLevel < 1 ? lerp(this.medium, this.high, (contrastLevel - 0.5) / 0.5) : this.high;
1679
+ }
1680
+ }
1681
+ /**
1682
+ * @license
1683
+ * Copyright 2023 Google LLC
1684
+ *
1685
+ * Licensed under the Apache License, Version 2.0 (the "License");
1686
+ * you may not use this file except in compliance with the License.
1687
+ * You may obtain a copy of the License at
1688
+ *
1689
+ * http://www.apache.org/licenses/LICENSE-2.0
1690
+ *
1691
+ * Unless required by applicable law or agreed to in writing, software
1692
+ * distributed under the License is distributed on an "AS IS" BASIS,
1693
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1694
+ * See the License for the specific language governing permissions and
1695
+ * limitations under the License.
1696
+ */
1697
+ class ToneDeltaPair {
1698
+ /**
1699
+ * Documents a constraint in tone distance between two DynamicColors.
1700
+ *
1701
+ * The polarity is an adjective that describes "A", compared to "B".
1702
+ *
1703
+ * For instance, ToneDeltaPair(A, B, 15, 'darker', 'exact') states that
1704
+ * A's tone should be exactly 15 darker than B's.
1705
+ *
1706
+ * 'relative_darker' and 'relative_lighter' describes the tone adjustment
1707
+ * relative to the surface color trend (white in light mode; black in dark
1708
+ * mode). For instance, ToneDeltaPair(A, B, 10, 'relative_lighter',
1709
+ * 'farther') states that A should be at least 10 lighter than B in light
1710
+ * mode, and at least 10 darker than B in dark mode.
1711
+ *
1712
+ * @param roleA The first role in a pair.
1713
+ * @param roleB The second role in a pair.
1714
+ * @param delta Required difference between tones. Absolute value, negative
1715
+ * values have undefined behavior.
1716
+ * @param polarity The relative relation between tones of roleA and roleB,
1717
+ * as described above.
1718
+ * @param constraint How to fulfill the tone delta pair constraint.
1719
+ * @param stayTogether Whether these two roles should stay on the same side
1720
+ * of the "awkward zone" (T50-59). This is necessary for certain cases where
1721
+ * one role has two backgrounds.
1722
+ */
1723
+ constructor(roleA, roleB, delta, polarity, stayTogether, constraint) {
1724
+ this.roleA = roleA, this.roleB = roleB, this.delta = delta, this.polarity = polarity, this.stayTogether = stayTogether, this.constraint = constraint, this.constraint = constraint ?? "exact";
1725
+ }
1726
+ }
1727
+ /**
1728
+ * @license
1729
+ * Copyright 2022 Google LLC
1730
+ *
1731
+ * Licensed under the Apache License, Version 2.0 (the "License");
1732
+ * you may not use this file except in compliance with the License.
1733
+ * You may obtain a copy of the License at
1734
+ *
1735
+ * http://www.apache.org/licenses/LICENSE-2.0
1736
+ *
1737
+ * Unless required by applicable law or agreed to in writing, software
1738
+ * distributed under the License is distributed on an "AS IS" BASIS,
1739
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1740
+ * See the License for the specific language governing permissions and
1741
+ * limitations under the License.
1742
+ */
1743
+ var Variant;
1744
+ (function(Variant2) {
1745
+ Variant2[Variant2.MONOCHROME = 0] = "MONOCHROME", Variant2[Variant2.NEUTRAL = 1] = "NEUTRAL", Variant2[Variant2.TONAL_SPOT = 2] = "TONAL_SPOT", Variant2[Variant2.VIBRANT = 3] = "VIBRANT", Variant2[Variant2.EXPRESSIVE = 4] = "EXPRESSIVE", Variant2[Variant2.FIDELITY = 5] = "FIDELITY", Variant2[Variant2.CONTENT = 6] = "CONTENT", Variant2[Variant2.RAINBOW = 7] = "RAINBOW", Variant2[Variant2.FRUIT_SALAD = 8] = "FRUIT_SALAD";
1746
+ })(Variant || (Variant = {}));
1747
+ /**
1748
+ * @license
1749
+ * Copyright 2025 Google LLC
1750
+ *
1751
+ * Licensed under the Apache License, Version 2.0 (the "License");
1752
+ * you may not use this file except in compliance with the License.
1753
+ * You may obtain a copy of the License at
1754
+ *
1755
+ * http://www.apache.org/licenses/LICENSE-2.0
1756
+ *
1757
+ * Unless required by applicable law or agreed to in writing, software
1758
+ * distributed under the License is distributed on an "AS IS" BASIS,
1759
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1760
+ * See the License for the specific language governing permissions and
1761
+ * limitations under the License.
1762
+ */
1763
+ function isFidelity(scheme) {
1764
+ return scheme.variant === Variant.FIDELITY || scheme.variant === Variant.CONTENT;
1765
+ }
1766
+ function isMonochrome(scheme) {
1767
+ return scheme.variant === Variant.MONOCHROME;
1768
+ }
1769
+ function findDesiredChromaByTone(hue, chroma, tone, byDecreasingTone) {
1770
+ let answer = tone, closestToChroma = Hct.from(hue, chroma, tone);
1771
+ if (closestToChroma.chroma < chroma) {
1772
+ let chromaPeak = closestToChroma.chroma;
1773
+ for (; closestToChroma.chroma < chroma; ) {
1774
+ answer += byDecreasingTone ? -1 : 1;
1775
+ const potentialSolution = Hct.from(hue, chroma, answer);
1776
+ if (chromaPeak > potentialSolution.chroma || Math.abs(potentialSolution.chroma - chroma) < 0.4)
1777
+ break;
1778
+ const potentialDelta = Math.abs(potentialSolution.chroma - chroma), currentDelta = Math.abs(closestToChroma.chroma - chroma);
1779
+ potentialDelta < currentDelta && (closestToChroma = potentialSolution), chromaPeak = Math.max(chromaPeak, potentialSolution.chroma);
1780
+ }
1781
+ }
1782
+ return answer;
1783
+ }
1784
+ class ColorSpecDelegateImpl2021 {
1785
+ ////////////////////////////////////////////////////////////////
1786
+ // Main Palettes //
1787
+ ////////////////////////////////////////////////////////////////
1788
+ primaryPaletteKeyColor() {
1789
+ return DynamicColor.fromPalette({
1790
+ name: "primary_palette_key_color",
1791
+ palette: (s) => s.primaryPalette,
1792
+ tone: (s) => s.primaryPalette.keyColor.tone
1793
+ });
1794
+ }
1795
+ secondaryPaletteKeyColor() {
1796
+ return DynamicColor.fromPalette({
1797
+ name: "secondary_palette_key_color",
1798
+ palette: (s) => s.secondaryPalette,
1799
+ tone: (s) => s.secondaryPalette.keyColor.tone
1800
+ });
1801
+ }
1802
+ tertiaryPaletteKeyColor() {
1803
+ return DynamicColor.fromPalette({
1804
+ name: "tertiary_palette_key_color",
1805
+ palette: (s) => s.tertiaryPalette,
1806
+ tone: (s) => s.tertiaryPalette.keyColor.tone
1807
+ });
1808
+ }
1809
+ neutralPaletteKeyColor() {
1810
+ return DynamicColor.fromPalette({
1811
+ name: "neutral_palette_key_color",
1812
+ palette: (s) => s.neutralPalette,
1813
+ tone: (s) => s.neutralPalette.keyColor.tone
1814
+ });
1815
+ }
1816
+ neutralVariantPaletteKeyColor() {
1817
+ return DynamicColor.fromPalette({
1818
+ name: "neutral_variant_palette_key_color",
1819
+ palette: (s) => s.neutralVariantPalette,
1820
+ tone: (s) => s.neutralVariantPalette.keyColor.tone
1821
+ });
1822
+ }
1823
+ errorPaletteKeyColor() {
1824
+ return DynamicColor.fromPalette({
1825
+ name: "error_palette_key_color",
1826
+ palette: (s) => s.errorPalette,
1827
+ tone: (s) => s.errorPalette.keyColor.tone
1828
+ });
1829
+ }
1830
+ ////////////////////////////////////////////////////////////////
1831
+ // Surfaces [S] //
1832
+ ////////////////////////////////////////////////////////////////
1833
+ background() {
1834
+ return DynamicColor.fromPalette({
1835
+ name: "background",
1836
+ palette: (s) => s.neutralPalette,
1837
+ tone: (s) => s.isDark ? 6 : 98,
1838
+ isBackground: !0
1839
+ });
1840
+ }
1841
+ onBackground() {
1842
+ return DynamicColor.fromPalette({
1843
+ name: "on_background",
1844
+ palette: (s) => s.neutralPalette,
1845
+ tone: (s) => s.isDark ? 90 : 10,
1846
+ background: (s) => this.background(),
1847
+ contrastCurve: (s) => new ContrastCurve(3, 3, 4.5, 7)
1848
+ });
1849
+ }
1850
+ surface() {
1851
+ return DynamicColor.fromPalette({
1852
+ name: "surface",
1853
+ palette: (s) => s.neutralPalette,
1854
+ tone: (s) => s.isDark ? 6 : 98,
1855
+ isBackground: !0
1856
+ });
1857
+ }
1858
+ surfaceDim() {
1859
+ return DynamicColor.fromPalette({
1860
+ name: "surface_dim",
1861
+ palette: (s) => s.neutralPalette,
1862
+ tone: (s) => s.isDark ? 6 : new ContrastCurve(87, 87, 80, 75).get(s.contrastLevel),
1863
+ isBackground: !0
1864
+ });
1865
+ }
1866
+ surfaceBright() {
1867
+ return DynamicColor.fromPalette({
1868
+ name: "surface_bright",
1869
+ palette: (s) => s.neutralPalette,
1870
+ tone: (s) => s.isDark ? new ContrastCurve(24, 24, 29, 34).get(s.contrastLevel) : 98,
1871
+ isBackground: !0
1872
+ });
1873
+ }
1874
+ surfaceContainerLowest() {
1875
+ return DynamicColor.fromPalette({
1876
+ name: "surface_container_lowest",
1877
+ palette: (s) => s.neutralPalette,
1878
+ tone: (s) => s.isDark ? new ContrastCurve(4, 4, 2, 0).get(s.contrastLevel) : 100,
1879
+ isBackground: !0
1880
+ });
1881
+ }
1882
+ surfaceContainerLow() {
1883
+ return DynamicColor.fromPalette({
1884
+ name: "surface_container_low",
1885
+ palette: (s) => s.neutralPalette,
1886
+ tone: (s) => s.isDark ? new ContrastCurve(10, 10, 11, 12).get(s.contrastLevel) : new ContrastCurve(96, 96, 96, 95).get(s.contrastLevel),
1887
+ isBackground: !0
1888
+ });
1889
+ }
1890
+ surfaceContainer() {
1891
+ return DynamicColor.fromPalette({
1892
+ name: "surface_container",
1893
+ palette: (s) => s.neutralPalette,
1894
+ tone: (s) => s.isDark ? new ContrastCurve(12, 12, 16, 20).get(s.contrastLevel) : new ContrastCurve(94, 94, 92, 90).get(s.contrastLevel),
1895
+ isBackground: !0
1896
+ });
1897
+ }
1898
+ surfaceContainerHigh() {
1899
+ return DynamicColor.fromPalette({
1900
+ name: "surface_container_high",
1901
+ palette: (s) => s.neutralPalette,
1902
+ tone: (s) => s.isDark ? new ContrastCurve(17, 17, 21, 25).get(s.contrastLevel) : new ContrastCurve(92, 92, 88, 85).get(s.contrastLevel),
1903
+ isBackground: !0
1904
+ });
1905
+ }
1906
+ surfaceContainerHighest() {
1907
+ return DynamicColor.fromPalette({
1908
+ name: "surface_container_highest",
1909
+ palette: (s) => s.neutralPalette,
1910
+ tone: (s) => s.isDark ? new ContrastCurve(22, 22, 26, 30).get(s.contrastLevel) : new ContrastCurve(90, 90, 84, 80).get(s.contrastLevel),
1911
+ isBackground: !0
1912
+ });
1913
+ }
1914
+ onSurface() {
1915
+ return DynamicColor.fromPalette({
1916
+ name: "on_surface",
1917
+ palette: (s) => s.neutralPalette,
1918
+ tone: (s) => s.isDark ? 90 : 10,
1919
+ background: (s) => this.highestSurface(s),
1920
+ contrastCurve: (s) => new ContrastCurve(4.5, 7, 11, 21)
1921
+ });
1922
+ }
1923
+ surfaceVariant() {
1924
+ return DynamicColor.fromPalette({
1925
+ name: "surface_variant",
1926
+ palette: (s) => s.neutralVariantPalette,
1927
+ tone: (s) => s.isDark ? 30 : 90,
1928
+ isBackground: !0
1929
+ });
1930
+ }
1931
+ onSurfaceVariant() {
1932
+ return DynamicColor.fromPalette({
1933
+ name: "on_surface_variant",
1934
+ palette: (s) => s.neutralVariantPalette,
1935
+ tone: (s) => s.isDark ? 80 : 30,
1936
+ background: (s) => this.highestSurface(s),
1937
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 11)
1938
+ });
1939
+ }
1940
+ inverseSurface() {
1941
+ return DynamicColor.fromPalette({
1942
+ name: "inverse_surface",
1943
+ palette: (s) => s.neutralPalette,
1944
+ tone: (s) => s.isDark ? 90 : 20,
1945
+ isBackground: !0
1946
+ });
1947
+ }
1948
+ inverseOnSurface() {
1949
+ return DynamicColor.fromPalette({
1950
+ name: "inverse_on_surface",
1951
+ palette: (s) => s.neutralPalette,
1952
+ tone: (s) => s.isDark ? 20 : 95,
1953
+ background: (s) => this.inverseSurface(),
1954
+ contrastCurve: (s) => new ContrastCurve(4.5, 7, 11, 21)
1955
+ });
1956
+ }
1957
+ outline() {
1958
+ return DynamicColor.fromPalette({
1959
+ name: "outline",
1960
+ palette: (s) => s.neutralVariantPalette,
1961
+ tone: (s) => s.isDark ? 60 : 50,
1962
+ background: (s) => this.highestSurface(s),
1963
+ contrastCurve: (s) => new ContrastCurve(1.5, 3, 4.5, 7)
1964
+ });
1965
+ }
1966
+ outlineVariant() {
1967
+ return DynamicColor.fromPalette({
1968
+ name: "outline_variant",
1969
+ palette: (s) => s.neutralVariantPalette,
1970
+ tone: (s) => s.isDark ? 30 : 80,
1971
+ background: (s) => this.highestSurface(s),
1972
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5)
1973
+ });
1974
+ }
1975
+ shadow() {
1976
+ return DynamicColor.fromPalette({
1977
+ name: "shadow",
1978
+ palette: (s) => s.neutralPalette,
1979
+ tone: (s) => 0
1980
+ });
1981
+ }
1982
+ scrim() {
1983
+ return DynamicColor.fromPalette({
1984
+ name: "scrim",
1985
+ palette: (s) => s.neutralPalette,
1986
+ tone: (s) => 0
1987
+ });
1988
+ }
1989
+ surfaceTint() {
1990
+ return DynamicColor.fromPalette({
1991
+ name: "surface_tint",
1992
+ palette: (s) => s.primaryPalette,
1993
+ tone: (s) => s.isDark ? 80 : 40,
1994
+ isBackground: !0
1995
+ });
1996
+ }
1997
+ ////////////////////////////////////////////////////////////////
1998
+ // Primary [P]. //
1999
+ ////////////////////////////////////////////////////////////////
2000
+ primary() {
2001
+ return DynamicColor.fromPalette({
2002
+ name: "primary",
2003
+ palette: (s) => s.primaryPalette,
2004
+ tone: (s) => isMonochrome(s) ? s.isDark ? 100 : 0 : s.isDark ? 80 : 40,
2005
+ isBackground: !0,
2006
+ background: (s) => this.highestSurface(s),
2007
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 7),
2008
+ toneDeltaPair: (s) => new ToneDeltaPair(this.primaryContainer(), this.primary(), 10, "nearer", !1)
2009
+ });
2010
+ }
2011
+ primaryDim() {
2012
+ }
2013
+ onPrimary() {
2014
+ return DynamicColor.fromPalette({
2015
+ name: "on_primary",
2016
+ palette: (s) => s.primaryPalette,
2017
+ tone: (s) => isMonochrome(s) ? s.isDark ? 10 : 90 : s.isDark ? 20 : 100,
2018
+ background: (s) => this.primary(),
2019
+ contrastCurve: (s) => new ContrastCurve(4.5, 7, 11, 21)
2020
+ });
2021
+ }
2022
+ primaryContainer() {
2023
+ return DynamicColor.fromPalette({
2024
+ name: "primary_container",
2025
+ palette: (s) => s.primaryPalette,
2026
+ tone: (s) => isFidelity(s) ? s.sourceColorHct.tone : isMonochrome(s) ? s.isDark ? 85 : 25 : s.isDark ? 30 : 90,
2027
+ isBackground: !0,
2028
+ background: (s) => this.highestSurface(s),
2029
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2030
+ toneDeltaPair: (s) => new ToneDeltaPair(this.primaryContainer(), this.primary(), 10, "nearer", !1)
2031
+ });
2032
+ }
2033
+ onPrimaryContainer() {
2034
+ return DynamicColor.fromPalette({
2035
+ name: "on_primary_container",
2036
+ palette: (s) => s.primaryPalette,
2037
+ tone: (s) => isFidelity(s) ? DynamicColor.foregroundTone(this.primaryContainer().tone(s), 4.5) : isMonochrome(s) ? s.isDark ? 0 : 100 : s.isDark ? 90 : 30,
2038
+ background: (s) => this.primaryContainer(),
2039
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 11)
2040
+ });
2041
+ }
2042
+ inversePrimary() {
2043
+ return DynamicColor.fromPalette({
2044
+ name: "inverse_primary",
2045
+ palette: (s) => s.primaryPalette,
2046
+ tone: (s) => s.isDark ? 40 : 80,
2047
+ background: (s) => this.inverseSurface(),
2048
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 7)
2049
+ });
2050
+ }
2051
+ /////////////////////////////////////////////////////////////////
2052
+ // Secondary [Q]. //
2053
+ /////////////////////////////////////////////////////////////////
2054
+ secondary() {
2055
+ return DynamicColor.fromPalette({
2056
+ name: "secondary",
2057
+ palette: (s) => s.secondaryPalette,
2058
+ tone: (s) => s.isDark ? 80 : 40,
2059
+ isBackground: !0,
2060
+ background: (s) => this.highestSurface(s),
2061
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 7),
2062
+ toneDeltaPair: (s) => new ToneDeltaPair(this.secondaryContainer(), this.secondary(), 10, "nearer", !1)
2063
+ });
2064
+ }
2065
+ secondaryDim() {
2066
+ }
2067
+ onSecondary() {
2068
+ return DynamicColor.fromPalette({
2069
+ name: "on_secondary",
2070
+ palette: (s) => s.secondaryPalette,
2071
+ tone: (s) => isMonochrome(s) ? s.isDark ? 10 : 100 : s.isDark ? 20 : 100,
2072
+ background: (s) => this.secondary(),
2073
+ contrastCurve: (s) => new ContrastCurve(4.5, 7, 11, 21)
2074
+ });
2075
+ }
2076
+ secondaryContainer() {
2077
+ return DynamicColor.fromPalette({
2078
+ name: "secondary_container",
2079
+ palette: (s) => s.secondaryPalette,
2080
+ tone: (s) => {
2081
+ const initialTone = s.isDark ? 30 : 90;
2082
+ return isMonochrome(s) ? s.isDark ? 30 : 85 : isFidelity(s) ? findDesiredChromaByTone(s.secondaryPalette.hue, s.secondaryPalette.chroma, initialTone, !s.isDark) : initialTone;
2083
+ },
2084
+ isBackground: !0,
2085
+ background: (s) => this.highestSurface(s),
2086
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2087
+ toneDeltaPair: (s) => new ToneDeltaPair(this.secondaryContainer(), this.secondary(), 10, "nearer", !1)
2088
+ });
2089
+ }
2090
+ onSecondaryContainer() {
2091
+ return DynamicColor.fromPalette({
2092
+ name: "on_secondary_container",
2093
+ palette: (s) => s.secondaryPalette,
2094
+ tone: (s) => isMonochrome(s) ? s.isDark ? 90 : 10 : isFidelity(s) ? DynamicColor.foregroundTone(this.secondaryContainer().tone(s), 4.5) : s.isDark ? 90 : 30,
2095
+ background: (s) => this.secondaryContainer(),
2096
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 11)
2097
+ });
2098
+ }
2099
+ /////////////////////////////////////////////////////////////////
2100
+ // Tertiary [T]. //
2101
+ /////////////////////////////////////////////////////////////////
2102
+ tertiary() {
2103
+ return DynamicColor.fromPalette({
2104
+ name: "tertiary",
2105
+ palette: (s) => s.tertiaryPalette,
2106
+ tone: (s) => isMonochrome(s) ? s.isDark ? 90 : 25 : s.isDark ? 80 : 40,
2107
+ isBackground: !0,
2108
+ background: (s) => this.highestSurface(s),
2109
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 7),
2110
+ toneDeltaPair: (s) => new ToneDeltaPair(this.tertiaryContainer(), this.tertiary(), 10, "nearer", !1)
2111
+ });
2112
+ }
2113
+ tertiaryDim() {
2114
+ }
2115
+ onTertiary() {
2116
+ return DynamicColor.fromPalette({
2117
+ name: "on_tertiary",
2118
+ palette: (s) => s.tertiaryPalette,
2119
+ tone: (s) => isMonochrome(s) ? s.isDark ? 10 : 90 : s.isDark ? 20 : 100,
2120
+ background: (s) => this.tertiary(),
2121
+ contrastCurve: (s) => new ContrastCurve(4.5, 7, 11, 21)
2122
+ });
2123
+ }
2124
+ tertiaryContainer() {
2125
+ return DynamicColor.fromPalette({
2126
+ name: "tertiary_container",
2127
+ palette: (s) => s.tertiaryPalette,
2128
+ tone: (s) => {
2129
+ if (isMonochrome(s))
2130
+ return s.isDark ? 60 : 49;
2131
+ if (!isFidelity(s))
2132
+ return s.isDark ? 30 : 90;
2133
+ const proposedHct = s.tertiaryPalette.getHct(s.sourceColorHct.tone);
2134
+ return DislikeAnalyzer.fixIfDisliked(proposedHct).tone;
2135
+ },
2136
+ isBackground: !0,
2137
+ background: (s) => this.highestSurface(s),
2138
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2139
+ toneDeltaPair: (s) => new ToneDeltaPair(this.tertiaryContainer(), this.tertiary(), 10, "nearer", !1)
2140
+ });
2141
+ }
2142
+ onTertiaryContainer() {
2143
+ return DynamicColor.fromPalette({
2144
+ name: "on_tertiary_container",
2145
+ palette: (s) => s.tertiaryPalette,
2146
+ tone: (s) => isMonochrome(s) ? s.isDark ? 0 : 100 : isFidelity(s) ? DynamicColor.foregroundTone(this.tertiaryContainer().tone(s), 4.5) : s.isDark ? 90 : 30,
2147
+ background: (s) => this.tertiaryContainer(),
2148
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 11)
2149
+ });
2150
+ }
2151
+ //////////////////////////////////////////////////////////////////
2152
+ // Error [E]. //
2153
+ //////////////////////////////////////////////////////////////////
2154
+ error() {
2155
+ return DynamicColor.fromPalette({
2156
+ name: "error",
2157
+ palette: (s) => s.errorPalette,
2158
+ tone: (s) => s.isDark ? 80 : 40,
2159
+ isBackground: !0,
2160
+ background: (s) => this.highestSurface(s),
2161
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 7),
2162
+ toneDeltaPair: (s) => new ToneDeltaPair(this.errorContainer(), this.error(), 10, "nearer", !1)
2163
+ });
2164
+ }
2165
+ errorDim() {
2166
+ }
2167
+ onError() {
2168
+ return DynamicColor.fromPalette({
2169
+ name: "on_error",
2170
+ palette: (s) => s.errorPalette,
2171
+ tone: (s) => s.isDark ? 20 : 100,
2172
+ background: (s) => this.error(),
2173
+ contrastCurve: (s) => new ContrastCurve(4.5, 7, 11, 21)
2174
+ });
2175
+ }
2176
+ errorContainer() {
2177
+ return DynamicColor.fromPalette({
2178
+ name: "error_container",
2179
+ palette: (s) => s.errorPalette,
2180
+ tone: (s) => s.isDark ? 30 : 90,
2181
+ isBackground: !0,
2182
+ background: (s) => this.highestSurface(s),
2183
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2184
+ toneDeltaPair: (s) => new ToneDeltaPair(this.errorContainer(), this.error(), 10, "nearer", !1)
2185
+ });
2186
+ }
2187
+ onErrorContainer() {
2188
+ return DynamicColor.fromPalette({
2189
+ name: "on_error_container",
2190
+ palette: (s) => s.errorPalette,
2191
+ tone: (s) => isMonochrome(s) ? s.isDark ? 90 : 10 : s.isDark ? 90 : 30,
2192
+ background: (s) => this.errorContainer(),
2193
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 11)
2194
+ });
2195
+ }
2196
+ //////////////////////////////////////////////////////////////////
2197
+ // Primary Fixed [PF] //
2198
+ //////////////////////////////////////////////////////////////////
2199
+ primaryFixed() {
2200
+ return DynamicColor.fromPalette({
2201
+ name: "primary_fixed",
2202
+ palette: (s) => s.primaryPalette,
2203
+ tone: (s) => isMonochrome(s) ? 40 : 90,
2204
+ isBackground: !0,
2205
+ background: (s) => this.highestSurface(s),
2206
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2207
+ toneDeltaPair: (s) => new ToneDeltaPair(this.primaryFixed(), this.primaryFixedDim(), 10, "lighter", !0)
2208
+ });
2209
+ }
2210
+ primaryFixedDim() {
2211
+ return DynamicColor.fromPalette({
2212
+ name: "primary_fixed_dim",
2213
+ palette: (s) => s.primaryPalette,
2214
+ tone: (s) => isMonochrome(s) ? 30 : 80,
2215
+ isBackground: !0,
2216
+ background: (s) => this.highestSurface(s),
2217
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2218
+ toneDeltaPair: (s) => new ToneDeltaPair(this.primaryFixed(), this.primaryFixedDim(), 10, "lighter", !0)
2219
+ });
2220
+ }
2221
+ onPrimaryFixed() {
2222
+ return DynamicColor.fromPalette({
2223
+ name: "on_primary_fixed",
2224
+ palette: (s) => s.primaryPalette,
2225
+ tone: (s) => isMonochrome(s) ? 100 : 10,
2226
+ background: (s) => this.primaryFixedDim(),
2227
+ secondBackground: (s) => this.primaryFixed(),
2228
+ contrastCurve: (s) => new ContrastCurve(4.5, 7, 11, 21)
2229
+ });
2230
+ }
2231
+ onPrimaryFixedVariant() {
2232
+ return DynamicColor.fromPalette({
2233
+ name: "on_primary_fixed_variant",
2234
+ palette: (s) => s.primaryPalette,
2235
+ tone: (s) => isMonochrome(s) ? 90 : 30,
2236
+ background: (s) => this.primaryFixedDim(),
2237
+ secondBackground: (s) => this.primaryFixed(),
2238
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 11)
2239
+ });
2240
+ }
2241
+ ///////////////////////////////////////////////////////////////////
2242
+ // Secondary Fixed [QF] //
2243
+ ///////////////////////////////////////////////////////////////////
2244
+ secondaryFixed() {
2245
+ return DynamicColor.fromPalette({
2246
+ name: "secondary_fixed",
2247
+ palette: (s) => s.secondaryPalette,
2248
+ tone: (s) => isMonochrome(s) ? 80 : 90,
2249
+ isBackground: !0,
2250
+ background: (s) => this.highestSurface(s),
2251
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2252
+ toneDeltaPair: (s) => new ToneDeltaPair(this.secondaryFixed(), this.secondaryFixedDim(), 10, "lighter", !0)
2253
+ });
2254
+ }
2255
+ secondaryFixedDim() {
2256
+ return DynamicColor.fromPalette({
2257
+ name: "secondary_fixed_dim",
2258
+ palette: (s) => s.secondaryPalette,
2259
+ tone: (s) => isMonochrome(s) ? 70 : 80,
2260
+ isBackground: !0,
2261
+ background: (s) => this.highestSurface(s),
2262
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2263
+ toneDeltaPair: (s) => new ToneDeltaPair(this.secondaryFixed(), this.secondaryFixedDim(), 10, "lighter", !0)
2264
+ });
2265
+ }
2266
+ onSecondaryFixed() {
2267
+ return DynamicColor.fromPalette({
2268
+ name: "on_secondary_fixed",
2269
+ palette: (s) => s.secondaryPalette,
2270
+ tone: (s) => 10,
2271
+ background: (s) => this.secondaryFixedDim(),
2272
+ secondBackground: (s) => this.secondaryFixed(),
2273
+ contrastCurve: (s) => new ContrastCurve(4.5, 7, 11, 21)
2274
+ });
2275
+ }
2276
+ onSecondaryFixedVariant() {
2277
+ return DynamicColor.fromPalette({
2278
+ name: "on_secondary_fixed_variant",
2279
+ palette: (s) => s.secondaryPalette,
2280
+ tone: (s) => isMonochrome(s) ? 25 : 30,
2281
+ background: (s) => this.secondaryFixedDim(),
2282
+ secondBackground: (s) => this.secondaryFixed(),
2283
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 11)
2284
+ });
2285
+ }
2286
+ /////////////////////////////////////////////////////////////////
2287
+ // Tertiary Fixed [TF] //
2288
+ /////////////////////////////////////////////////////////////////
2289
+ tertiaryFixed() {
2290
+ return DynamicColor.fromPalette({
2291
+ name: "tertiary_fixed",
2292
+ palette: (s) => s.tertiaryPalette,
2293
+ tone: (s) => isMonochrome(s) ? 40 : 90,
2294
+ isBackground: !0,
2295
+ background: (s) => this.highestSurface(s),
2296
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2297
+ toneDeltaPair: (s) => new ToneDeltaPair(this.tertiaryFixed(), this.tertiaryFixedDim(), 10, "lighter", !0)
2298
+ });
2299
+ }
2300
+ tertiaryFixedDim() {
2301
+ return DynamicColor.fromPalette({
2302
+ name: "tertiary_fixed_dim",
2303
+ palette: (s) => s.tertiaryPalette,
2304
+ tone: (s) => isMonochrome(s) ? 30 : 80,
2305
+ isBackground: !0,
2306
+ background: (s) => this.highestSurface(s),
2307
+ contrastCurve: (s) => new ContrastCurve(1, 1, 3, 4.5),
2308
+ toneDeltaPair: (s) => new ToneDeltaPair(this.tertiaryFixed(), this.tertiaryFixedDim(), 10, "lighter", !0)
2309
+ });
2310
+ }
2311
+ onTertiaryFixed() {
2312
+ return DynamicColor.fromPalette({
2313
+ name: "on_tertiary_fixed",
2314
+ palette: (s) => s.tertiaryPalette,
2315
+ tone: (s) => isMonochrome(s) ? 100 : 10,
2316
+ background: (s) => this.tertiaryFixedDim(),
2317
+ secondBackground: (s) => this.tertiaryFixed(),
2318
+ contrastCurve: (s) => new ContrastCurve(4.5, 7, 11, 21)
2319
+ });
2320
+ }
2321
+ onTertiaryFixedVariant() {
2322
+ return DynamicColor.fromPalette({
2323
+ name: "on_tertiary_fixed_variant",
2324
+ palette: (s) => s.tertiaryPalette,
2325
+ tone: (s) => isMonochrome(s) ? 90 : 30,
2326
+ background: (s) => this.tertiaryFixedDim(),
2327
+ secondBackground: (s) => this.tertiaryFixed(),
2328
+ contrastCurve: (s) => new ContrastCurve(3, 4.5, 7, 11)
2329
+ });
2330
+ }
2331
+ ////////////////////////////////////////////////////////////////
2332
+ // Other //
2333
+ ////////////////////////////////////////////////////////////////
2334
+ highestSurface(s) {
2335
+ return s.isDark ? this.surfaceBright() : this.surfaceDim();
2336
+ }
2337
+ }
2338
+ /**
2339
+ * @license
2340
+ * Copyright 2025 Google LLC
2341
+ *
2342
+ * Licensed under the Apache License, Version 2.0 (the "License");
2343
+ * you may not use this file except in compliance with the License.
2344
+ * You may obtain a copy of the License at
2345
+ *
2346
+ * http://www.apache.org/licenses/LICENSE-2.0
2347
+ *
2348
+ * Unless required by applicable law or agreed to in writing, software
2349
+ * distributed under the License is distributed on an "AS IS" BASIS,
2350
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2351
+ * See the License for the specific language governing permissions and
2352
+ * limitations under the License.
2353
+ */
2354
+ function tMaxC(palette, lowerBound = 0, upperBound = 100, chromaMultiplier = 1) {
2355
+ let answer = findBestToneForChroma(palette.hue, palette.chroma * chromaMultiplier, 100, !0);
2356
+ return clampDouble(lowerBound, upperBound, answer);
2357
+ }
2358
+ function tMinC(palette, lowerBound = 0, upperBound = 100) {
2359
+ let answer = findBestToneForChroma(palette.hue, palette.chroma, 0, !1);
2360
+ return clampDouble(lowerBound, upperBound, answer);
2361
+ }
2362
+ function findBestToneForChroma(hue, chroma, tone, byDecreasingTone) {
2363
+ let answer = tone, bestCandidate = Hct.from(hue, chroma, answer);
2364
+ for (; bestCandidate.chroma < chroma && !(tone < 0 || tone > 100); ) {
2365
+ tone += byDecreasingTone ? -1 : 1;
2366
+ const newCandidate = Hct.from(hue, chroma, tone);
2367
+ bestCandidate.chroma < newCandidate.chroma && (bestCandidate = newCandidate, answer = tone);
2368
+ }
2369
+ return answer;
2370
+ }
2371
+ function getCurve(defaultContrast) {
2372
+ return defaultContrast === 1.5 ? new ContrastCurve(1.5, 1.5, 3, 5.5) : defaultContrast === 3 ? new ContrastCurve(3, 3, 4.5, 7) : defaultContrast === 4.5 ? new ContrastCurve(4.5, 4.5, 7, 11) : defaultContrast === 6 ? new ContrastCurve(6, 6, 7, 11) : defaultContrast === 7 ? new ContrastCurve(7, 7, 11, 21) : defaultContrast === 9 ? new ContrastCurve(9, 9, 11, 21) : defaultContrast === 11 ? new ContrastCurve(11, 11, 21, 21) : defaultContrast === 21 ? new ContrastCurve(21, 21, 21, 21) : new ContrastCurve(defaultContrast, defaultContrast, 7, 21);
2373
+ }
2374
+ class ColorSpecDelegateImpl2025 extends ColorSpecDelegateImpl2021 {
2375
+ ////////////////////////////////////////////////////////////////
2376
+ // Surfaces [S] //
2377
+ ////////////////////////////////////////////////////////////////
2378
+ surface() {
2379
+ const color2025 = DynamicColor.fromPalette({
2380
+ name: "surface",
2381
+ palette: (s) => s.neutralPalette,
2382
+ tone: (s) => (super.surface().tone(s), s.platform === "phone" ? s.isDark ? 4 : Hct.isYellow(s.neutralPalette.hue) ? 99 : s.variant === Variant.VIBRANT ? 97 : 98 : 0),
2383
+ isBackground: !0
2384
+ });
2385
+ return extendSpecVersion(super.surface(), "2025", color2025);
2386
+ }
2387
+ surfaceDim() {
2388
+ const color2025 = DynamicColor.fromPalette({
2389
+ name: "surface_dim",
2390
+ palette: (s) => s.neutralPalette,
2391
+ tone: (s) => s.isDark ? 4 : Hct.isYellow(s.neutralPalette.hue) ? 90 : s.variant === Variant.VIBRANT ? 85 : 87,
2392
+ isBackground: !0,
2393
+ chromaMultiplier: (s) => {
2394
+ if (!s.isDark) {
2395
+ if (s.variant === Variant.NEUTRAL)
2396
+ return 2.5;
2397
+ if (s.variant === Variant.TONAL_SPOT)
2398
+ return 1.7;
2399
+ if (s.variant === Variant.EXPRESSIVE)
2400
+ return Hct.isYellow(s.neutralPalette.hue) ? 2.7 : 1.75;
2401
+ if (s.variant === Variant.VIBRANT)
2402
+ return 1.36;
2403
+ }
2404
+ return 1;
2405
+ }
2406
+ });
2407
+ return extendSpecVersion(super.surfaceDim(), "2025", color2025);
2408
+ }
2409
+ surfaceBright() {
2410
+ const color2025 = DynamicColor.fromPalette({
2411
+ name: "surface_bright",
2412
+ palette: (s) => s.neutralPalette,
2413
+ tone: (s) => s.isDark ? 18 : Hct.isYellow(s.neutralPalette.hue) ? 99 : s.variant === Variant.VIBRANT ? 97 : 98,
2414
+ isBackground: !0,
2415
+ chromaMultiplier: (s) => {
2416
+ if (s.isDark) {
2417
+ if (s.variant === Variant.NEUTRAL)
2418
+ return 2.5;
2419
+ if (s.variant === Variant.TONAL_SPOT)
2420
+ return 1.7;
2421
+ if (s.variant === Variant.EXPRESSIVE)
2422
+ return Hct.isYellow(s.neutralPalette.hue) ? 2.7 : 1.75;
2423
+ if (s.variant === Variant.VIBRANT)
2424
+ return 1.36;
2425
+ }
2426
+ return 1;
2427
+ }
2428
+ });
2429
+ return extendSpecVersion(super.surfaceBright(), "2025", color2025);
2430
+ }
2431
+ surfaceContainerLowest() {
2432
+ const color2025 = DynamicColor.fromPalette({
2433
+ name: "surface_container_lowest",
2434
+ palette: (s) => s.neutralPalette,
2435
+ tone: (s) => s.isDark ? 0 : 100,
2436
+ isBackground: !0
2437
+ });
2438
+ return extendSpecVersion(super.surfaceContainerLowest(), "2025", color2025);
2439
+ }
2440
+ surfaceContainerLow() {
2441
+ const color2025 = DynamicColor.fromPalette({
2442
+ name: "surface_container_low",
2443
+ palette: (s) => s.neutralPalette,
2444
+ tone: (s) => s.platform === "phone" ? s.isDark ? 6 : Hct.isYellow(s.neutralPalette.hue) ? 98 : s.variant === Variant.VIBRANT ? 95 : 96 : 15,
2445
+ isBackground: !0,
2446
+ chromaMultiplier: (s) => {
2447
+ if (s.platform === "phone") {
2448
+ if (s.variant === Variant.NEUTRAL)
2449
+ return 1.3;
2450
+ if (s.variant === Variant.TONAL_SPOT)
2451
+ return 1.25;
2452
+ if (s.variant === Variant.EXPRESSIVE)
2453
+ return Hct.isYellow(s.neutralPalette.hue) ? 1.3 : 1.15;
2454
+ if (s.variant === Variant.VIBRANT)
2455
+ return 1.08;
2456
+ }
2457
+ return 1;
2458
+ }
2459
+ });
2460
+ return extendSpecVersion(super.surfaceContainerLow(), "2025", color2025);
2461
+ }
2462
+ surfaceContainer() {
2463
+ const color2025 = DynamicColor.fromPalette({
2464
+ name: "surface_container",
2465
+ palette: (s) => s.neutralPalette,
2466
+ tone: (s) => s.platform === "phone" ? s.isDark ? 9 : Hct.isYellow(s.neutralPalette.hue) ? 96 : s.variant === Variant.VIBRANT ? 92 : 94 : 20,
2467
+ isBackground: !0,
2468
+ chromaMultiplier: (s) => {
2469
+ if (s.platform === "phone") {
2470
+ if (s.variant === Variant.NEUTRAL)
2471
+ return 1.6;
2472
+ if (s.variant === Variant.TONAL_SPOT)
2473
+ return 1.4;
2474
+ if (s.variant === Variant.EXPRESSIVE)
2475
+ return Hct.isYellow(s.neutralPalette.hue) ? 1.6 : 1.3;
2476
+ if (s.variant === Variant.VIBRANT)
2477
+ return 1.15;
2478
+ }
2479
+ return 1;
2480
+ }
2481
+ });
2482
+ return extendSpecVersion(super.surfaceContainer(), "2025", color2025);
2483
+ }
2484
+ surfaceContainerHigh() {
2485
+ const color2025 = DynamicColor.fromPalette({
2486
+ name: "surface_container_high",
2487
+ palette: (s) => s.neutralPalette,
2488
+ tone: (s) => s.platform === "phone" ? s.isDark ? 12 : Hct.isYellow(s.neutralPalette.hue) ? 94 : s.variant === Variant.VIBRANT ? 90 : 92 : 25,
2489
+ isBackground: !0,
2490
+ chromaMultiplier: (s) => {
2491
+ if (s.platform === "phone") {
2492
+ if (s.variant === Variant.NEUTRAL)
2493
+ return 1.9;
2494
+ if (s.variant === Variant.TONAL_SPOT)
2495
+ return 1.5;
2496
+ if (s.variant === Variant.EXPRESSIVE)
2497
+ return Hct.isYellow(s.neutralPalette.hue) ? 1.95 : 1.45;
2498
+ if (s.variant === Variant.VIBRANT)
2499
+ return 1.22;
2500
+ }
2501
+ return 1;
2502
+ }
2503
+ });
2504
+ return extendSpecVersion(super.surfaceContainerHigh(), "2025", color2025);
2505
+ }
2506
+ surfaceContainerHighest() {
2507
+ const color2025 = DynamicColor.fromPalette({
2508
+ name: "surface_container_highest",
2509
+ palette: (s) => s.neutralPalette,
2510
+ tone: (s) => s.isDark ? 15 : Hct.isYellow(s.neutralPalette.hue) ? 92 : s.variant === Variant.VIBRANT ? 88 : 90,
2511
+ isBackground: !0,
2512
+ chromaMultiplier: (s) => s.variant === Variant.NEUTRAL ? 2.2 : s.variant === Variant.TONAL_SPOT ? 1.7 : s.variant === Variant.EXPRESSIVE ? Hct.isYellow(s.neutralPalette.hue) ? 2.3 : 1.6 : s.variant === Variant.VIBRANT ? 1.29 : 1
2513
+ });
2514
+ return extendSpecVersion(super.surfaceContainerHighest(), "2025", color2025);
2515
+ }
2516
+ onSurface() {
2517
+ const color2025 = DynamicColor.fromPalette({
2518
+ name: "on_surface",
2519
+ palette: (s) => s.neutralPalette,
2520
+ tone: (s) => s.variant === Variant.VIBRANT ? tMaxC(s.neutralPalette, 0, 100, 1.1) : DynamicColor.getInitialToneFromBackground((s2) => s2.platform === "phone" ? this.highestSurface(s2) : this.surfaceContainerHigh())(s),
2521
+ chromaMultiplier: (s) => {
2522
+ if (s.platform === "phone") {
2523
+ if (s.variant === Variant.NEUTRAL)
2524
+ return 2.2;
2525
+ if (s.variant === Variant.TONAL_SPOT)
2526
+ return 1.7;
2527
+ if (s.variant === Variant.EXPRESSIVE)
2528
+ return Hct.isYellow(s.neutralPalette.hue) ? s.isDark ? 3 : 2.3 : 1.6;
2529
+ }
2530
+ return 1;
2531
+ },
2532
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : this.surfaceContainerHigh(),
2533
+ contrastCurve: (s) => s.isDark && s.platform === "phone" ? getCurve(11) : getCurve(9)
2534
+ });
2535
+ return extendSpecVersion(super.onSurface(), "2025", color2025);
2536
+ }
2537
+ onSurfaceVariant() {
2538
+ const color2025 = DynamicColor.fromPalette({
2539
+ name: "on_surface_variant",
2540
+ palette: (s) => s.neutralPalette,
2541
+ chromaMultiplier: (s) => {
2542
+ if (s.platform === "phone") {
2543
+ if (s.variant === Variant.NEUTRAL)
2544
+ return 2.2;
2545
+ if (s.variant === Variant.TONAL_SPOT)
2546
+ return 1.7;
2547
+ if (s.variant === Variant.EXPRESSIVE)
2548
+ return Hct.isYellow(s.neutralPalette.hue) ? s.isDark ? 3 : 2.3 : 1.6;
2549
+ }
2550
+ return 1;
2551
+ },
2552
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : this.surfaceContainerHigh(),
2553
+ contrastCurve: (s) => s.platform === "phone" ? s.isDark ? getCurve(6) : getCurve(4.5) : getCurve(7)
2554
+ });
2555
+ return extendSpecVersion(super.onSurfaceVariant(), "2025", color2025);
2556
+ }
2557
+ outline() {
2558
+ const color2025 = DynamicColor.fromPalette({
2559
+ name: "outline",
2560
+ palette: (s) => s.neutralPalette,
2561
+ chromaMultiplier: (s) => {
2562
+ if (s.platform === "phone") {
2563
+ if (s.variant === Variant.NEUTRAL)
2564
+ return 2.2;
2565
+ if (s.variant === Variant.TONAL_SPOT)
2566
+ return 1.7;
2567
+ if (s.variant === Variant.EXPRESSIVE)
2568
+ return Hct.isYellow(s.neutralPalette.hue) ? s.isDark ? 3 : 2.3 : 1.6;
2569
+ }
2570
+ return 1;
2571
+ },
2572
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : this.surfaceContainerHigh(),
2573
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(3) : getCurve(4.5)
2574
+ });
2575
+ return extendSpecVersion(super.outline(), "2025", color2025);
2576
+ }
2577
+ outlineVariant() {
2578
+ const color2025 = DynamicColor.fromPalette({
2579
+ name: "outline_variant",
2580
+ palette: (s) => s.neutralPalette,
2581
+ chromaMultiplier: (s) => {
2582
+ if (s.platform === "phone") {
2583
+ if (s.variant === Variant.NEUTRAL)
2584
+ return 2.2;
2585
+ if (s.variant === Variant.TONAL_SPOT)
2586
+ return 1.7;
2587
+ if (s.variant === Variant.EXPRESSIVE)
2588
+ return Hct.isYellow(s.neutralPalette.hue) ? s.isDark ? 3 : 2.3 : 1.6;
2589
+ }
2590
+ return 1;
2591
+ },
2592
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : this.surfaceContainerHigh(),
2593
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(1.5) : getCurve(3)
2594
+ });
2595
+ return extendSpecVersion(super.outlineVariant(), "2025", color2025);
2596
+ }
2597
+ inverseSurface() {
2598
+ const color2025 = DynamicColor.fromPalette({
2599
+ name: "inverse_surface",
2600
+ palette: (s) => s.neutralPalette,
2601
+ tone: (s) => s.isDark ? 98 : 4,
2602
+ isBackground: !0
2603
+ });
2604
+ return extendSpecVersion(super.inverseSurface(), "2025", color2025);
2605
+ }
2606
+ inverseOnSurface() {
2607
+ const color2025 = DynamicColor.fromPalette({
2608
+ name: "inverse_on_surface",
2609
+ palette: (s) => s.neutralPalette,
2610
+ background: (s) => this.inverseSurface(),
2611
+ contrastCurve: (s) => getCurve(7)
2612
+ });
2613
+ return extendSpecVersion(super.inverseOnSurface(), "2025", color2025);
2614
+ }
2615
+ ////////////////////////////////////////////////////////////////
2616
+ // Primaries [P] //
2617
+ ////////////////////////////////////////////////////////////////
2618
+ primary() {
2619
+ const color2025 = DynamicColor.fromPalette({
2620
+ name: "primary",
2621
+ palette: (s) => s.primaryPalette,
2622
+ tone: (s) => s.variant === Variant.NEUTRAL ? s.platform === "phone" ? s.isDark ? 80 : 40 : 90 : s.variant === Variant.TONAL_SPOT ? s.platform === "phone" ? s.isDark ? 80 : tMaxC(s.primaryPalette) : tMaxC(s.primaryPalette, 0, 90) : s.variant === Variant.EXPRESSIVE ? s.platform === "phone" ? tMaxC(s.primaryPalette, 0, Hct.isYellow(s.primaryPalette.hue) ? 25 : Hct.isCyan(s.primaryPalette.hue) ? 88 : 98) : tMaxC(s.primaryPalette) : s.platform === "phone" ? tMaxC(s.primaryPalette, 0, Hct.isCyan(s.primaryPalette.hue) ? 88 : 98) : tMaxC(s.primaryPalette),
2623
+ isBackground: !0,
2624
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : this.surfaceContainerHigh(),
2625
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(4.5) : getCurve(7),
2626
+ toneDeltaPair: (s) => s.platform === "phone" ? new ToneDeltaPair(this.primaryContainer(), this.primary(), 5, "relative_lighter", !0, "farther") : void 0
2627
+ });
2628
+ return extendSpecVersion(super.primary(), "2025", color2025);
2629
+ }
2630
+ primaryDim() {
2631
+ return DynamicColor.fromPalette({
2632
+ name: "primary_dim",
2633
+ palette: (s) => s.primaryPalette,
2634
+ tone: (s) => s.variant === Variant.NEUTRAL ? 85 : s.variant === Variant.TONAL_SPOT ? tMaxC(s.primaryPalette, 0, 90) : tMaxC(s.primaryPalette),
2635
+ isBackground: !0,
2636
+ background: (s) => this.surfaceContainerHigh(),
2637
+ contrastCurve: (s) => getCurve(4.5),
2638
+ toneDeltaPair: (s) => new ToneDeltaPair(this.primaryDim(), this.primary(), 5, "darker", !0, "farther")
2639
+ });
2640
+ }
2641
+ onPrimary() {
2642
+ const color2025 = DynamicColor.fromPalette({
2643
+ name: "on_primary",
2644
+ palette: (s) => s.primaryPalette,
2645
+ background: (s) => s.platform === "phone" ? this.primary() : this.primaryDim(),
2646
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(6) : getCurve(7)
2647
+ });
2648
+ return extendSpecVersion(super.onPrimary(), "2025", color2025);
2649
+ }
2650
+ primaryContainer() {
2651
+ const color2025 = DynamicColor.fromPalette({
2652
+ name: "primary_container",
2653
+ palette: (s) => s.primaryPalette,
2654
+ tone: (s) => s.platform === "watch" ? 30 : s.variant === Variant.NEUTRAL ? s.isDark ? 30 : 90 : s.variant === Variant.TONAL_SPOT ? s.isDark ? tMinC(s.primaryPalette, 35, 93) : tMaxC(s.primaryPalette, 0, 90) : s.variant === Variant.EXPRESSIVE ? s.isDark ? tMaxC(s.primaryPalette, 30, 93) : tMaxC(s.primaryPalette, 78, Hct.isCyan(s.primaryPalette.hue) ? 88 : 90) : s.isDark ? tMinC(s.primaryPalette, 66, 93) : tMaxC(s.primaryPalette, 66, Hct.isCyan(s.primaryPalette.hue) ? 88 : 93),
2655
+ isBackground: !0,
2656
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : void 0,
2657
+ toneDeltaPair: (s) => s.platform === "phone" ? void 0 : new ToneDeltaPair(this.primaryContainer(), this.primaryDim(), 10, "darker", !0, "farther"),
2658
+ contrastCurve: (s) => s.platform === "phone" && s.contrastLevel > 0 ? getCurve(1.5) : void 0
2659
+ });
2660
+ return extendSpecVersion(super.primaryContainer(), "2025", color2025);
2661
+ }
2662
+ onPrimaryContainer() {
2663
+ const color2025 = DynamicColor.fromPalette({
2664
+ name: "on_primary_container",
2665
+ palette: (s) => s.primaryPalette,
2666
+ background: (s) => this.primaryContainer(),
2667
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(6) : getCurve(7)
2668
+ });
2669
+ return extendSpecVersion(super.onPrimaryContainer(), "2025", color2025);
2670
+ }
2671
+ primaryFixed() {
2672
+ const color2025 = DynamicColor.fromPalette({
2673
+ name: "primary_fixed",
2674
+ palette: (s) => s.primaryPalette,
2675
+ tone: (s) => {
2676
+ let tempS = Object.assign({}, s, { isDark: !1, contrastLevel: 0 });
2677
+ return this.primaryContainer().getTone(tempS);
2678
+ },
2679
+ isBackground: !0,
2680
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : void 0,
2681
+ contrastCurve: (s) => s.platform === "phone" && s.contrastLevel > 0 ? getCurve(1.5) : void 0
2682
+ });
2683
+ return extendSpecVersion(super.primaryFixed(), "2025", color2025);
2684
+ }
2685
+ primaryFixedDim() {
2686
+ const color2025 = DynamicColor.fromPalette({
2687
+ name: "primary_fixed_dim",
2688
+ palette: (s) => s.primaryPalette,
2689
+ tone: (s) => this.primaryFixed().getTone(s),
2690
+ isBackground: !0,
2691
+ toneDeltaPair: (s) => new ToneDeltaPair(this.primaryFixedDim(), this.primaryFixed(), 5, "darker", !0, "exact")
2692
+ });
2693
+ return extendSpecVersion(super.primaryFixedDim(), "2025", color2025);
2694
+ }
2695
+ onPrimaryFixed() {
2696
+ const color2025 = DynamicColor.fromPalette({
2697
+ name: "on_primary_fixed",
2698
+ palette: (s) => s.primaryPalette,
2699
+ background: (s) => this.primaryFixedDim(),
2700
+ contrastCurve: (s) => getCurve(7)
2701
+ });
2702
+ return extendSpecVersion(super.onPrimaryFixed(), "2025", color2025);
2703
+ }
2704
+ onPrimaryFixedVariant() {
2705
+ const color2025 = DynamicColor.fromPalette({
2706
+ name: "on_primary_fixed_variant",
2707
+ palette: (s) => s.primaryPalette,
2708
+ background: (s) => this.primaryFixedDim(),
2709
+ contrastCurve: (s) => getCurve(4.5)
2710
+ });
2711
+ return extendSpecVersion(super.onPrimaryFixedVariant(), "2025", color2025);
2712
+ }
2713
+ inversePrimary() {
2714
+ const color2025 = DynamicColor.fromPalette({
2715
+ name: "inverse_primary",
2716
+ palette: (s) => s.primaryPalette,
2717
+ tone: (s) => tMaxC(s.primaryPalette),
2718
+ background: (s) => this.inverseSurface(),
2719
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(6) : getCurve(7)
2720
+ });
2721
+ return extendSpecVersion(super.inversePrimary(), "2025", color2025);
2722
+ }
2723
+ ////////////////////////////////////////////////////////////////
2724
+ // Secondaries [Q] //
2725
+ ////////////////////////////////////////////////////////////////
2726
+ secondary() {
2727
+ const color2025 = DynamicColor.fromPalette({
2728
+ name: "secondary",
2729
+ palette: (s) => s.secondaryPalette,
2730
+ tone: (s) => s.platform === "watch" ? s.variant === Variant.NEUTRAL ? 90 : tMaxC(s.secondaryPalette, 0, 90) : s.variant === Variant.NEUTRAL ? s.isDark ? tMinC(s.secondaryPalette, 0, 98) : tMaxC(s.secondaryPalette) : s.variant === Variant.VIBRANT ? tMaxC(s.secondaryPalette, 0, s.isDark ? 90 : 98) : s.isDark ? 80 : tMaxC(s.secondaryPalette),
2731
+ isBackground: !0,
2732
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : this.surfaceContainerHigh(),
2733
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(4.5) : getCurve(7),
2734
+ toneDeltaPair: (s) => s.platform === "phone" ? new ToneDeltaPair(this.secondaryContainer(), this.secondary(), 5, "relative_lighter", !0, "farther") : void 0
2735
+ });
2736
+ return extendSpecVersion(super.secondary(), "2025", color2025);
2737
+ }
2738
+ secondaryDim() {
2739
+ return DynamicColor.fromPalette({
2740
+ name: "secondary_dim",
2741
+ palette: (s) => s.secondaryPalette,
2742
+ tone: (s) => s.variant === Variant.NEUTRAL ? 85 : tMaxC(s.secondaryPalette, 0, 90),
2743
+ isBackground: !0,
2744
+ background: (s) => this.surfaceContainerHigh(),
2745
+ contrastCurve: (s) => getCurve(4.5),
2746
+ toneDeltaPair: (s) => new ToneDeltaPair(this.secondaryDim(), this.secondary(), 5, "darker", !0, "farther")
2747
+ });
2748
+ }
2749
+ onSecondary() {
2750
+ const color2025 = DynamicColor.fromPalette({
2751
+ name: "on_secondary",
2752
+ palette: (s) => s.secondaryPalette,
2753
+ background: (s) => s.platform === "phone" ? this.secondary() : this.secondaryDim(),
2754
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(6) : getCurve(7)
2755
+ });
2756
+ return extendSpecVersion(super.onSecondary(), "2025", color2025);
2757
+ }
2758
+ secondaryContainer() {
2759
+ const color2025 = DynamicColor.fromPalette({
2760
+ name: "secondary_container",
2761
+ palette: (s) => s.secondaryPalette,
2762
+ tone: (s) => s.platform === "watch" ? 30 : s.variant === Variant.VIBRANT ? s.isDark ? tMinC(s.secondaryPalette, 30, 40) : tMaxC(s.secondaryPalette, 84, 90) : s.variant === Variant.EXPRESSIVE ? s.isDark ? 15 : tMaxC(s.secondaryPalette, 90, 95) : s.isDark ? 25 : 90,
2763
+ isBackground: !0,
2764
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : void 0,
2765
+ toneDeltaPair: (s) => s.platform === "watch" ? new ToneDeltaPair(this.secondaryContainer(), this.secondaryDim(), 10, "darker", !0, "farther") : void 0,
2766
+ contrastCurve: (s) => s.platform === "phone" && s.contrastLevel > 0 ? getCurve(1.5) : void 0
2767
+ });
2768
+ return extendSpecVersion(super.secondaryContainer(), "2025", color2025);
2769
+ }
2770
+ onSecondaryContainer() {
2771
+ const color2025 = DynamicColor.fromPalette({
2772
+ name: "on_secondary_container",
2773
+ palette: (s) => s.secondaryPalette,
2774
+ background: (s) => this.secondaryContainer(),
2775
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(6) : getCurve(7)
2776
+ });
2777
+ return extendSpecVersion(super.onSecondaryContainer(), "2025", color2025);
2778
+ }
2779
+ secondaryFixed() {
2780
+ const color2025 = DynamicColor.fromPalette({
2781
+ name: "secondary_fixed",
2782
+ palette: (s) => s.secondaryPalette,
2783
+ tone: (s) => {
2784
+ let tempS = Object.assign({}, s, { isDark: !1, contrastLevel: 0 });
2785
+ return this.secondaryContainer().getTone(tempS);
2786
+ },
2787
+ isBackground: !0,
2788
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : void 0,
2789
+ contrastCurve: (s) => s.platform === "phone" && s.contrastLevel > 0 ? getCurve(1.5) : void 0
2790
+ });
2791
+ return extendSpecVersion(super.secondaryFixed(), "2025", color2025);
2792
+ }
2793
+ secondaryFixedDim() {
2794
+ const color2025 = DynamicColor.fromPalette({
2795
+ name: "secondary_fixed_dim",
2796
+ palette: (s) => s.secondaryPalette,
2797
+ tone: (s) => this.secondaryFixed().getTone(s),
2798
+ isBackground: !0,
2799
+ toneDeltaPair: (s) => new ToneDeltaPair(this.secondaryFixedDim(), this.secondaryFixed(), 5, "darker", !0, "exact")
2800
+ });
2801
+ return extendSpecVersion(super.secondaryFixedDim(), "2025", color2025);
2802
+ }
2803
+ onSecondaryFixed() {
2804
+ const color2025 = DynamicColor.fromPalette({
2805
+ name: "on_secondary_fixed",
2806
+ palette: (s) => s.secondaryPalette,
2807
+ background: (s) => this.secondaryFixedDim(),
2808
+ contrastCurve: (s) => getCurve(7)
2809
+ });
2810
+ return extendSpecVersion(super.onSecondaryFixed(), "2025", color2025);
2811
+ }
2812
+ onSecondaryFixedVariant() {
2813
+ const color2025 = DynamicColor.fromPalette({
2814
+ name: "on_secondary_fixed_variant",
2815
+ palette: (s) => s.secondaryPalette,
2816
+ background: (s) => this.secondaryFixedDim(),
2817
+ contrastCurve: (s) => getCurve(4.5)
2818
+ });
2819
+ return extendSpecVersion(super.onSecondaryFixedVariant(), "2025", color2025);
2820
+ }
2821
+ ////////////////////////////////////////////////////////////////
2822
+ // Tertiaries [T] //
2823
+ ////////////////////////////////////////////////////////////////
2824
+ tertiary() {
2825
+ const color2025 = DynamicColor.fromPalette({
2826
+ name: "tertiary",
2827
+ palette: (s) => s.tertiaryPalette,
2828
+ tone: (s) => s.platform === "watch" ? s.variant === Variant.TONAL_SPOT ? tMaxC(s.tertiaryPalette, 0, 90) : tMaxC(s.tertiaryPalette) : s.variant === Variant.EXPRESSIVE || s.variant === Variant.VIBRANT ? tMaxC(s.tertiaryPalette, 0, Hct.isCyan(s.tertiaryPalette.hue) ? 88 : s.isDark ? 98 : 100) : s.isDark ? tMaxC(s.tertiaryPalette, 0, 98) : tMaxC(s.tertiaryPalette),
2829
+ isBackground: !0,
2830
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : this.surfaceContainerHigh(),
2831
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(4.5) : getCurve(7),
2832
+ toneDeltaPair: (s) => s.platform === "phone" ? new ToneDeltaPair(this.tertiaryContainer(), this.tertiary(), 5, "relative_lighter", !0, "farther") : void 0
2833
+ });
2834
+ return extendSpecVersion(super.tertiary(), "2025", color2025);
2835
+ }
2836
+ tertiaryDim() {
2837
+ return DynamicColor.fromPalette({
2838
+ name: "tertiary_dim",
2839
+ palette: (s) => s.tertiaryPalette,
2840
+ tone: (s) => s.variant === Variant.TONAL_SPOT ? tMaxC(s.tertiaryPalette, 0, 90) : tMaxC(s.tertiaryPalette),
2841
+ isBackground: !0,
2842
+ background: (s) => this.surfaceContainerHigh(),
2843
+ contrastCurve: (s) => getCurve(4.5),
2844
+ toneDeltaPair: (s) => new ToneDeltaPair(this.tertiaryDim(), this.tertiary(), 5, "darker", !0, "farther")
2845
+ });
2846
+ }
2847
+ onTertiary() {
2848
+ const color2025 = DynamicColor.fromPalette({
2849
+ name: "on_tertiary",
2850
+ palette: (s) => s.tertiaryPalette,
2851
+ background: (s) => s.platform === "phone" ? this.tertiary() : this.tertiaryDim(),
2852
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(6) : getCurve(7)
2853
+ });
2854
+ return extendSpecVersion(super.onTertiary(), "2025", color2025);
2855
+ }
2856
+ tertiaryContainer() {
2857
+ const color2025 = DynamicColor.fromPalette({
2858
+ name: "tertiary_container",
2859
+ palette: (s) => s.tertiaryPalette,
2860
+ tone: (s) => s.platform === "watch" ? s.variant === Variant.TONAL_SPOT ? tMaxC(s.tertiaryPalette, 0, 90) : tMaxC(s.tertiaryPalette) : s.variant === Variant.NEUTRAL ? s.isDark ? tMaxC(s.tertiaryPalette, 0, 93) : tMaxC(s.tertiaryPalette, 0, 96) : s.variant === Variant.TONAL_SPOT ? tMaxC(s.tertiaryPalette, 0, s.isDark ? 93 : 100) : s.variant === Variant.EXPRESSIVE ? tMaxC(s.tertiaryPalette, 75, Hct.isCyan(s.tertiaryPalette.hue) ? 88 : s.isDark ? 93 : 100) : s.isDark ? tMaxC(s.tertiaryPalette, 0, 93) : tMaxC(s.tertiaryPalette, 72, 100),
2861
+ isBackground: !0,
2862
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : void 0,
2863
+ toneDeltaPair: (s) => s.platform === "watch" ? new ToneDeltaPair(this.tertiaryContainer(), this.tertiaryDim(), 10, "darker", !0, "farther") : void 0,
2864
+ contrastCurve: (s) => s.platform === "phone" && s.contrastLevel > 0 ? getCurve(1.5) : void 0
2865
+ });
2866
+ return extendSpecVersion(super.tertiaryContainer(), "2025", color2025);
2867
+ }
2868
+ onTertiaryContainer() {
2869
+ const color2025 = DynamicColor.fromPalette({
2870
+ name: "on_tertiary_container",
2871
+ palette: (s) => s.tertiaryPalette,
2872
+ background: (s) => this.tertiaryContainer(),
2873
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(6) : getCurve(7)
2874
+ });
2875
+ return extendSpecVersion(super.onTertiaryContainer(), "2025", color2025);
2876
+ }
2877
+ tertiaryFixed() {
2878
+ const color2025 = DynamicColor.fromPalette({
2879
+ name: "tertiary_fixed",
2880
+ palette: (s) => s.tertiaryPalette,
2881
+ tone: (s) => {
2882
+ let tempS = Object.assign({}, s, { isDark: !1, contrastLevel: 0 });
2883
+ return this.tertiaryContainer().getTone(tempS);
2884
+ },
2885
+ isBackground: !0,
2886
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : void 0,
2887
+ contrastCurve: (s) => s.platform === "phone" && s.contrastLevel > 0 ? getCurve(1.5) : void 0
2888
+ });
2889
+ return extendSpecVersion(super.tertiaryFixed(), "2025", color2025);
2890
+ }
2891
+ tertiaryFixedDim() {
2892
+ const color2025 = DynamicColor.fromPalette({
2893
+ name: "tertiary_fixed_dim",
2894
+ palette: (s) => s.tertiaryPalette,
2895
+ tone: (s) => this.tertiaryFixed().getTone(s),
2896
+ isBackground: !0,
2897
+ toneDeltaPair: (s) => new ToneDeltaPair(this.tertiaryFixedDim(), this.tertiaryFixed(), 5, "darker", !0, "exact")
2898
+ });
2899
+ return extendSpecVersion(super.tertiaryFixedDim(), "2025", color2025);
2900
+ }
2901
+ onTertiaryFixed() {
2902
+ const color2025 = DynamicColor.fromPalette({
2903
+ name: "on_tertiary_fixed",
2904
+ palette: (s) => s.tertiaryPalette,
2905
+ background: (s) => this.tertiaryFixedDim(),
2906
+ contrastCurve: (s) => getCurve(7)
2907
+ });
2908
+ return extendSpecVersion(super.onTertiaryFixed(), "2025", color2025);
2909
+ }
2910
+ onTertiaryFixedVariant() {
2911
+ const color2025 = DynamicColor.fromPalette({
2912
+ name: "on_tertiary_fixed_variant",
2913
+ palette: (s) => s.tertiaryPalette,
2914
+ background: (s) => this.tertiaryFixedDim(),
2915
+ contrastCurve: (s) => getCurve(4.5)
2916
+ });
2917
+ return extendSpecVersion(super.onTertiaryFixedVariant(), "2025", color2025);
2918
+ }
2919
+ ////////////////////////////////////////////////////////////////
2920
+ // Errors [E] //
2921
+ ////////////////////////////////////////////////////////////////
2922
+ error() {
2923
+ const color2025 = DynamicColor.fromPalette({
2924
+ name: "error",
2925
+ palette: (s) => s.errorPalette,
2926
+ tone: (s) => s.platform === "phone" ? s.isDark ? tMinC(s.errorPalette, 0, 98) : tMaxC(s.errorPalette) : tMinC(s.errorPalette),
2927
+ isBackground: !0,
2928
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : this.surfaceContainerHigh(),
2929
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(4.5) : getCurve(7),
2930
+ toneDeltaPair: (s) => s.platform === "phone" ? new ToneDeltaPair(this.errorContainer(), this.error(), 5, "relative_lighter", !0, "farther") : void 0
2931
+ });
2932
+ return extendSpecVersion(super.error(), "2025", color2025);
2933
+ }
2934
+ errorDim() {
2935
+ return DynamicColor.fromPalette({
2936
+ name: "error_dim",
2937
+ palette: (s) => s.errorPalette,
2938
+ tone: (s) => tMinC(s.errorPalette),
2939
+ isBackground: !0,
2940
+ background: (s) => this.surfaceContainerHigh(),
2941
+ contrastCurve: (s) => getCurve(4.5),
2942
+ toneDeltaPair: (s) => new ToneDeltaPair(this.errorDim(), this.error(), 5, "darker", !0, "farther")
2943
+ });
2944
+ }
2945
+ onError() {
2946
+ const color2025 = DynamicColor.fromPalette({
2947
+ name: "on_error",
2948
+ palette: (s) => s.errorPalette,
2949
+ background: (s) => s.platform === "phone" ? this.error() : this.errorDim(),
2950
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(6) : getCurve(7)
2951
+ });
2952
+ return extendSpecVersion(super.onError(), "2025", color2025);
2953
+ }
2954
+ errorContainer() {
2955
+ const color2025 = DynamicColor.fromPalette({
2956
+ name: "error_container",
2957
+ palette: (s) => s.errorPalette,
2958
+ tone: (s) => s.platform === "watch" ? 30 : s.isDark ? tMinC(s.errorPalette, 30, 93) : tMaxC(s.errorPalette, 0, 90),
2959
+ isBackground: !0,
2960
+ background: (s) => s.platform === "phone" ? this.highestSurface(s) : void 0,
2961
+ toneDeltaPair: (s) => s.platform === "watch" ? new ToneDeltaPair(this.errorContainer(), this.errorDim(), 10, "darker", !0, "farther") : void 0,
2962
+ contrastCurve: (s) => s.platform === "phone" && s.contrastLevel > 0 ? getCurve(1.5) : void 0
2963
+ });
2964
+ return extendSpecVersion(super.errorContainer(), "2025", color2025);
2965
+ }
2966
+ onErrorContainer() {
2967
+ const color2025 = DynamicColor.fromPalette({
2968
+ name: "on_error_container",
2969
+ palette: (s) => s.errorPalette,
2970
+ background: (s) => this.errorContainer(),
2971
+ contrastCurve: (s) => s.platform === "phone" ? getCurve(4.5) : getCurve(7)
2972
+ });
2973
+ return extendSpecVersion(super.onErrorContainer(), "2025", color2025);
2974
+ }
2975
+ /////////////////////////////////////////////////////////////////
2976
+ // Remapped Colors //
2977
+ /////////////////////////////////////////////////////////////////
2978
+ surfaceVariant() {
2979
+ const color2025 = Object.assign(this.surfaceContainerHighest().clone(), { name: "surface_variant" });
2980
+ return extendSpecVersion(super.surfaceVariant(), "2025", color2025);
2981
+ }
2982
+ surfaceTint() {
2983
+ const color2025 = Object.assign(this.primary().clone(), { name: "surface_tint" });
2984
+ return extendSpecVersion(super.surfaceTint(), "2025", color2025);
2985
+ }
2986
+ background() {
2987
+ const color2025 = Object.assign(this.surface().clone(), { name: "background" });
2988
+ return extendSpecVersion(super.background(), "2025", color2025);
2989
+ }
2990
+ onBackground() {
2991
+ const color2025 = Object.assign(this.onSurface().clone(), {
2992
+ name: "on_background",
2993
+ tone: (s) => s.platform === "watch" ? 100 : this.onSurface().getTone(s)
2994
+ });
2995
+ return extendSpecVersion(super.onBackground(), "2025", color2025);
2996
+ }
2997
+ }
2998
+ /**
2999
+ * @license
3000
+ * Copyright 2022 Google LLC
3001
+ *
3002
+ * Licensed under the Apache License, Version 2.0 (the "License");
3003
+ * you may not use this file except in compliance with the License.
3004
+ * You may obtain a copy of the License at
3005
+ *
3006
+ * http://www.apache.org/licenses/LICENSE-2.0
3007
+ *
3008
+ * Unless required by applicable law or agreed to in writing, software
3009
+ * distributed under the License is distributed on an "AS IS" BASIS,
3010
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3011
+ * See the License for the specific language governing permissions and
3012
+ * limitations under the License.
3013
+ */
3014
+ class MaterialDynamicColors {
3015
+ constructor() {
3016
+ this.allColors = [
3017
+ this.background(),
3018
+ this.onBackground(),
3019
+ this.surface(),
3020
+ this.surfaceDim(),
3021
+ this.surfaceBright(),
3022
+ this.surfaceContainerLowest(),
3023
+ this.surfaceContainerLow(),
3024
+ this.surfaceContainer(),
3025
+ this.surfaceContainerHigh(),
3026
+ this.surfaceContainerHighest(),
3027
+ this.onSurface(),
3028
+ this.onSurfaceVariant(),
3029
+ this.outline(),
3030
+ this.outlineVariant(),
3031
+ this.inverseSurface(),
3032
+ this.inverseOnSurface(),
3033
+ this.primary(),
3034
+ this.primaryDim(),
3035
+ this.onPrimary(),
3036
+ this.primaryContainer(),
3037
+ this.onPrimaryContainer(),
3038
+ this.primaryFixed(),
3039
+ this.primaryFixedDim(),
3040
+ this.onPrimaryFixed(),
3041
+ this.onPrimaryFixedVariant(),
3042
+ this.inversePrimary(),
3043
+ this.secondary(),
3044
+ this.secondaryDim(),
3045
+ this.onSecondary(),
3046
+ this.secondaryContainer(),
3047
+ this.onSecondaryContainer(),
3048
+ this.secondaryFixed(),
3049
+ this.secondaryFixedDim(),
3050
+ this.onSecondaryFixed(),
3051
+ this.onSecondaryFixedVariant(),
3052
+ this.tertiary(),
3053
+ this.tertiaryDim(),
3054
+ this.onTertiary(),
3055
+ this.tertiaryContainer(),
3056
+ this.onTertiaryContainer(),
3057
+ this.tertiaryFixed(),
3058
+ this.tertiaryFixedDim(),
3059
+ this.onTertiaryFixed(),
3060
+ this.onTertiaryFixedVariant(),
3061
+ this.error(),
3062
+ this.errorDim(),
3063
+ this.onError(),
3064
+ this.errorContainer(),
3065
+ this.onErrorContainer()
3066
+ ].filter((c) => c !== void 0);
3067
+ }
3068
+ highestSurface(s) {
3069
+ return MaterialDynamicColors.colorSpec.highestSurface(s);
3070
+ }
3071
+ ////////////////////////////////////////////////////////////////
3072
+ // Main Palettes //
3073
+ ////////////////////////////////////////////////////////////////
3074
+ primaryPaletteKeyColor() {
3075
+ return MaterialDynamicColors.colorSpec.primaryPaletteKeyColor();
3076
+ }
3077
+ secondaryPaletteKeyColor() {
3078
+ return MaterialDynamicColors.colorSpec.secondaryPaletteKeyColor();
3079
+ }
3080
+ tertiaryPaletteKeyColor() {
3081
+ return MaterialDynamicColors.colorSpec.tertiaryPaletteKeyColor();
3082
+ }
3083
+ neutralPaletteKeyColor() {
3084
+ return MaterialDynamicColors.colorSpec.neutralPaletteKeyColor();
3085
+ }
3086
+ neutralVariantPaletteKeyColor() {
3087
+ return MaterialDynamicColors.colorSpec.neutralVariantPaletteKeyColor();
3088
+ }
3089
+ errorPaletteKeyColor() {
3090
+ return MaterialDynamicColors.colorSpec.errorPaletteKeyColor();
3091
+ }
3092
+ ////////////////////////////////////////////////////////////////
3093
+ // Surfaces [S] //
3094
+ ////////////////////////////////////////////////////////////////
3095
+ background() {
3096
+ return MaterialDynamicColors.colorSpec.background();
3097
+ }
3098
+ onBackground() {
3099
+ return MaterialDynamicColors.colorSpec.onBackground();
3100
+ }
3101
+ surface() {
3102
+ return MaterialDynamicColors.colorSpec.surface();
3103
+ }
3104
+ surfaceDim() {
3105
+ return MaterialDynamicColors.colorSpec.surfaceDim();
3106
+ }
3107
+ surfaceBright() {
3108
+ return MaterialDynamicColors.colorSpec.surfaceBright();
3109
+ }
3110
+ surfaceContainerLowest() {
3111
+ return MaterialDynamicColors.colorSpec.surfaceContainerLowest();
3112
+ }
3113
+ surfaceContainerLow() {
3114
+ return MaterialDynamicColors.colorSpec.surfaceContainerLow();
3115
+ }
3116
+ surfaceContainer() {
3117
+ return MaterialDynamicColors.colorSpec.surfaceContainer();
3118
+ }
3119
+ surfaceContainerHigh() {
3120
+ return MaterialDynamicColors.colorSpec.surfaceContainerHigh();
3121
+ }
3122
+ surfaceContainerHighest() {
3123
+ return MaterialDynamicColors.colorSpec.surfaceContainerHighest();
3124
+ }
3125
+ onSurface() {
3126
+ return MaterialDynamicColors.colorSpec.onSurface();
3127
+ }
3128
+ surfaceVariant() {
3129
+ return MaterialDynamicColors.colorSpec.surfaceVariant();
3130
+ }
3131
+ onSurfaceVariant() {
3132
+ return MaterialDynamicColors.colorSpec.onSurfaceVariant();
3133
+ }
3134
+ outline() {
3135
+ return MaterialDynamicColors.colorSpec.outline();
3136
+ }
3137
+ outlineVariant() {
3138
+ return MaterialDynamicColors.colorSpec.outlineVariant();
3139
+ }
3140
+ inverseSurface() {
3141
+ return MaterialDynamicColors.colorSpec.inverseSurface();
3142
+ }
3143
+ inverseOnSurface() {
3144
+ return MaterialDynamicColors.colorSpec.inverseOnSurface();
3145
+ }
3146
+ shadow() {
3147
+ return MaterialDynamicColors.colorSpec.shadow();
3148
+ }
3149
+ scrim() {
3150
+ return MaterialDynamicColors.colorSpec.scrim();
3151
+ }
3152
+ surfaceTint() {
3153
+ return MaterialDynamicColors.colorSpec.surfaceTint();
3154
+ }
3155
+ ////////////////////////////////////////////////////////////////
3156
+ // Primaries [P] //
3157
+ ////////////////////////////////////////////////////////////////
3158
+ primary() {
3159
+ return MaterialDynamicColors.colorSpec.primary();
3160
+ }
3161
+ primaryDim() {
3162
+ return MaterialDynamicColors.colorSpec.primaryDim();
3163
+ }
3164
+ onPrimary() {
3165
+ return MaterialDynamicColors.colorSpec.onPrimary();
3166
+ }
3167
+ primaryContainer() {
3168
+ return MaterialDynamicColors.colorSpec.primaryContainer();
3169
+ }
3170
+ onPrimaryContainer() {
3171
+ return MaterialDynamicColors.colorSpec.onPrimaryContainer();
3172
+ }
3173
+ inversePrimary() {
3174
+ return MaterialDynamicColors.colorSpec.inversePrimary();
3175
+ }
3176
+ /////////////////////////////////////////////////////////////////
3177
+ // Primary Fixed [PF] //
3178
+ /////////////////////////////////////////////////////////////////
3179
+ primaryFixed() {
3180
+ return MaterialDynamicColors.colorSpec.primaryFixed();
3181
+ }
3182
+ primaryFixedDim() {
3183
+ return MaterialDynamicColors.colorSpec.primaryFixedDim();
3184
+ }
3185
+ onPrimaryFixed() {
3186
+ return MaterialDynamicColors.colorSpec.onPrimaryFixed();
3187
+ }
3188
+ onPrimaryFixedVariant() {
3189
+ return MaterialDynamicColors.colorSpec.onPrimaryFixedVariant();
3190
+ }
3191
+ ////////////////////////////////////////////////////////////////
3192
+ // Secondaries [Q] //
3193
+ ////////////////////////////////////////////////////////////////
3194
+ secondary() {
3195
+ return MaterialDynamicColors.colorSpec.secondary();
3196
+ }
3197
+ secondaryDim() {
3198
+ return MaterialDynamicColors.colorSpec.secondaryDim();
3199
+ }
3200
+ onSecondary() {
3201
+ return MaterialDynamicColors.colorSpec.onSecondary();
3202
+ }
3203
+ secondaryContainer() {
3204
+ return MaterialDynamicColors.colorSpec.secondaryContainer();
3205
+ }
3206
+ onSecondaryContainer() {
3207
+ return MaterialDynamicColors.colorSpec.onSecondaryContainer();
3208
+ }
3209
+ /////////////////////////////////////////////////////////////////
3210
+ // Secondary Fixed [QF] //
3211
+ /////////////////////////////////////////////////////////////////
3212
+ secondaryFixed() {
3213
+ return MaterialDynamicColors.colorSpec.secondaryFixed();
3214
+ }
3215
+ secondaryFixedDim() {
3216
+ return MaterialDynamicColors.colorSpec.secondaryFixedDim();
3217
+ }
3218
+ onSecondaryFixed() {
3219
+ return MaterialDynamicColors.colorSpec.onSecondaryFixed();
3220
+ }
3221
+ onSecondaryFixedVariant() {
3222
+ return MaterialDynamicColors.colorSpec.onSecondaryFixedVariant();
3223
+ }
3224
+ ////////////////////////////////////////////////////////////////
3225
+ // Tertiaries [T] //
3226
+ ////////////////////////////////////////////////////////////////
3227
+ tertiary() {
3228
+ return MaterialDynamicColors.colorSpec.tertiary();
3229
+ }
3230
+ tertiaryDim() {
3231
+ return MaterialDynamicColors.colorSpec.tertiaryDim();
3232
+ }
3233
+ onTertiary() {
3234
+ return MaterialDynamicColors.colorSpec.onTertiary();
3235
+ }
3236
+ tertiaryContainer() {
3237
+ return MaterialDynamicColors.colorSpec.tertiaryContainer();
3238
+ }
3239
+ onTertiaryContainer() {
3240
+ return MaterialDynamicColors.colorSpec.onTertiaryContainer();
3241
+ }
3242
+ /////////////////////////////////////////////////////////////////
3243
+ // Tertiary Fixed [TF] //
3244
+ /////////////////////////////////////////////////////////////////
3245
+ tertiaryFixed() {
3246
+ return MaterialDynamicColors.colorSpec.tertiaryFixed();
3247
+ }
3248
+ tertiaryFixedDim() {
3249
+ return MaterialDynamicColors.colorSpec.tertiaryFixedDim();
3250
+ }
3251
+ onTertiaryFixed() {
3252
+ return MaterialDynamicColors.colorSpec.onTertiaryFixed();
3253
+ }
3254
+ onTertiaryFixedVariant() {
3255
+ return MaterialDynamicColors.colorSpec.onTertiaryFixedVariant();
3256
+ }
3257
+ ////////////////////////////////////////////////////////////////
3258
+ // Errors [E] //
3259
+ ////////////////////////////////////////////////////////////////
3260
+ error() {
3261
+ return MaterialDynamicColors.colorSpec.error();
3262
+ }
3263
+ errorDim() {
3264
+ return MaterialDynamicColors.colorSpec.errorDim();
3265
+ }
3266
+ onError() {
3267
+ return MaterialDynamicColors.colorSpec.onError();
3268
+ }
3269
+ errorContainer() {
3270
+ return MaterialDynamicColors.colorSpec.errorContainer();
3271
+ }
3272
+ onErrorContainer() {
3273
+ return MaterialDynamicColors.colorSpec.onErrorContainer();
3274
+ }
3275
+ // Static variables are deprecated. Use the instance methods to get correct
3276
+ // specs based on request.
3277
+ /** @deprecated Use highestSurface() instead. */
3278
+ static highestSurface(s) {
3279
+ return MaterialDynamicColors.colorSpec.highestSurface(s);
3280
+ }
3281
+ }
3282
+ MaterialDynamicColors.contentAccentToneDelta = 15;
3283
+ MaterialDynamicColors.colorSpec = new ColorSpecDelegateImpl2025();
3284
+ MaterialDynamicColors.primaryPaletteKeyColor = MaterialDynamicColors.colorSpec.primaryPaletteKeyColor();
3285
+ MaterialDynamicColors.secondaryPaletteKeyColor = MaterialDynamicColors.colorSpec.secondaryPaletteKeyColor();
3286
+ MaterialDynamicColors.tertiaryPaletteKeyColor = MaterialDynamicColors.colorSpec.tertiaryPaletteKeyColor();
3287
+ MaterialDynamicColors.neutralPaletteKeyColor = MaterialDynamicColors.colorSpec.neutralPaletteKeyColor();
3288
+ MaterialDynamicColors.neutralVariantPaletteKeyColor = MaterialDynamicColors.colorSpec.neutralVariantPaletteKeyColor();
3289
+ MaterialDynamicColors.background = MaterialDynamicColors.colorSpec.background();
3290
+ MaterialDynamicColors.onBackground = MaterialDynamicColors.colorSpec.onBackground();
3291
+ MaterialDynamicColors.surface = MaterialDynamicColors.colorSpec.surface();
3292
+ MaterialDynamicColors.surfaceDim = MaterialDynamicColors.colorSpec.surfaceDim();
3293
+ MaterialDynamicColors.surfaceBright = MaterialDynamicColors.colorSpec.surfaceBright();
3294
+ MaterialDynamicColors.surfaceContainerLowest = MaterialDynamicColors.colorSpec.surfaceContainerLowest();
3295
+ MaterialDynamicColors.surfaceContainerLow = MaterialDynamicColors.colorSpec.surfaceContainerLow();
3296
+ MaterialDynamicColors.surfaceContainer = MaterialDynamicColors.colorSpec.surfaceContainer();
3297
+ MaterialDynamicColors.surfaceContainerHigh = MaterialDynamicColors.colorSpec.surfaceContainerHigh();
3298
+ MaterialDynamicColors.surfaceContainerHighest = MaterialDynamicColors.colorSpec.surfaceContainerHighest();
3299
+ MaterialDynamicColors.onSurface = MaterialDynamicColors.colorSpec.onSurface();
3300
+ MaterialDynamicColors.surfaceVariant = MaterialDynamicColors.colorSpec.surfaceVariant();
3301
+ MaterialDynamicColors.onSurfaceVariant = MaterialDynamicColors.colorSpec.onSurfaceVariant();
3302
+ MaterialDynamicColors.inverseSurface = MaterialDynamicColors.colorSpec.inverseSurface();
3303
+ MaterialDynamicColors.inverseOnSurface = MaterialDynamicColors.colorSpec.inverseOnSurface();
3304
+ MaterialDynamicColors.outline = MaterialDynamicColors.colorSpec.outline();
3305
+ MaterialDynamicColors.outlineVariant = MaterialDynamicColors.colorSpec.outlineVariant();
3306
+ MaterialDynamicColors.shadow = MaterialDynamicColors.colorSpec.shadow();
3307
+ MaterialDynamicColors.scrim = MaterialDynamicColors.colorSpec.scrim();
3308
+ MaterialDynamicColors.surfaceTint = MaterialDynamicColors.colorSpec.surfaceTint();
3309
+ MaterialDynamicColors.primary = MaterialDynamicColors.colorSpec.primary();
3310
+ MaterialDynamicColors.onPrimary = MaterialDynamicColors.colorSpec.onPrimary();
3311
+ MaterialDynamicColors.primaryContainer = MaterialDynamicColors.colorSpec.primaryContainer();
3312
+ MaterialDynamicColors.onPrimaryContainer = MaterialDynamicColors.colorSpec.onPrimaryContainer();
3313
+ MaterialDynamicColors.inversePrimary = MaterialDynamicColors.colorSpec.inversePrimary();
3314
+ MaterialDynamicColors.secondary = MaterialDynamicColors.colorSpec.secondary();
3315
+ MaterialDynamicColors.onSecondary = MaterialDynamicColors.colorSpec.onSecondary();
3316
+ MaterialDynamicColors.secondaryContainer = MaterialDynamicColors.colorSpec.secondaryContainer();
3317
+ MaterialDynamicColors.onSecondaryContainer = MaterialDynamicColors.colorSpec.onSecondaryContainer();
3318
+ MaterialDynamicColors.tertiary = MaterialDynamicColors.colorSpec.tertiary();
3319
+ MaterialDynamicColors.onTertiary = MaterialDynamicColors.colorSpec.onTertiary();
3320
+ MaterialDynamicColors.tertiaryContainer = MaterialDynamicColors.colorSpec.tertiaryContainer();
3321
+ MaterialDynamicColors.onTertiaryContainer = MaterialDynamicColors.colorSpec.onTertiaryContainer();
3322
+ MaterialDynamicColors.error = MaterialDynamicColors.colorSpec.error();
3323
+ MaterialDynamicColors.onError = MaterialDynamicColors.colorSpec.onError();
3324
+ MaterialDynamicColors.errorContainer = MaterialDynamicColors.colorSpec.errorContainer();
3325
+ MaterialDynamicColors.onErrorContainer = MaterialDynamicColors.colorSpec.onErrorContainer();
3326
+ MaterialDynamicColors.primaryFixed = MaterialDynamicColors.colorSpec.primaryFixed();
3327
+ MaterialDynamicColors.primaryFixedDim = MaterialDynamicColors.colorSpec.primaryFixedDim();
3328
+ MaterialDynamicColors.onPrimaryFixed = MaterialDynamicColors.colorSpec.onPrimaryFixed();
3329
+ MaterialDynamicColors.onPrimaryFixedVariant = MaterialDynamicColors.colorSpec.onPrimaryFixedVariant();
3330
+ MaterialDynamicColors.secondaryFixed = MaterialDynamicColors.colorSpec.secondaryFixed();
3331
+ MaterialDynamicColors.secondaryFixedDim = MaterialDynamicColors.colorSpec.secondaryFixedDim();
3332
+ MaterialDynamicColors.onSecondaryFixed = MaterialDynamicColors.colorSpec.onSecondaryFixed();
3333
+ MaterialDynamicColors.onSecondaryFixedVariant = MaterialDynamicColors.colorSpec.onSecondaryFixedVariant();
3334
+ MaterialDynamicColors.tertiaryFixed = MaterialDynamicColors.colorSpec.tertiaryFixed();
3335
+ MaterialDynamicColors.tertiaryFixedDim = MaterialDynamicColors.colorSpec.tertiaryFixedDim();
3336
+ MaterialDynamicColors.onTertiaryFixed = MaterialDynamicColors.colorSpec.onTertiaryFixed();
3337
+ MaterialDynamicColors.onTertiaryFixedVariant = MaterialDynamicColors.colorSpec.onTertiaryFixedVariant();
3338
+ /**
3339
+ * @license
3340
+ * Copyright 2021 Google LLC
3341
+ *
3342
+ * Licensed under the Apache License, Version 2.0 (the "License");
3343
+ * you may not use this file except in compliance with the License.
3344
+ * You may obtain a copy of the License at
3345
+ *
3346
+ * http://www.apache.org/licenses/LICENSE-2.0
3347
+ *
3348
+ * Unless required by applicable law or agreed to in writing, software
3349
+ * distributed under the License is distributed on an "AS IS" BASIS,
3350
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3351
+ * See the License for the specific language governing permissions and
3352
+ * limitations under the License.
3353
+ */
3354
+ class CorePalette {
3355
+ /**
3356
+ * @param argb ARGB representation of a color
3357
+ *
3358
+ * @deprecated Use {@link DynamicScheme} for color scheme generation.
3359
+ * Use {@link CorePalettes} for core palettes container class.
3360
+ */
3361
+ static of(argb) {
3362
+ return new CorePalette(argb, !1);
3363
+ }
3364
+ /**
3365
+ * @param argb ARGB representation of a color
3366
+ *
3367
+ * @deprecated Use {@link DynamicScheme} for color scheme generation.
3368
+ * Use {@link CorePalettes} for core palettes container class.
3369
+ */
3370
+ static contentOf(argb) {
3371
+ return new CorePalette(argb, !0);
3372
+ }
3373
+ /**
3374
+ * Create a [CorePalette] from a set of colors
3375
+ *
3376
+ * @deprecated Use {@link DynamicScheme} for color scheme generation.
3377
+ * Use {@link CorePalettes} for core palettes container class.
3378
+ */
3379
+ static fromColors(colors) {
3380
+ return CorePalette.createPaletteFromColors(!1, colors);
3381
+ }
3382
+ /**
3383
+ * Create a content [CorePalette] from a set of colors
3384
+ *
3385
+ * @deprecated Use {@link DynamicScheme} for color scheme generation.
3386
+ * Use {@link CorePalettes} for core palettes container class.
3387
+ */
3388
+ static contentFromColors(colors) {
3389
+ return CorePalette.createPaletteFromColors(!0, colors);
3390
+ }
3391
+ static createPaletteFromColors(content, colors) {
3392
+ const palette = new CorePalette(colors.primary, content);
3393
+ if (colors.secondary) {
3394
+ const p = new CorePalette(colors.secondary, content);
3395
+ palette.a2 = p.a1;
3396
+ }
3397
+ if (colors.tertiary) {
3398
+ const p = new CorePalette(colors.tertiary, content);
3399
+ palette.a3 = p.a1;
3400
+ }
3401
+ if (colors.error) {
3402
+ const p = new CorePalette(colors.error, content);
3403
+ palette.error = p.a1;
3404
+ }
3405
+ if (colors.neutral) {
3406
+ const p = new CorePalette(colors.neutral, content);
3407
+ palette.n1 = p.n1;
3408
+ }
3409
+ if (colors.neutralVariant) {
3410
+ const p = new CorePalette(colors.neutralVariant, content);
3411
+ palette.n2 = p.n2;
3412
+ }
3413
+ return palette;
3414
+ }
3415
+ constructor(argb, isContent) {
3416
+ const hct = Hct.fromInt(argb), hue = hct.hue, chroma = hct.chroma;
3417
+ isContent ? (this.a1 = TonalPalette.fromHueAndChroma(hue, chroma), this.a2 = TonalPalette.fromHueAndChroma(hue, chroma / 3), this.a3 = TonalPalette.fromHueAndChroma(hue + 60, chroma / 2), this.n1 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 12, 4)), this.n2 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 6, 8))) : (this.a1 = TonalPalette.fromHueAndChroma(hue, Math.max(48, chroma)), this.a2 = TonalPalette.fromHueAndChroma(hue, 16), this.a3 = TonalPalette.fromHueAndChroma(hue + 60, 24), this.n1 = TonalPalette.fromHueAndChroma(hue, 4), this.n2 = TonalPalette.fromHueAndChroma(hue, 8)), this.error = TonalPalette.fromHueAndChroma(25, 84);
3418
+ }
3419
+ }
3420
+ /**
3421
+ * @license
3422
+ * Copyright 2021 Google LLC
3423
+ *
3424
+ * Licensed under the Apache License, Version 2.0 (the "License");
3425
+ * you may not use this file except in compliance with the License.
3426
+ * You may obtain a copy of the License at
3427
+ *
3428
+ * http://www.apache.org/licenses/LICENSE-2.0
3429
+ *
3430
+ * Unless required by applicable law or agreed to in writing, software
3431
+ * distributed under the License is distributed on an "AS IS" BASIS,
3432
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3433
+ * See the License for the specific language governing permissions and
3434
+ * limitations under the License.
3435
+ */
3436
+ class Scheme {
3437
+ get primary() {
3438
+ return this.props.primary;
3439
+ }
3440
+ get onPrimary() {
3441
+ return this.props.onPrimary;
3442
+ }
3443
+ get primaryContainer() {
3444
+ return this.props.primaryContainer;
3445
+ }
3446
+ get onPrimaryContainer() {
3447
+ return this.props.onPrimaryContainer;
3448
+ }
3449
+ get secondary() {
3450
+ return this.props.secondary;
3451
+ }
3452
+ get onSecondary() {
3453
+ return this.props.onSecondary;
3454
+ }
3455
+ get secondaryContainer() {
3456
+ return this.props.secondaryContainer;
3457
+ }
3458
+ get onSecondaryContainer() {
3459
+ return this.props.onSecondaryContainer;
3460
+ }
3461
+ get tertiary() {
3462
+ return this.props.tertiary;
3463
+ }
3464
+ get onTertiary() {
3465
+ return this.props.onTertiary;
3466
+ }
3467
+ get tertiaryContainer() {
3468
+ return this.props.tertiaryContainer;
3469
+ }
3470
+ get onTertiaryContainer() {
3471
+ return this.props.onTertiaryContainer;
3472
+ }
3473
+ get error() {
3474
+ return this.props.error;
3475
+ }
3476
+ get onError() {
3477
+ return this.props.onError;
3478
+ }
3479
+ get errorContainer() {
3480
+ return this.props.errorContainer;
3481
+ }
3482
+ get onErrorContainer() {
3483
+ return this.props.onErrorContainer;
3484
+ }
3485
+ get background() {
3486
+ return this.props.background;
3487
+ }
3488
+ get onBackground() {
3489
+ return this.props.onBackground;
3490
+ }
3491
+ get surface() {
3492
+ return this.props.surface;
3493
+ }
3494
+ get onSurface() {
3495
+ return this.props.onSurface;
3496
+ }
3497
+ get surfaceVariant() {
3498
+ return this.props.surfaceVariant;
3499
+ }
3500
+ get onSurfaceVariant() {
3501
+ return this.props.onSurfaceVariant;
3502
+ }
3503
+ get outline() {
3504
+ return this.props.outline;
3505
+ }
3506
+ get outlineVariant() {
3507
+ return this.props.outlineVariant;
3508
+ }
3509
+ get shadow() {
3510
+ return this.props.shadow;
3511
+ }
3512
+ get scrim() {
3513
+ return this.props.scrim;
3514
+ }
3515
+ get inverseSurface() {
3516
+ return this.props.inverseSurface;
3517
+ }
3518
+ get inverseOnSurface() {
3519
+ return this.props.inverseOnSurface;
3520
+ }
3521
+ get inversePrimary() {
3522
+ return this.props.inversePrimary;
3523
+ }
3524
+ /**
3525
+ * @param argb ARGB representation of a color.
3526
+ * @return Light Material color scheme, based on the color's hue.
3527
+ */
3528
+ static light(argb) {
3529
+ return Scheme.lightFromCorePalette(CorePalette.of(argb));
3530
+ }
3531
+ /**
3532
+ * @param argb ARGB representation of a color.
3533
+ * @return Dark Material color scheme, based on the color's hue.
3534
+ */
3535
+ static dark(argb) {
3536
+ return Scheme.darkFromCorePalette(CorePalette.of(argb));
3537
+ }
3538
+ /**
3539
+ * @param argb ARGB representation of a color.
3540
+ * @return Light Material content color scheme, based on the color's hue.
3541
+ */
3542
+ static lightContent(argb) {
3543
+ return Scheme.lightFromCorePalette(CorePalette.contentOf(argb));
3544
+ }
3545
+ /**
3546
+ * @param argb ARGB representation of a color.
3547
+ * @return Dark Material content color scheme, based on the color's hue.
3548
+ */
3549
+ static darkContent(argb) {
3550
+ return Scheme.darkFromCorePalette(CorePalette.contentOf(argb));
3551
+ }
3552
+ /**
3553
+ * Light scheme from core palette
3554
+ */
3555
+ static lightFromCorePalette(core) {
3556
+ return new Scheme({
3557
+ primary: core.a1.tone(40),
3558
+ onPrimary: core.a1.tone(100),
3559
+ primaryContainer: core.a1.tone(90),
3560
+ onPrimaryContainer: core.a1.tone(10),
3561
+ secondary: core.a2.tone(40),
3562
+ onSecondary: core.a2.tone(100),
3563
+ secondaryContainer: core.a2.tone(90),
3564
+ onSecondaryContainer: core.a2.tone(10),
3565
+ tertiary: core.a3.tone(40),
3566
+ onTertiary: core.a3.tone(100),
3567
+ tertiaryContainer: core.a3.tone(90),
3568
+ onTertiaryContainer: core.a3.tone(10),
3569
+ error: core.error.tone(40),
3570
+ onError: core.error.tone(100),
3571
+ errorContainer: core.error.tone(90),
3572
+ onErrorContainer: core.error.tone(10),
3573
+ background: core.n1.tone(99),
3574
+ onBackground: core.n1.tone(10),
3575
+ surface: core.n1.tone(99),
3576
+ onSurface: core.n1.tone(10),
3577
+ surfaceVariant: core.n2.tone(90),
3578
+ onSurfaceVariant: core.n2.tone(30),
3579
+ outline: core.n2.tone(50),
3580
+ outlineVariant: core.n2.tone(80),
3581
+ shadow: core.n1.tone(0),
3582
+ scrim: core.n1.tone(0),
3583
+ inverseSurface: core.n1.tone(20),
3584
+ inverseOnSurface: core.n1.tone(95),
3585
+ inversePrimary: core.a1.tone(80)
3586
+ });
3587
+ }
3588
+ /**
3589
+ * Dark scheme from core palette
3590
+ */
3591
+ static darkFromCorePalette(core) {
3592
+ return new Scheme({
3593
+ primary: core.a1.tone(80),
3594
+ onPrimary: core.a1.tone(20),
3595
+ primaryContainer: core.a1.tone(30),
3596
+ onPrimaryContainer: core.a1.tone(90),
3597
+ secondary: core.a2.tone(80),
3598
+ onSecondary: core.a2.tone(20),
3599
+ secondaryContainer: core.a2.tone(30),
3600
+ onSecondaryContainer: core.a2.tone(90),
3601
+ tertiary: core.a3.tone(80),
3602
+ onTertiary: core.a3.tone(20),
3603
+ tertiaryContainer: core.a3.tone(30),
3604
+ onTertiaryContainer: core.a3.tone(90),
3605
+ error: core.error.tone(80),
3606
+ onError: core.error.tone(20),
3607
+ errorContainer: core.error.tone(30),
3608
+ onErrorContainer: core.error.tone(80),
3609
+ background: core.n1.tone(10),
3610
+ onBackground: core.n1.tone(90),
3611
+ surface: core.n1.tone(10),
3612
+ onSurface: core.n1.tone(90),
3613
+ surfaceVariant: core.n2.tone(30),
3614
+ onSurfaceVariant: core.n2.tone(80),
3615
+ outline: core.n2.tone(60),
3616
+ outlineVariant: core.n2.tone(30),
3617
+ shadow: core.n1.tone(0),
3618
+ scrim: core.n1.tone(0),
3619
+ inverseSurface: core.n1.tone(90),
3620
+ inverseOnSurface: core.n1.tone(20),
3621
+ inversePrimary: core.a1.tone(40)
3622
+ });
3623
+ }
3624
+ constructor(props) {
3625
+ this.props = props;
3626
+ }
3627
+ toJSON() {
3628
+ return {
3629
+ ...this.props
3630
+ };
3631
+ }
3632
+ }
3633
+ /**
3634
+ * @license
3635
+ * Copyright 2021 Google LLC
3636
+ *
3637
+ * Licensed under the Apache License, Version 2.0 (the "License");
3638
+ * you may not use this file except in compliance with the License.
3639
+ * You may obtain a copy of the License at
3640
+ *
3641
+ * http://www.apache.org/licenses/LICENSE-2.0
3642
+ *
3643
+ * Unless required by applicable law or agreed to in writing, software
3644
+ * distributed under the License is distributed on an "AS IS" BASIS,
3645
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3646
+ * See the License for the specific language governing permissions and
3647
+ * limitations under the License.
3648
+ */
3649
+ function hexFromArgb(argb) {
3650
+ const r = redFromArgb(argb), g = greenFromArgb(argb), b = blueFromArgb(argb), outParts = [r.toString(16), g.toString(16), b.toString(16)];
3651
+ for (const [i, part] of outParts.entries())
3652
+ part.length === 1 && (outParts[i] = "0" + part);
3653
+ return "#" + outParts.join("");
3654
+ }
3655
+ function argbFromHex(hex) {
3656
+ hex = hex.replace("#", "");
3657
+ const isThree = hex.length === 3, isSix = hex.length === 6, isEight = hex.length === 8;
3658
+ if (!isThree && !isSix && !isEight)
3659
+ throw new Error("unexpected hex " + hex);
3660
+ let r = 0, g = 0, b = 0;
3661
+ return isThree ? (r = parseIntHex(hex.slice(0, 1).repeat(2)), g = parseIntHex(hex.slice(1, 2).repeat(2)), b = parseIntHex(hex.slice(2, 3).repeat(2))) : isSix ? (r = parseIntHex(hex.slice(0, 2)), g = parseIntHex(hex.slice(2, 4)), b = parseIntHex(hex.slice(4, 6))) : isEight && (r = parseIntHex(hex.slice(2, 4)), g = parseIntHex(hex.slice(4, 6)), b = parseIntHex(hex.slice(6, 8))), (255 << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255) >>> 0;
3662
+ }
3663
+ function parseIntHex(value) {
3664
+ return parseInt(value, 16);
3665
+ }
3666
+ /**
3667
+ * @license
3668
+ * Copyright 2021 Google LLC
3669
+ *
3670
+ * Licensed under the Apache License, Version 2.0 (the "License");
3671
+ * you may not use this file except in compliance with the License.
3672
+ * You may obtain a copy of the License at
3673
+ *
3674
+ * http://www.apache.org/licenses/LICENSE-2.0
3675
+ *
3676
+ * Unless required by applicable law or agreed to in writing, software
3677
+ * distributed under the License is distributed on an "AS IS" BASIS,
3678
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3679
+ * See the License for the specific language governing permissions and
3680
+ * limitations under the License.
3681
+ */
3682
+ function themeFromSourceColor(source, customColors = []) {
3683
+ const palette = CorePalette.of(source);
3684
+ return {
3685
+ source,
3686
+ schemes: {
3687
+ light: Scheme.light(source),
3688
+ dark: Scheme.dark(source)
3689
+ },
3690
+ palettes: {
3691
+ primary: palette.a1,
3692
+ secondary: palette.a2,
3693
+ tertiary: palette.a3,
3694
+ neutral: palette.n1,
3695
+ neutralVariant: palette.n2,
3696
+ error: palette.error
3697
+ },
3698
+ customColors: customColors.map((c) => customColor(source, c))
3699
+ };
3700
+ }
3701
+ function customColor(source, color) {
3702
+ let value = color.value;
3703
+ const from = value, to = source;
3704
+ color.blend && (value = Blend.harmonize(from, to));
3705
+ const tones = CorePalette.of(value).a1;
3706
+ return {
3707
+ color,
3708
+ value,
3709
+ light: {
3710
+ color: tones.tone(40),
3711
+ onColor: tones.tone(100),
3712
+ colorContainer: tones.tone(90),
3713
+ onColorContainer: tones.tone(10)
3714
+ },
3715
+ dark: {
3716
+ color: tones.tone(80),
3717
+ onColor: tones.tone(20),
3718
+ colorContainer: tones.tone(30),
3719
+ onColorContainer: tones.tone(90)
3720
+ }
3721
+ };
3722
+ }
3723
+ const COLOR_SHADES = [
3724
+ 50,
3725
+ 100,
3726
+ 200,
3727
+ 300,
3728
+ 400,
3729
+ 500,
3730
+ 600,
3731
+ 700,
3732
+ 800,
3733
+ 900
3734
+ ], SHADE_TONES = {
3735
+ 50: 90,
3736
+ 100: 80,
3737
+ 200: 70,
3738
+ 300: 60,
3739
+ 400: 50,
3740
+ 500: 40,
3741
+ 600: 35,
3742
+ 700: 30,
3743
+ 800: 20,
3744
+ 900: 10
3745
+ }, ON_SHADE_TONES = Object.fromEntries(
3746
+ COLOR_SHADES.map((shade) => [shade, SHADE_TONES[shade] >= 60 ? 10 : 100])
3747
+ ), createTonalPalette = (seed) => {
3748
+ const hex = colorToHex(seed, "#000000");
3749
+ return themeFromSourceColor(argbFromHex(hex)).palettes.primary;
3750
+ }, createPaletteFromTones = (seed, tones) => {
3751
+ const tonalPalette = createTonalPalette(seed);
3752
+ return Object.fromEntries(
3753
+ COLOR_SHADES.map((shade) => [
3754
+ shade,
3755
+ hexFromArgb(tonalPalette.tone(tones[shade]))
3756
+ ])
3757
+ );
3758
+ }, createPalette = (seed) => createPaletteFromTones(seed, SHADE_TONES), createOnPalette = (seed) => createPaletteFromTones(seed, ON_SHADE_TONES), createPalettePair = (seed) => ({
3759
+ colors: createPalette(seed),
3760
+ onColors: createOnPalette(seed)
3761
+ });
3762
+ export {
3763
+ COLOR_SHADES as C,
3764
+ Hct as H,
3765
+ ON_SHADE_TONES as O,
3766
+ SHADE_TONES as S,
3767
+ createOnPalette as a,
3768
+ createPalette as b,
3769
+ colorToHex as c,
3770
+ createPalettePair as d,
3771
+ rgbToHex as e,
3772
+ COLOR_SEEDS as f,
3773
+ getContrastingColor as g,
3774
+ hexFromArgb as h,
3775
+ argbFromHex as i,
3776
+ parseColor as p,
3777
+ rgbToChannels as r,
3778
+ themeFromSourceColor as t
3779
+ };