@luzmo/lucero 0.0.3 → 0.0.6

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 (323) hide show
  1. package/components/accordion/accordion-item.d.ts +24 -0
  2. package/components/accordion/accordion.d.ts +42 -0
  3. package/components/accordion/index.cjs +43 -0
  4. package/components/accordion/index.d.ts +10 -0
  5. package/components/accordion/index.js +181 -0
  6. package/components/action-bar/action-bar.d.ts +42 -0
  7. package/components/action-bar/index.cjs +39 -0
  8. package/components/action-bar/index.d.ts +7 -0
  9. package/components/action-bar/index.js +107 -0
  10. package/components/action-button/action-button.d.ts +81 -0
  11. package/components/action-button/index.cjs +24 -0
  12. package/components/action-button/index.d.ts +7 -0
  13. package/components/action-button/index.js +161 -0
  14. package/components/action-group/action-group.d.ts +50 -0
  15. package/components/action-group/index.cjs +18 -0
  16. package/components/action-group/index.d.ts +7 -0
  17. package/components/action-group/index.js +29 -0
  18. package/components/action-group-B7oQXv30.js +258 -0
  19. package/components/action-group-C8YUQzt8.cjs +20 -0
  20. package/components/action-menu/action-menu.d.ts +40 -0
  21. package/components/action-menu/index.cjs +56 -0
  22. package/components/action-menu/index.d.ts +7 -0
  23. package/components/action-menu/index.js +126 -0
  24. package/components/async-directive-BhRGSTWB.js +82 -0
  25. package/components/async-directive-_65ULPLK.cjs +22 -0
  26. package/components/avatar/avatar.d.ts +31 -0
  27. package/components/avatar/index.cjs +24 -0
  28. package/components/avatar/index.d.ts +7 -0
  29. package/components/avatar/index.js +81 -0
  30. package/components/base-BjTwmyRF.cjs +22 -0
  31. package/components/base-CxUap9HL.js +665 -0
  32. package/components/base-D76d76ww.js +26 -0
  33. package/components/base-rtxi7uaR.cjs +40 -0
  34. package/components/button/button-base.d.ts +44 -0
  35. package/components/button/button.d.ts +59 -0
  36. package/components/button/clear-button.d.ts +22 -0
  37. package/components/button/close-button.d.ts +24 -0
  38. package/components/button/index.cjs +20 -0
  39. package/components/button/index.d.ts +13 -0
  40. package/components/button/index.js +127 -0
  41. package/components/button-base-CgrTYVgq.js +142 -0
  42. package/components/button-base-DjqSZyn2.cjs +25 -0
  43. package/components/button-group/button-group.d.ts +19 -0
  44. package/components/button-group/index.cjs +18 -0
  45. package/components/button-group/index.d.ts +7 -0
  46. package/components/button-group/index.js +59 -0
  47. package/components/checkbox/checkbox-base.d.ts +9 -0
  48. package/components/checkbox/checkbox-mixin.d.ts +14 -0
  49. package/components/checkbox/checkbox.d.ts +54 -0
  50. package/components/checkbox/index.cjs +25 -0
  51. package/components/checkbox/index.d.ts +7 -0
  52. package/components/checkbox/index.js +96 -0
  53. package/components/checkbox-mixin-BRluTF9s.js +70 -0
  54. package/components/checkbox-mixin-iB-0ivgo.cjs +27 -0
  55. package/components/clear-button-CyLF5dx_.js +53 -0
  56. package/components/clear-button-DFXE6MLx.cjs +18 -0
  57. package/components/close-button-CcD-aVqh.cjs +18 -0
  58. package/components/close-button-CzpdWCWI.js +51 -0
  59. package/components/color-Bg3tYsAQ.js +178 -0
  60. package/components/color-DphK4hwx.cjs +18 -0
  61. package/components/color-area/color-area.d.ts +67 -0
  62. package/components/color-area/index.cjs +80 -0
  63. package/components/color-area/index.d.ts +7 -0
  64. package/components/color-area/index.js +372 -0
  65. package/components/color-field/color-field.d.ts +20 -0
  66. package/components/color-field/index.cjs +23 -0
  67. package/components/color-field/index.d.ts +7 -0
  68. package/components/color-field/index.js +80 -0
  69. package/components/color-handle/color-handle.d.ts +13 -0
  70. package/components/color-handle/index.cjs +24 -0
  71. package/components/color-handle/index.d.ts +7 -0
  72. package/components/color-handle/index.js +73 -0
  73. package/components/color-loupe/color-loupe.d.ts +7 -0
  74. package/components/color-loupe/index.cjs +18 -0
  75. package/components/color-loupe/index.d.ts +7 -0
  76. package/components/color-loupe/index.js +29 -0
  77. package/components/color-loupe-BN3k1ACF.cjs +56 -0
  78. package/components/color-loupe-CD-dhmB1.js +81 -0
  79. package/components/color-menu/color-menu.d.ts +54 -0
  80. package/components/color-menu/index.cjs +86 -0
  81. package/components/color-menu/index.d.ts +7 -0
  82. package/components/color-menu/index.js +203 -0
  83. package/components/color-picker/color-picker.d.ts +39 -0
  84. package/components/color-picker/index.cjs +48 -0
  85. package/components/color-picker/index.d.ts +7 -0
  86. package/components/color-picker/index.js +141 -0
  87. package/components/color-slider/color-slider.d.ts +57 -0
  88. package/components/color-slider/index.cjs +57 -0
  89. package/components/color-slider/index.d.ts +7 -0
  90. package/components/color-slider/index.js +317 -0
  91. package/components/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
  92. package/components/condition-attribute-with-id-Dv4lSRbe.js +31 -0
  93. package/components/dependency-manger-C5HCkMMB.cjs +18 -0
  94. package/components/dependency-manger-CEXvGQUV.js +54 -0
  95. package/components/directive-C7oCP5Bh.cjs +22 -0
  96. package/components/directive-helpers-C3pAxRR3.cjs +22 -0
  97. package/components/directive-helpers-D0vm0gvF.js +28 -0
  98. package/components/directive-oAbCiebi.js +44 -0
  99. package/components/divider/divider.d.ts +24 -0
  100. package/components/divider/index.cjs +18 -0
  101. package/components/divider/index.d.ts +7 -0
  102. package/components/divider/index.js +61 -0
  103. package/components/divider.module-CXMNveQc.cjs +18 -0
  104. package/components/divider.module-DwOuLGU3.js +21 -0
  105. package/components/element-resolution-BvRLGqIU.cjs +18 -0
  106. package/components/element-resolution-FCUT-wql.js +91 -0
  107. package/components/field-group/field-group.d.ts +24 -0
  108. package/components/field-group/index.cjs +18 -0
  109. package/components/field-group/index.d.ts +7 -0
  110. package/components/field-group/index.js +29 -0
  111. package/components/field-group-DAImvhSF.js +66 -0
  112. package/components/field-group-d5Hkb8UW.cjs +23 -0
  113. package/components/field-label/field-label.d.ts +50 -0
  114. package/components/field-label/index.cjs +18 -0
  115. package/components/field-label/index.d.ts +7 -0
  116. package/components/field-label/index.js +29 -0
  117. package/components/field-label-D1zKXSG6.cjs +25 -0
  118. package/components/field-label-DY9iRmRI.js +106 -0
  119. package/components/focus-group-DHeTq18L.js +218 -0
  120. package/components/focus-group-DnxZUBhQ.cjs +18 -0
  121. package/components/focus-visible-B0P9aY_G.cjs +18 -0
  122. package/components/focus-visible-DBlJGoEW.js +74 -0
  123. package/components/focusable-Bze9xE25.js +153 -0
  124. package/components/focusable-DyyBr-J-.cjs +18 -0
  125. package/components/focusable-selectors-B4YgbghQ.js +31 -0
  126. package/components/focusable-selectors-BgFlyFcY.cjs +18 -0
  127. package/components/icon/icon-base.d.ts +11 -0
  128. package/components/icon/icon.d.ts +12 -0
  129. package/components/icon/index.cjs +18 -0
  130. package/components/icon/index.d.ts +7 -0
  131. package/components/icon/index.js +88 -0
  132. package/components/if-defined-C-8FyBSN.cjs +22 -0
  133. package/components/if-defined-XzWkhMhg.js +27 -0
  134. package/components/index-C1chwzNp.js +727 -0
  135. package/components/index-CNtoBntg.cjs +77 -0
  136. package/components/index-Ci6Jnhu4.js +927 -0
  137. package/components/index-DCKCHDTt.cjs +18 -0
  138. package/components/index.cjs +27 -0
  139. package/components/index.js +207 -0
  140. package/components/infield-button/index.cjs +22 -0
  141. package/components/infield-button/index.d.ts +7 -0
  142. package/components/infield-button/index.js +64 -0
  143. package/components/infield-button/infield-button.d.ts +25 -0
  144. package/components/label/index.cjs +18 -0
  145. package/components/label/index.d.ts +7 -0
  146. package/components/label/index.js +51 -0
  147. package/components/label/label.d.ts +7 -0
  148. package/components/legend-position/index.d.ts +7 -0
  149. package/components/legend-position/legend-position.d.ts +10 -0
  150. package/components/like-anchor-DKuw8fJA.cjs +32 -0
  151. package/components/like-anchor-DnsAwo_O.js +69 -0
  152. package/components/manage-help-text-B-FXFXgT.js +92 -0
  153. package/components/manage-help-text-I5aYDAKT.cjs +30 -0
  154. package/components/menu/index.cjs +18 -0
  155. package/components/menu/index.d.ts +16 -0
  156. package/components/menu/index.js +32 -0
  157. package/components/menu/menu-divider.d.ts +14 -0
  158. package/components/menu/menu-group.d.ts +17 -0
  159. package/components/menu/menu-item.d.ts +125 -0
  160. package/components/menu/menu.d.ts +119 -0
  161. package/components/multi-language-field/index.cjs +39 -0
  162. package/components/multi-language-field/index.d.ts +7 -0
  163. package/components/multi-language-field/index.js +148 -0
  164. package/components/multi-language-field/multi-language-field.d.ts +41 -0
  165. package/components/mutation-controller-DH7YOCyj.js +52 -0
  166. package/components/mutation-controller-DkOMCW-c.cjs +22 -0
  167. package/components/number-field/index.cjs +57 -0
  168. package/components/number-field/index.d.ts +7 -0
  169. package/components/number-field/index.js +735 -0
  170. package/components/number-field/number-field.d.ts +113 -0
  171. package/components/observe-slot-text-DeSKIzvP.cjs +18 -0
  172. package/components/observe-slot-text-DrM71me1.js +87 -0
  173. package/components/overlay/abstract-overlay.d.ts +72 -0
  174. package/components/overlay/click-controller.d.ts +14 -0
  175. package/components/overlay/events.d.ts +23 -0
  176. package/components/overlay/full-size-plugin.d.ts +12 -0
  177. package/components/overlay/hover-controller.d.ts +20 -0
  178. package/components/overlay/index.cjs +73 -0
  179. package/components/overlay/index.d.ts +22 -0
  180. package/components/overlay/index.js +342 -0
  181. package/components/overlay/interaction-controller.d.ts +38 -0
  182. package/components/overlay/loader.d.ts +4 -0
  183. package/components/overlay/longpress-controller.d.ts +21 -0
  184. package/components/overlay/overlay-dialog.d.ts +4 -0
  185. package/components/overlay/overlay-events.d.ts +11 -0
  186. package/components/overlay/overlay-no-popover.d.ts +4 -0
  187. package/components/overlay/overlay-popover.d.ts +4 -0
  188. package/components/overlay/overlay-stack.d.ts +44 -0
  189. package/components/overlay/overlay-timer.d.ts +21 -0
  190. package/components/overlay/overlay-trigger-directive.d.ts +26 -0
  191. package/components/overlay/overlay-trigger.d.ts +53 -0
  192. package/components/overlay/overlay-types.d.ts +50 -0
  193. package/components/overlay/overlay.d.ts +464 -0
  194. package/components/overlay/placement-controller.d.ts +157 -0
  195. package/components/overlay/slottable-request-directive.d.ts +17 -0
  196. package/components/overlay/slottable-request-event.d.ts +12 -0
  197. package/components/overlay/strategies.d.ts +8 -0
  198. package/components/overlay/virtual-trigger.d.ts +7 -0
  199. package/components/overlay-C2Cck0Az.js +2712 -0
  200. package/components/overlay-dn6Xe_vz.cjs +47 -0
  201. package/components/pending-state--XOfTjzE.js +61 -0
  202. package/components/pending-state-BeJ7iP-O.cjs +26 -0
  203. package/components/picker/desktop-controller.d.ts +7 -0
  204. package/components/picker/index.cjs +18 -0
  205. package/components/picker/index.d.ts +7 -0
  206. package/components/picker/index.js +32 -0
  207. package/components/picker/interaction-controller.d.ts +43 -0
  208. package/components/picker/mobile-controller.d.ts +9 -0
  209. package/components/picker/picker.d.ts +154 -0
  210. package/components/picker/strategies.d.ts +6 -0
  211. package/components/picker-8cOc-jjh.cjs +127 -0
  212. package/components/picker-BZAWrSDk.js +655 -0
  213. package/components/platform-CQzYNWKq.cjs +18 -0
  214. package/components/platform-DQYMG7JI.js +54 -0
  215. package/components/popover/index.cjs +18 -0
  216. package/components/popover/index.d.ts +7 -0
  217. package/components/popover/index.js +29 -0
  218. package/components/popover/popover.d.ts +29 -0
  219. package/components/popover-CCzs4VH8.cjs +30 -0
  220. package/components/popover-D0EliN0L.js +67 -0
  221. package/components/progress-circle/index.cjs +18 -0
  222. package/components/progress-circle/index.d.ts +7 -0
  223. package/components/progress-circle/index.js +29 -0
  224. package/components/progress-circle/progress-circle.d.ts +35 -0
  225. package/components/progress-circle-DYSSkjlY.cjs +33 -0
  226. package/components/progress-circle-_-9sAlMM.js +97 -0
  227. package/components/query-BL-TJj7K.cjs +22 -0
  228. package/components/query-D_KR_GUc.js +51 -0
  229. package/components/query-assigned-elements-DjfhL1cl.js +36 -0
  230. package/components/query-assigned-elements-DsKsfk7G.cjs +22 -0
  231. package/components/query-assigned-nodes-BcKWmGzy.cjs +22 -0
  232. package/components/query-assigned-nodes-C76XVPWY.js +36 -0
  233. package/components/radio/index.cjs +22 -0
  234. package/components/radio/index.d.ts +10 -0
  235. package/components/radio/index.js +191 -0
  236. package/components/radio/radio-group.d.ts +27 -0
  237. package/components/radio/radio.d.ts +39 -0
  238. package/components/random-id-ByCz1xaq.js +26 -0
  239. package/components/random-id-CqvckpWe.cjs +18 -0
  240. package/components/roving-tabindex-By_fCy_e.cjs +18 -0
  241. package/components/roving-tabindex-DOg4z6ZU.js +66 -0
  242. package/components/search/index.cjs +45 -0
  243. package/components/search/index.d.ts +7 -0
  244. package/components/search/index.js +131 -0
  245. package/components/search/search.d.ts +27 -0
  246. package/components/sized-mixin-BAI6NiE2.cjs +18 -0
  247. package/components/sized-mixin-DcJTTohI.js +63 -0
  248. package/components/slider/index.cjs +18 -0
  249. package/components/slider/index.d.ts +7 -0
  250. package/components/slider/index.js +1158 -0
  251. package/components/slider/slider.d.ts +24 -0
  252. package/components/slottable-request-event-BfUUt1Mh.cjs +18 -0
  253. package/components/slottable-request-event-DggLA4Rx.js +31 -0
  254. package/components/state-D8vot9IB.js +29 -0
  255. package/components/state-WWHLNMRG.cjs +22 -0
  256. package/components/streaming-listener-BbmNyKWO.js +125 -0
  257. package/components/streaming-listener-C2A7ZJZP.cjs +18 -0
  258. package/components/style-map-CoBJRbvu.js +53 -0
  259. package/components/style-map-DH0jkl7s.cjs +22 -0
  260. package/components/swatch/index.cjs +49 -0
  261. package/components/swatch/index.d.ts +10 -0
  262. package/components/swatch/index.js +342 -0
  263. package/components/swatch/swatch-group.d.ts +41 -0
  264. package/components/swatch/swatch.d.ts +40 -0
  265. package/components/switch/index.cjs +22 -0
  266. package/components/switch/index.d.ts +7 -0
  267. package/components/switch/index.js +73 -0
  268. package/components/switch/switch.d.ts +27 -0
  269. package/components/tags/index.cjs +32 -0
  270. package/components/tags/index.d.ts +10 -0
  271. package/components/tags/index.js +173 -0
  272. package/components/tags/tag.d.ts +29 -0
  273. package/components/tags/tags.d.ts +28 -0
  274. package/components/text-field/help-text-manager.d.ts +19 -0
  275. package/components/text-field/help-text.d.ts +20 -0
  276. package/components/text-field/index.cjs +21 -0
  277. package/components/text-field/index.d.ts +14 -0
  278. package/components/text-field/index.js +62 -0
  279. package/components/text-field/manage-help-text.d.ts +13 -0
  280. package/components/text-field/text-field.d.ts +142 -0
  281. package/components/text-field-05QNK_Lj.js +313 -0
  282. package/components/text-field-BU7yxiOR.cjs +85 -0
  283. package/components/toast/index.cjs +51 -0
  284. package/components/toast/index.d.ts +7 -0
  285. package/components/toast/index.js +153 -0
  286. package/components/toast/toast.d.ts +77 -0
  287. package/components/tooltip/index.cjs +45 -0
  288. package/components/tooltip/index.d.ts +8 -0
  289. package/components/tooltip/index.js +220 -0
  290. package/components/tooltip/tooltip-directive.d.ts +5 -0
  291. package/components/tooltip/tooltip.d.ts +55 -0
  292. package/components/unit-input/index.cjs +43 -0
  293. package/components/unit-input/index.d.ts +7 -0
  294. package/components/unit-input/index.js +183 -0
  295. package/components/unit-input/unit-input.d.ts +33 -0
  296. package/components/when-CDK1Tt5Y.js +28 -0
  297. package/components/when-CDZyJPvd.cjs +22 -0
  298. package/index.d.ts +39 -0
  299. package/package.json +139 -101
  300. package/utils/base.d.ts +16 -0
  301. package/utils/condition-attribute-with-id.d.ts +2 -0
  302. package/utils/first-focusable-in.d.ts +3 -0
  303. package/utils/focus-visible.d.ts +29 -0
  304. package/utils/focusable-selectors.d.ts +2 -0
  305. package/utils/focusable.d.ts +58 -0
  306. package/utils/get-css-variable.d.ts +1 -0
  307. package/utils/get-label-from-slot.d.ts +1 -0
  308. package/utils/like-anchor.d.ts +23 -0
  309. package/utils/observe-slot-presence.d.ts +12 -0
  310. package/utils/observe-slot-text.d.ts +11 -0
  311. package/utils/platform.d.ts +10 -0
  312. package/utils/random-id.d.ts +1 -0
  313. package/utils/reactive-controllers/color.d.ts +54 -0
  314. package/utils/reactive-controllers/dependency-manger.d.ts +26 -0
  315. package/utils/reactive-controllers/element-resolution.d.ts +23 -0
  316. package/utils/reactive-controllers/focus-group.d.ts +62 -0
  317. package/utils/reactive-controllers/language-resolution.d.ts +11 -0
  318. package/utils/reactive-controllers/match-media.d.ts +13 -0
  319. package/utils/reactive-controllers/pending-state.d.ts +41 -0
  320. package/utils/reactive-controllers/roving-tabindex.d.ts +19 -0
  321. package/utils/reparent-child.d.ts +4 -0
  322. package/utils/sized-mixin.d.ts +17 -0
  323. package/utils/streaming-listener.d.ts +48 -0
@@ -0,0 +1,727 @@
1
+ /*! * Lucero - The design system for Luzmo.
2
+ *
3
+ * Copyright © 2025 Luzmo
4
+ * All rights reserved.
5
+ * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
+ * This license allows users with a current active Luzmo account to use Lucero.
7
+ * This license terminates automatically if a user no longer has an active Luzmo account.
8
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+ * SOFTWARE.
17
+ * */
18
+ function u(r, e) {
19
+ E(r) && (r = "100%");
20
+ const t = I(r);
21
+ return r = e === 360 ? r : Math.min(e, Math.max(0, parseFloat(r))), t && (r = parseInt(String(r * e), 10) / 100), Math.abs(r - e) < 1e-6 ? 1 : (e === 360 ? r = (r < 0 ? r % e + e : r % e) / parseFloat(String(e)) : r = r % e / parseFloat(String(e)), r);
22
+ }
23
+ function m(r) {
24
+ return Math.min(1, Math.max(0, r));
25
+ }
26
+ function E(r) {
27
+ return typeof r == "string" && r.indexOf(".") !== -1 && parseFloat(r) === 1;
28
+ }
29
+ function I(r) {
30
+ return typeof r == "string" && r.indexOf("%") !== -1;
31
+ }
32
+ function F(r) {
33
+ return r = parseFloat(r), (isNaN(r) || r < 0 || r > 1) && (r = 1), r;
34
+ }
35
+ function p(r) {
36
+ return Number(r) <= 1 ? `${Number(r) * 100}%` : r;
37
+ }
38
+ function l(r) {
39
+ return r.length === 1 ? "0" + r : String(r);
40
+ }
41
+ function B(r, e, t) {
42
+ return {
43
+ r: u(r, 255) * 255,
44
+ g: u(e, 255) * 255,
45
+ b: u(t, 255) * 255
46
+ };
47
+ }
48
+ function v(r, e, t) {
49
+ r = u(r, 255), e = u(e, 255), t = u(t, 255);
50
+ const n = Math.max(r, e, t), s = Math.min(r, e, t);
51
+ let a = 0, i = 0;
52
+ const h = (n + s) / 2;
53
+ if (n === s)
54
+ i = 0, a = 0;
55
+ else {
56
+ const o = n - s;
57
+ switch (i = h > 0.5 ? o / (2 - n - s) : o / (n + s), n) {
58
+ case r:
59
+ a = (e - t) / o + (e < t ? 6 : 0);
60
+ break;
61
+ case e:
62
+ a = (t - r) / o + 2;
63
+ break;
64
+ case t:
65
+ a = (r - e) / o + 4;
66
+ break;
67
+ }
68
+ a /= 6;
69
+ }
70
+ return { h: a, s: i, l: h };
71
+ }
72
+ function w(r, e, t) {
73
+ return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? r + (e - r) * (6 * t) : t < 1 / 2 ? e : t < 2 / 3 ? r + (e - r) * (2 / 3 - t) * 6 : r;
74
+ }
75
+ function q(r, e, t) {
76
+ let n, s, a;
77
+ if (r = u(r, 360), e = u(e, 100), t = u(t, 100), e === 0)
78
+ s = t, a = t, n = t;
79
+ else {
80
+ const i = t < 0.5 ? t * (1 + e) : t + e - t * e, h = 2 * t - i;
81
+ n = w(h, i, r + 1 / 3), s = w(h, i, r), a = w(h, i, r - 1 / 3);
82
+ }
83
+ return { r: n * 255, g: s * 255, b: a * 255 };
84
+ }
85
+ function A(r, e, t) {
86
+ r = u(r, 255), e = u(e, 255), t = u(t, 255);
87
+ const n = Math.max(r, e, t), s = Math.min(r, e, t);
88
+ let a = 0;
89
+ const i = n, h = n - s, o = n === 0 ? 0 : h / n;
90
+ if (n === s)
91
+ a = 0;
92
+ else {
93
+ switch (n) {
94
+ case r:
95
+ a = (e - t) / h + (e < t ? 6 : 0);
96
+ break;
97
+ case e:
98
+ a = (t - r) / h + 2;
99
+ break;
100
+ case t:
101
+ a = (r - e) / h + 4;
102
+ break;
103
+ }
104
+ a /= 6;
105
+ }
106
+ return { h: a, s: o, v: i };
107
+ }
108
+ function P(r, e, t) {
109
+ r = u(r, 360) * 6, e = u(e, 100), t = u(t, 100);
110
+ const n = Math.floor(r), s = r - n, a = t * (1 - e), i = t * (1 - s * e), h = t * (1 - (1 - s) * e), o = n % 6, x = [t, i, a, a, h, t][o], M = [h, t, t, i, a, a][o], N = [a, a, h, t, t, i][o];
111
+ return { r: x * 255, g: M * 255, b: N * 255 };
112
+ }
113
+ function H(r, e, t, n) {
114
+ const s = [
115
+ l(Math.round(r).toString(16)),
116
+ l(Math.round(e).toString(16)),
117
+ l(Math.round(t).toString(16))
118
+ ];
119
+ return n && s[0].startsWith(s[0].charAt(1)) && s[1].startsWith(s[1].charAt(1)) && s[2].startsWith(s[2].charAt(1)) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join("");
120
+ }
121
+ function j(r, e, t, n, s) {
122
+ const a = [
123
+ l(Math.round(r).toString(16)),
124
+ l(Math.round(e).toString(16)),
125
+ l(Math.round(t).toString(16)),
126
+ l(W(n))
127
+ ];
128
+ return s && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) && a[3].startsWith(a[3].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
129
+ }
130
+ function O(r, e, t, n) {
131
+ const s = r / 100, a = e / 100, i = t / 100, h = n / 100, o = 255 * (1 - s) * (1 - h), x = 255 * (1 - a) * (1 - h), M = 255 * (1 - i) * (1 - h);
132
+ return { r: o, g: x, b: M };
133
+ }
134
+ function R(r, e, t) {
135
+ let n = 1 - r / 255, s = 1 - e / 255, a = 1 - t / 255, i = Math.min(n, s, a);
136
+ return i === 1 ? (n = 0, s = 0, a = 0) : (n = (n - i) / (1 - i) * 100, s = (s - i) / (1 - i) * 100, a = (a - i) / (1 - i) * 100), i *= 100, {
137
+ c: Math.round(n),
138
+ m: Math.round(s),
139
+ y: Math.round(a),
140
+ k: Math.round(i)
141
+ };
142
+ }
143
+ function W(r) {
144
+ return Math.round(parseFloat(r) * 255).toString(16);
145
+ }
146
+ function $(r) {
147
+ return c(r) / 255;
148
+ }
149
+ function c(r) {
150
+ return parseInt(r, 16);
151
+ }
152
+ function G(r) {
153
+ return {
154
+ r: r >> 16,
155
+ g: (r & 65280) >> 8,
156
+ b: r & 255
157
+ };
158
+ }
159
+ const y = {
160
+ aliceblue: "#f0f8ff",
161
+ antiquewhite: "#faebd7",
162
+ aqua: "#00ffff",
163
+ aquamarine: "#7fffd4",
164
+ azure: "#f0ffff",
165
+ beige: "#f5f5dc",
166
+ bisque: "#ffe4c4",
167
+ black: "#000000",
168
+ blanchedalmond: "#ffebcd",
169
+ blue: "#0000ff",
170
+ blueviolet: "#8a2be2",
171
+ brown: "#a52a2a",
172
+ burlywood: "#deb887",
173
+ cadetblue: "#5f9ea0",
174
+ chartreuse: "#7fff00",
175
+ chocolate: "#d2691e",
176
+ coral: "#ff7f50",
177
+ cornflowerblue: "#6495ed",
178
+ cornsilk: "#fff8dc",
179
+ crimson: "#dc143c",
180
+ cyan: "#00ffff",
181
+ darkblue: "#00008b",
182
+ darkcyan: "#008b8b",
183
+ darkgoldenrod: "#b8860b",
184
+ darkgray: "#a9a9a9",
185
+ darkgreen: "#006400",
186
+ darkgrey: "#a9a9a9",
187
+ darkkhaki: "#bdb76b",
188
+ darkmagenta: "#8b008b",
189
+ darkolivegreen: "#556b2f",
190
+ darkorange: "#ff8c00",
191
+ darkorchid: "#9932cc",
192
+ darkred: "#8b0000",
193
+ darksalmon: "#e9967a",
194
+ darkseagreen: "#8fbc8f",
195
+ darkslateblue: "#483d8b",
196
+ darkslategray: "#2f4f4f",
197
+ darkslategrey: "#2f4f4f",
198
+ darkturquoise: "#00ced1",
199
+ darkviolet: "#9400d3",
200
+ deeppink: "#ff1493",
201
+ deepskyblue: "#00bfff",
202
+ dimgray: "#696969",
203
+ dimgrey: "#696969",
204
+ dodgerblue: "#1e90ff",
205
+ firebrick: "#b22222",
206
+ floralwhite: "#fffaf0",
207
+ forestgreen: "#228b22",
208
+ fuchsia: "#ff00ff",
209
+ gainsboro: "#dcdcdc",
210
+ ghostwhite: "#f8f8ff",
211
+ goldenrod: "#daa520",
212
+ gold: "#ffd700",
213
+ gray: "#808080",
214
+ green: "#008000",
215
+ greenyellow: "#adff2f",
216
+ grey: "#808080",
217
+ honeydew: "#f0fff0",
218
+ hotpink: "#ff69b4",
219
+ indianred: "#cd5c5c",
220
+ indigo: "#4b0082",
221
+ ivory: "#fffff0",
222
+ khaki: "#f0e68c",
223
+ lavenderblush: "#fff0f5",
224
+ lavender: "#e6e6fa",
225
+ lawngreen: "#7cfc00",
226
+ lemonchiffon: "#fffacd",
227
+ lightblue: "#add8e6",
228
+ lightcoral: "#f08080",
229
+ lightcyan: "#e0ffff",
230
+ lightgoldenrodyellow: "#fafad2",
231
+ lightgray: "#d3d3d3",
232
+ lightgreen: "#90ee90",
233
+ lightgrey: "#d3d3d3",
234
+ lightpink: "#ffb6c1",
235
+ lightsalmon: "#ffa07a",
236
+ lightseagreen: "#20b2aa",
237
+ lightskyblue: "#87cefa",
238
+ lightslategray: "#778899",
239
+ lightslategrey: "#778899",
240
+ lightsteelblue: "#b0c4de",
241
+ lightyellow: "#ffffe0",
242
+ lime: "#00ff00",
243
+ limegreen: "#32cd32",
244
+ linen: "#faf0e6",
245
+ magenta: "#ff00ff",
246
+ maroon: "#800000",
247
+ mediumaquamarine: "#66cdaa",
248
+ mediumblue: "#0000cd",
249
+ mediumorchid: "#ba55d3",
250
+ mediumpurple: "#9370db",
251
+ mediumseagreen: "#3cb371",
252
+ mediumslateblue: "#7b68ee",
253
+ mediumspringgreen: "#00fa9a",
254
+ mediumturquoise: "#48d1cc",
255
+ mediumvioletred: "#c71585",
256
+ midnightblue: "#191970",
257
+ mintcream: "#f5fffa",
258
+ mistyrose: "#ffe4e1",
259
+ moccasin: "#ffe4b5",
260
+ navajowhite: "#ffdead",
261
+ navy: "#000080",
262
+ oldlace: "#fdf5e6",
263
+ olive: "#808000",
264
+ olivedrab: "#6b8e23",
265
+ orange: "#ffa500",
266
+ orangered: "#ff4500",
267
+ orchid: "#da70d6",
268
+ palegoldenrod: "#eee8aa",
269
+ palegreen: "#98fb98",
270
+ paleturquoise: "#afeeee",
271
+ palevioletred: "#db7093",
272
+ papayawhip: "#ffefd5",
273
+ peachpuff: "#ffdab9",
274
+ peru: "#cd853f",
275
+ pink: "#ffc0cb",
276
+ plum: "#dda0dd",
277
+ powderblue: "#b0e0e6",
278
+ purple: "#800080",
279
+ rebeccapurple: "#663399",
280
+ red: "#ff0000",
281
+ rosybrown: "#bc8f8f",
282
+ royalblue: "#4169e1",
283
+ saddlebrown: "#8b4513",
284
+ salmon: "#fa8072",
285
+ sandybrown: "#f4a460",
286
+ seagreen: "#2e8b57",
287
+ seashell: "#fff5ee",
288
+ sienna: "#a0522d",
289
+ silver: "#c0c0c0",
290
+ skyblue: "#87ceeb",
291
+ slateblue: "#6a5acd",
292
+ slategray: "#708090",
293
+ slategrey: "#708090",
294
+ snow: "#fffafa",
295
+ springgreen: "#00ff7f",
296
+ steelblue: "#4682b4",
297
+ tan: "#d2b48c",
298
+ teal: "#008080",
299
+ thistle: "#d8bfd8",
300
+ tomato: "#ff6347",
301
+ turquoise: "#40e0d0",
302
+ violet: "#ee82ee",
303
+ wheat: "#f5deb3",
304
+ white: "#ffffff",
305
+ whitesmoke: "#f5f5f5",
306
+ yellow: "#ffff00",
307
+ yellowgreen: "#9acd32"
308
+ };
309
+ function T(r) {
310
+ let e = { r: 0, g: 0, b: 0 }, t = 1, n = null, s = null, a = null, i = !1, h = !1;
311
+ return typeof r == "string" && (r = V(r)), typeof r == "object" && (g(r.r) && g(r.g) && g(r.b) ? (e = B(r.r, r.g, r.b), i = !0, h = String(r.r).substr(-1) === "%" ? "prgb" : "rgb") : g(r.h) && g(r.s) && g(r.v) ? (n = p(r.s), s = p(r.v), e = P(r.h, n, s), i = !0, h = "hsv") : g(r.h) && g(r.s) && g(r.l) ? (n = p(r.s), a = p(r.l), e = q(r.h, n, a), i = !0, h = "hsl") : g(r.c) && g(r.m) && g(r.y) && g(r.k) && (e = O(r.c, r.m, r.y, r.k), i = !0, h = "cmyk"), Object.prototype.hasOwnProperty.call(r, "a") && (t = r.a)), t = F(t), {
312
+ ok: i,
313
+ format: r.format || h,
314
+ r: Math.min(255, Math.max(e.r, 0)),
315
+ g: Math.min(255, Math.max(e.g, 0)),
316
+ b: Math.min(255, Math.max(e.b, 0)),
317
+ a: t
318
+ };
319
+ }
320
+ const U = "[-\\+]?\\d+%?", D = "[-\\+]?\\d*\\.\\d+%?", b = "(?:" + D + ")|(?:" + U + ")", S = "[\\s|\\(]+(" + b + ")[,|\\s]+(" + b + ")[,|\\s]+(" + b + ")\\s*\\)?", k = (
321
+ // eslint-disable-next-line prettier/prettier
322
+ "[\\s|\\(]+(" + b + ")[,|\\s]+(" + b + ")[,|\\s]+(" + b + ")[,|\\s]+(" + b + ")\\s*\\)?"
323
+ ), d = {
324
+ CSS_UNIT: new RegExp(b),
325
+ rgb: new RegExp("rgb" + S),
326
+ rgba: new RegExp("rgba" + k),
327
+ hsl: new RegExp("hsl" + S),
328
+ hsla: new RegExp("hsla" + k),
329
+ hsv: new RegExp("hsv" + S),
330
+ hsva: new RegExp("hsva" + k),
331
+ cmyk: new RegExp("cmyk" + k),
332
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
333
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
334
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
335
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
336
+ };
337
+ function V(r) {
338
+ if (r = r.trim().toLowerCase(), r.length === 0)
339
+ return !1;
340
+ let e = !1;
341
+ if (y[r])
342
+ r = y[r], e = !0;
343
+ else if (r === "transparent")
344
+ return { r: 0, g: 0, b: 0, a: 0, format: "name" };
345
+ let t = d.rgb.exec(r);
346
+ return t ? { r: t[1], g: t[2], b: t[3] } : (t = d.rgba.exec(r), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = d.hsl.exec(r), t ? { h: t[1], s: t[2], l: t[3] } : (t = d.hsla.exec(r), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = d.hsv.exec(r), t ? { h: t[1], s: t[2], v: t[3] } : (t = d.hsva.exec(r), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = d.cmyk.exec(r), t ? {
347
+ c: t[1],
348
+ m: t[2],
349
+ y: t[3],
350
+ k: t[4]
351
+ } : (t = d.hex8.exec(r), t ? {
352
+ r: c(t[1]),
353
+ g: c(t[2]),
354
+ b: c(t[3]),
355
+ a: $(t[4]),
356
+ format: e ? "name" : "hex8"
357
+ } : (t = d.hex6.exec(r), t ? {
358
+ r: c(t[1]),
359
+ g: c(t[2]),
360
+ b: c(t[3]),
361
+ format: e ? "name" : "hex"
362
+ } : (t = d.hex4.exec(r), t ? {
363
+ r: c(t[1] + t[1]),
364
+ g: c(t[2] + t[2]),
365
+ b: c(t[3] + t[3]),
366
+ a: $(t[4] + t[4]),
367
+ format: e ? "name" : "hex8"
368
+ } : (t = d.hex3.exec(r), t ? {
369
+ r: c(t[1] + t[1]),
370
+ g: c(t[2] + t[2]),
371
+ b: c(t[3] + t[3]),
372
+ format: e ? "name" : "hex"
373
+ } : !1))))))))));
374
+ }
375
+ function g(r) {
376
+ return typeof r == "number" ? !Number.isNaN(r) : d.CSS_UNIT.test(r);
377
+ }
378
+ class f {
379
+ constructor(e = "", t = {}) {
380
+ if (e instanceof f)
381
+ return e;
382
+ typeof e == "number" && (e = G(e)), this.originalInput = e;
383
+ const n = T(e);
384
+ this.originalInput = e, this.r = n.r, this.g = n.g, this.b = n.b, this.a = n.a, this.roundA = Math.round(100 * this.a) / 100, this.format = t.format ?? n.format, this.gradientType = t.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = n.ok;
385
+ }
386
+ isDark() {
387
+ return this.getBrightness() < 128;
388
+ }
389
+ isLight() {
390
+ return !this.isDark();
391
+ }
392
+ /**
393
+ * Returns the perceived brightness of the color, from 0-255.
394
+ */
395
+ getBrightness() {
396
+ const e = this.toRgb();
397
+ return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
398
+ }
399
+ /**
400
+ * Returns the perceived luminance of a color, from 0-1.
401
+ */
402
+ getLuminance() {
403
+ const e = this.toRgb();
404
+ let t, n, s;
405
+ const a = e.r / 255, i = e.g / 255, h = e.b / 255;
406
+ return a <= 0.03928 ? t = a / 12.92 : t = Math.pow((a + 0.055) / 1.055, 2.4), i <= 0.03928 ? n = i / 12.92 : n = Math.pow((i + 0.055) / 1.055, 2.4), h <= 0.03928 ? s = h / 12.92 : s = Math.pow((h + 0.055) / 1.055, 2.4), 0.2126 * t + 0.7152 * n + 0.0722 * s;
407
+ }
408
+ /**
409
+ * Returns the alpha value of a color, from 0-1.
410
+ */
411
+ getAlpha() {
412
+ return this.a;
413
+ }
414
+ /**
415
+ * Sets the alpha value on the current color.
416
+ *
417
+ * @param alpha - The new alpha value. The accepted range is 0-1.
418
+ */
419
+ setAlpha(e) {
420
+ return this.a = F(e), this.roundA = Math.round(100 * this.a) / 100, this;
421
+ }
422
+ /**
423
+ * Returns whether the color is monochrome.
424
+ */
425
+ isMonochrome() {
426
+ const { s: e } = this.toHsl();
427
+ return e === 0;
428
+ }
429
+ /**
430
+ * Returns the object as a HSVA object.
431
+ */
432
+ toHsv() {
433
+ const e = A(this.r, this.g, this.b);
434
+ return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
435
+ }
436
+ /**
437
+ * Returns the hsva values interpolated into a string with the following format:
438
+ * "hsva(xxx, xxx, xxx, xx)".
439
+ */
440
+ toHsvString() {
441
+ const e = A(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), s = Math.round(e.v * 100);
442
+ return this.a === 1 ? `hsv(${t}, ${n}%, ${s}%)` : `hsva(${t}, ${n}%, ${s}%, ${this.roundA})`;
443
+ }
444
+ /**
445
+ * Returns the object as a HSLA object.
446
+ */
447
+ toHsl() {
448
+ const e = v(this.r, this.g, this.b);
449
+ return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
450
+ }
451
+ /**
452
+ * Returns the hsla values interpolated into a string with the following format:
453
+ * "hsla(xxx, xxx, xxx, xx)".
454
+ */
455
+ toHslString() {
456
+ const e = v(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), s = Math.round(e.l * 100);
457
+ return this.a === 1 ? `hsl(${t}, ${n}%, ${s}%)` : `hsla(${t}, ${n}%, ${s}%, ${this.roundA})`;
458
+ }
459
+ /**
460
+ * Returns the hex value of the color.
461
+ * @param allow3Char will shorten hex value to 3 char if possible
462
+ */
463
+ toHex(e = !1) {
464
+ return H(this.r, this.g, this.b, e);
465
+ }
466
+ /**
467
+ * Returns the hex value of the color -with a # prefixed.
468
+ * @param allow3Char will shorten hex value to 3 char if possible
469
+ */
470
+ toHexString(e = !1) {
471
+ return "#" + this.toHex(e);
472
+ }
473
+ /**
474
+ * Returns the hex 8 value of the color.
475
+ * @param allow4Char will shorten hex value to 4 char if possible
476
+ */
477
+ toHex8(e = !1) {
478
+ return j(this.r, this.g, this.b, this.a, e);
479
+ }
480
+ /**
481
+ * Returns the hex 8 value of the color -with a # prefixed.
482
+ * @param allow4Char will shorten hex value to 4 char if possible
483
+ */
484
+ toHex8String(e = !1) {
485
+ return "#" + this.toHex8(e);
486
+ }
487
+ /**
488
+ * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
489
+ * @param allowShortChar will shorten hex value to 3 or 4 char if possible
490
+ */
491
+ toHexShortString(e = !1) {
492
+ return this.a === 1 ? this.toHexString(e) : this.toHex8String(e);
493
+ }
494
+ /**
495
+ * Returns the object as a RGBA object.
496
+ */
497
+ toRgb() {
498
+ return {
499
+ r: Math.round(this.r),
500
+ g: Math.round(this.g),
501
+ b: Math.round(this.b),
502
+ a: this.a
503
+ };
504
+ }
505
+ /**
506
+ * Returns the RGBA values interpolated into a string with the following format:
507
+ * "RGBA(xxx, xxx, xxx, xx)".
508
+ */
509
+ toRgbString() {
510
+ const e = Math.round(this.r), t = Math.round(this.g), n = Math.round(this.b);
511
+ return this.a === 1 ? `rgb(${e}, ${t}, ${n})` : `rgba(${e}, ${t}, ${n}, ${this.roundA})`;
512
+ }
513
+ /**
514
+ * Returns the object as a RGBA object.
515
+ */
516
+ toPercentageRgb() {
517
+ const e = (t) => `${Math.round(u(t, 255) * 100)}%`;
518
+ return {
519
+ r: e(this.r),
520
+ g: e(this.g),
521
+ b: e(this.b),
522
+ a: this.a
523
+ };
524
+ }
525
+ /**
526
+ * Returns the RGBA relative values interpolated into a string
527
+ */
528
+ toPercentageRgbString() {
529
+ const e = (t) => Math.round(u(t, 255) * 100);
530
+ return this.a === 1 ? `rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)` : `rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`;
531
+ }
532
+ toCmyk() {
533
+ return {
534
+ ...R(this.r, this.g, this.b)
535
+ };
536
+ }
537
+ toCmykString() {
538
+ const { c: e, m: t, y: n, k: s } = R(this.r, this.g, this.b);
539
+ return `cmyk(${e}, ${t}, ${n}, ${s})`;
540
+ }
541
+ /**
542
+ * The 'real' name of the color -if there is one.
543
+ */
544
+ toName() {
545
+ if (this.a === 0)
546
+ return "transparent";
547
+ if (this.a < 1)
548
+ return !1;
549
+ const e = "#" + H(this.r, this.g, this.b, !1);
550
+ for (const [t, n] of Object.entries(y))
551
+ if (e === n)
552
+ return t;
553
+ return !1;
554
+ }
555
+ toString(e) {
556
+ const t = !!e;
557
+ e = e ?? this.format;
558
+ let n = !1;
559
+ const s = this.a < 1 && this.a >= 0;
560
+ return !t && s && (e.startsWith("hex") || e === "name") ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), e === "cmyk" && (n = this.toCmykString()), n || this.toHexString());
561
+ }
562
+ toNumber() {
563
+ return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
564
+ }
565
+ clone() {
566
+ return new f(this.toString());
567
+ }
568
+ /**
569
+ * Lighten the color a given amount. Providing 100 will always return white.
570
+ * @param amount - valid between 1-100
571
+ */
572
+ lighten(e = 10) {
573
+ const t = this.toHsl();
574
+ return t.l += e / 100, t.l = m(t.l), new f(t);
575
+ }
576
+ /**
577
+ * Brighten the color a given amount, from 0 to 100.
578
+ * @param amount - valid between 1-100
579
+ */
580
+ brighten(e = 10) {
581
+ const t = this.toRgb();
582
+ return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), new f(t);
583
+ }
584
+ /**
585
+ * Darken the color a given amount, from 0 to 100.
586
+ * Providing 100 will always return black.
587
+ * @param amount - valid between 1-100
588
+ */
589
+ darken(e = 10) {
590
+ const t = this.toHsl();
591
+ return t.l -= e / 100, t.l = m(t.l), new f(t);
592
+ }
593
+ /**
594
+ * Mix the color with pure white, from 0 to 100.
595
+ * Providing 0 will do nothing, providing 100 will always return white.
596
+ * @param amount - valid between 1-100
597
+ */
598
+ tint(e = 10) {
599
+ return this.mix("white", e);
600
+ }
601
+ /**
602
+ * Mix the color with pure black, from 0 to 100.
603
+ * Providing 0 will do nothing, providing 100 will always return black.
604
+ * @param amount - valid between 1-100
605
+ */
606
+ shade(e = 10) {
607
+ return this.mix("black", e);
608
+ }
609
+ /**
610
+ * Desaturate the color a given amount, from 0 to 100.
611
+ * Providing 100 will is the same as calling greyscale
612
+ * @param amount - valid between 1-100
613
+ */
614
+ desaturate(e = 10) {
615
+ const t = this.toHsl();
616
+ return t.s -= e / 100, t.s = m(t.s), new f(t);
617
+ }
618
+ /**
619
+ * Saturate the color a given amount, from 0 to 100.
620
+ * @param amount - valid between 1-100
621
+ */
622
+ saturate(e = 10) {
623
+ const t = this.toHsl();
624
+ return t.s += e / 100, t.s = m(t.s), new f(t);
625
+ }
626
+ /**
627
+ * Completely desaturates a color into greyscale.
628
+ * Same as calling `desaturate(100)`
629
+ */
630
+ greyscale() {
631
+ return this.desaturate(100);
632
+ }
633
+ /**
634
+ * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
635
+ * Values outside of this range will be wrapped into this range.
636
+ */
637
+ spin(e) {
638
+ const t = this.toHsl(), n = (t.h + e) % 360;
639
+ return t.h = n < 0 ? 360 + n : n, new f(t);
640
+ }
641
+ /**
642
+ * Mix the current color a given amount with another color, from 0 to 100.
643
+ * 0 means no mixing (return current color).
644
+ */
645
+ mix(e, t = 50) {
646
+ const n = this.toRgb(), s = new f(e).toRgb(), a = t / 100, i = {
647
+ r: (s.r - n.r) * a + n.r,
648
+ g: (s.g - n.g) * a + n.g,
649
+ b: (s.b - n.b) * a + n.b,
650
+ a: (s.a - n.a) * a + n.a
651
+ };
652
+ return new f(i);
653
+ }
654
+ analogous(e = 6, t = 30) {
655
+ const n = this.toHsl(), s = 360 / t, a = [this];
656
+ for (n.h = (n.h - (s * e >> 1) + 720) % 360; --e; )
657
+ n.h = (n.h + s) % 360, a.push(new f(n));
658
+ return a;
659
+ }
660
+ /**
661
+ * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
662
+ */
663
+ complement() {
664
+ const e = this.toHsl();
665
+ return e.h = (e.h + 180) % 360, new f(e);
666
+ }
667
+ monochromatic(e = 6) {
668
+ const t = this.toHsv(), { h: n } = t, { s } = t;
669
+ let { v: a } = t;
670
+ const i = [], h = 1 / e;
671
+ for (; e--; )
672
+ i.push(new f({ h: n, s, v: a })), a = (a + h) % 1;
673
+ return i;
674
+ }
675
+ splitcomplement() {
676
+ const e = this.toHsl(), { h: t } = e;
677
+ return [
678
+ this,
679
+ new f({ h: (t + 72) % 360, s: e.s, l: e.l }),
680
+ new f({ h: (t + 216) % 360, s: e.s, l: e.l })
681
+ ];
682
+ }
683
+ /**
684
+ * Compute how the color would appear on a background
685
+ */
686
+ onBackground(e) {
687
+ const t = this.toRgb(), n = new f(e).toRgb(), s = t.a + n.a * (1 - t.a);
688
+ return new f({
689
+ r: (t.r * t.a + n.r * n.a * (1 - t.a)) / s,
690
+ g: (t.g * t.a + n.g * n.a * (1 - t.a)) / s,
691
+ b: (t.b * t.a + n.b * n.a * (1 - t.a)) / s,
692
+ a: s
693
+ });
694
+ }
695
+ /**
696
+ * Alias for `polyad(3)`
697
+ */
698
+ triad() {
699
+ return this.polyad(3);
700
+ }
701
+ /**
702
+ * Alias for `polyad(4)`
703
+ */
704
+ tetrad() {
705
+ return this.polyad(4);
706
+ }
707
+ /**
708
+ * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
709
+ * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
710
+ */
711
+ polyad(e) {
712
+ const t = this.toHsl(), { h: n } = t, s = [this], a = 360 / e;
713
+ for (let i = 1; i < e; i++)
714
+ s.push(new f({ h: (n + i * a) % 360, s: t.s, l: t.l }));
715
+ return s;
716
+ }
717
+ /**
718
+ * compare color vs current color
719
+ */
720
+ equals(e) {
721
+ const t = new f(e);
722
+ return this.format === "cmyk" || t.format === "cmyk" ? this.toCmykString() === t.toCmykString() : this.toRgbString() === t.toRgbString();
723
+ }
724
+ }
725
+ export {
726
+ f as T
727
+ };