@esri/calcite-components 1.0.0-next.442 → 1.0.0-next.445

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 (823) hide show
  1. package/dist/calcite/calcite.esm.js +2 -2
  2. package/dist/calcite/calcite.js +1 -1
  3. package/dist/calcite/index.esm.js +1 -1
  4. package/dist/calcite/{p-33052713.entry.js → p-01713417.entry.js} +2 -2
  5. package/dist/calcite/{p-5d9d078d.system.entry.js → p-02fd2883.system.entry.js} +2 -2
  6. package/dist/calcite/{p-0d1c5707.js → p-041b61cd.js} +2 -2
  7. package/dist/calcite/p-05751f2e.entry.js +6 -0
  8. package/dist/calcite/p-07e641ba.js +6 -0
  9. package/dist/calcite/p-090880ec.entry.js +6 -0
  10. package/dist/calcite/{p-ad36023a.system.entry.js → p-0b025cd8.system.entry.js} +2 -2
  11. package/dist/calcite/{p-ce37501d.system.entry.js → p-0ccf95ca.system.entry.js} +2 -2
  12. package/dist/calcite/p-0e9766c8.entry.js +6 -0
  13. package/dist/calcite/{p-9bec437f.system.entry.js → p-0f5a49ed.system.entry.js} +2 -2
  14. package/dist/calcite/{p-95f3f34b.entry.js → p-0f89e70c.entry.js} +2 -2
  15. package/dist/calcite/{p-d4d75ba6.system.entry.js → p-108d9717.system.entry.js} +2 -2
  16. package/dist/calcite/{p-6ad109fa.system.entry.js → p-11ba757d.system.entry.js} +2 -2
  17. package/dist/calcite/{p-68688c2e.system.entry.js → p-133372fd.system.entry.js} +2 -2
  18. package/dist/calcite/{p-7853d93c.system.entry.js → p-14ec9332.system.entry.js} +2 -2
  19. package/dist/calcite/{p-c247533e.system.entry.js → p-161c0fe3.system.entry.js} +3 -3
  20. package/dist/calcite/{p-6c467929.system.js → p-16dde710.system.js} +1 -1
  21. package/dist/calcite/{p-e804e1ec.system.js → p-1d36af45.system.js} +1 -1
  22. package/dist/calcite/{p-7f1849d1.entry.js → p-1deaa010.entry.js} +2 -2
  23. package/dist/calcite/{p-dcd5fc83.entry.js → p-1f2f75cb.entry.js} +2 -2
  24. package/dist/calcite/{p-d0710c22.system.entry.js → p-204cff7c.system.entry.js} +2 -2
  25. package/dist/calcite/{p-c8618e02.js → p-253921ef.js} +1 -1
  26. package/dist/calcite/{p-4eeb59cb.system.js → p-258de3b5.system.js} +1 -1
  27. package/dist/calcite/{p-db8ddafb.entry.js → p-25ee06e8.entry.js} +2 -2
  28. package/dist/calcite/{p-7cb13427.entry.js → p-266d8bf5.entry.js} +2 -2
  29. package/dist/calcite/{p-1891170c.system.entry.js → p-26a03754.system.entry.js} +2 -2
  30. package/dist/calcite/{p-164c480c.entry.js → p-27627646.entry.js} +2 -2
  31. package/dist/calcite/{p-c5680ed3.system.js → p-27bf89cf.system.js} +2 -2
  32. package/dist/calcite/{p-3f028403.entry.js → p-27d2b999.entry.js} +2 -2
  33. package/dist/calcite/{p-44473ead.system.entry.js → p-28383893.system.entry.js} +2 -2
  34. package/dist/calcite/{p-e36fd7f8.system.entry.js → p-28ab1bdc.system.entry.js} +2 -2
  35. package/dist/calcite/{p-e20f6136.system.entry.js → p-29ffb1a4.system.entry.js} +2 -2
  36. package/dist/calcite/{p-5b64c3a7.entry.js → p-2d00654f.entry.js} +2 -2
  37. package/dist/calcite/{p-343d5421.entry.js → p-2daf552b.entry.js} +2 -2
  38. package/dist/calcite/{p-71153bb4.system.js → p-2e5debed.system.js} +1 -1
  39. package/dist/calcite/{p-cec2c39f.system.entry.js → p-2ef6c164.system.entry.js} +2 -2
  40. package/dist/calcite/{p-2c4da511.entry.js → p-2ffe62e7.entry.js} +2 -2
  41. package/dist/calcite/{p-d6ed0fa5.system.js → p-31197ab6.system.js} +1 -1
  42. package/dist/calcite/{p-4a4e0482.system.js → p-311f6ae3.system.js} +3 -3
  43. package/dist/calcite/{p-a9f49aba.system.entry.js → p-319fca0a.system.entry.js} +2 -2
  44. package/dist/calcite/{p-876086da.js → p-336577c6.js} +1 -1
  45. package/dist/calcite/{p-d845a221.system.js → p-34e35997.system.js} +2 -2
  46. package/dist/calcite/{p-ef71ed4d.js → p-355798dd.js} +1 -1
  47. package/dist/calcite/{p-b7a0dc57.entry.js → p-3746cde8.entry.js} +2 -2
  48. package/dist/calcite/{p-eb343d7c.system.entry.js → p-37d36485.system.entry.js} +2 -2
  49. package/dist/calcite/{p-daa14b5d.system.entry.js → p-381ae536.system.entry.js} +2 -2
  50. package/dist/calcite/{p-43db2b70.system.js → p-390993de.system.js} +3 -3
  51. package/dist/calcite/{p-341b024c.entry.js → p-39bc7480.entry.js} +2 -2
  52. package/dist/calcite/{p-2b10093d.js → p-3b2f0536.js} +2 -2
  53. package/dist/calcite/{p-c79d0614.entry.js → p-3dba8986.entry.js} +2 -2
  54. package/dist/calcite/{p-1ee6d0d4.system.js → p-3fea8ac9.system.js} +1 -1
  55. package/dist/calcite/{p-2e0be8a8.system.entry.js → p-4039990d.system.entry.js} +2 -2
  56. package/dist/calcite/{p-284dcfd1.entry.js → p-42dc5adc.entry.js} +2 -2
  57. package/dist/calcite/{p-e04fc57e.system.entry.js → p-4393b27e.system.entry.js} +2 -2
  58. package/dist/calcite/{p-57b016e9.entry.js → p-47872617.entry.js} +2 -2
  59. package/dist/calcite/{p-baee9a51.entry.js → p-4985c997.entry.js} +2 -2
  60. package/dist/calcite/{p-113f98cd.system.js → p-4a13b25d.system.js} +1 -1
  61. package/dist/calcite/{p-01a3f9a2.system.entry.js → p-4a910e1a.system.entry.js} +2 -2
  62. package/dist/calcite/{p-643ab994.entry.js → p-4b259c5a.entry.js} +2 -2
  63. package/dist/calcite/{p-7fa4665b.system.entry.js → p-4bbc21ae.system.entry.js} +2 -2
  64. package/dist/calcite/{p-dfa1a3db.system.entry.js → p-4cff6ed2.system.entry.js} +2 -2
  65. package/dist/calcite/{p-a6f6ea44.system.entry.js → p-50b46f23.system.entry.js} +2 -2
  66. package/dist/calcite/{p-a692a2b4.system.entry.js → p-548dfc90.system.entry.js} +3 -3
  67. package/dist/calcite/{p-854d1ac1.entry.js → p-5500906f.entry.js} +2 -2
  68. package/dist/calcite/{p-2134e42a.entry.js → p-569ab61c.entry.js} +2 -2
  69. package/dist/calcite/{p-95779802.js → p-57d67d2d.js} +1 -1
  70. package/dist/calcite/{p-dd94caa9.system.js → p-58a52a1c.system.js} +1 -1
  71. package/dist/calcite/{p-643bc2de.system.entry.js → p-5a60f994.system.entry.js} +2 -2
  72. package/dist/calcite/p-5bf8f6e9.system.js +6 -0
  73. package/dist/calcite/{p-af237d7a.system.js → p-5e296f6a.system.js} +2 -2
  74. package/dist/calcite/{p-3aa0fc1f.entry.js → p-6723c6d8.entry.js} +2 -2
  75. package/dist/calcite/{p-7e2e7425.js → p-6aa710a4.js} +1 -1
  76. package/dist/calcite/{p-0d2be404.system.entry.js → p-6bef1081.system.entry.js} +2 -2
  77. package/dist/calcite/{p-a723b07f.entry.js → p-74c3913a.entry.js} +2 -2
  78. package/dist/calcite/{p-1b93ee1f.system.entry.js → p-7c2843ca.system.entry.js} +2 -2
  79. package/dist/calcite/{p-54857871.system.entry.js → p-7d21684c.system.entry.js} +2 -2
  80. package/dist/calcite/{p-8e33274a.entry.js → p-7ebc43e6.entry.js} +2 -2
  81. package/dist/calcite/{p-e1afa707.system.entry.js → p-80e9f473.system.entry.js} +2 -2
  82. package/dist/calcite/{p-e0bc8a42.entry.js → p-8491b37f.entry.js} +2 -2
  83. package/dist/calcite/{p-d76c1857.system.entry.js → p-84d89c27.system.entry.js} +2 -2
  84. package/dist/calcite/{p-967b0d5c.system.entry.js → p-886b7bfa.system.entry.js} +2 -2
  85. package/dist/calcite/{p-dae31e5f.system.entry.js → p-8b3108fe.system.entry.js} +2 -2
  86. package/dist/calcite/{p-886d0ac9.system.entry.js → p-8b808b4a.system.entry.js} +2 -2
  87. package/dist/calcite/{p-78e3886c.entry.js → p-8b8402ab.entry.js} +2 -2
  88. package/dist/calcite/{p-6f203345.entry.js → p-8eb729b2.entry.js} +2 -2
  89. package/dist/calcite/{p-f7d7bad9.entry.js → p-8f061a44.entry.js} +2 -2
  90. package/dist/calcite/{p-38bb1024.entry.js → p-926b60ef.entry.js} +2 -2
  91. package/dist/calcite/p-9500d5a1.entry.js +6 -0
  92. package/dist/calcite/{p-46698107.system.entry.js → p-95bfbf7e.system.entry.js} +2 -2
  93. package/dist/calcite/{p-30edf4d0.system.entry.js → p-97dd099f.system.entry.js} +2 -2
  94. package/dist/calcite/{p-7ddb381f.js → p-97fd0700.js} +2 -2
  95. package/dist/calcite/{p-9188a778.entry.js → p-9988579e.entry.js} +2 -2
  96. package/dist/calcite/{p-dfc3aa2a.system.entry.js → p-99b389a4.system.entry.js} +2 -2
  97. package/dist/calcite/{p-9e12764a.system.js → p-99b56a57.system.js} +1 -1
  98. package/dist/calcite/{p-5820b406.system.entry.js → p-9ffb0f8e.system.entry.js} +2 -2
  99. package/dist/calcite/{p-93a12f34.system.js → p-a01d5702.system.js} +1 -1
  100. package/dist/calcite/{p-1c4f0248.entry.js → p-a284f057.entry.js} +2 -2
  101. package/dist/calcite/{p-13e09a60.entry.js → p-a39652a8.entry.js} +2 -2
  102. package/dist/calcite/{p-0d821056.entry.js → p-a39a6120.entry.js} +2 -2
  103. package/dist/calcite/{p-521b5c5f.entry.js → p-a4be4ad7.entry.js} +2 -2
  104. package/dist/calcite/{p-a67a436b.entry.js → p-a544af14.entry.js} +2 -2
  105. package/dist/calcite/{p-7c3d07cd.system.entry.js → p-a6c8b4f4.system.entry.js} +2 -2
  106. package/dist/calcite/{p-948eeaf1.system.js → p-a7793b59.system.js} +1 -1
  107. package/dist/calcite/{p-a87b026c.system.entry.js → p-aa8cd021.system.entry.js} +2 -2
  108. package/dist/calcite/{p-6d264ef2.system.entry.js → p-abc466c1.system.entry.js} +2 -2
  109. package/dist/calcite/{p-54ece774.js → p-ad7a67c5.js} +1 -1
  110. package/dist/calcite/{p-5d08adeb.entry.js → p-ae1dd9d3.entry.js} +2 -2
  111. package/dist/calcite/{p-08ac85e4.entry.js → p-b02dac57.entry.js} +2 -2
  112. package/dist/calcite/p-b0a06984.entry.js +6 -0
  113. package/dist/calcite/{p-d40c49db.entry.js → p-b0f109f2.entry.js} +2 -2
  114. package/dist/calcite/p-b17f15dc.js +6 -0
  115. package/dist/calcite/p-b1b979a8.system.js +6 -0
  116. package/dist/calcite/{p-d6da85a7.js → p-b2caaa6b.js} +2 -2
  117. package/dist/calcite/p-b31c76ec.system.js +6 -0
  118. package/dist/calcite/{p-7a9ae2ca.js → p-b4d3d3e3.js} +2 -2
  119. package/dist/calcite/{p-0de41b26.system.entry.js → p-b8d7f7c8.system.entry.js} +2 -2
  120. package/dist/calcite/{p-c6f66549.entry.js → p-b9a581df.entry.js} +2 -2
  121. package/dist/calcite/{p-e4a3e626.entry.js → p-bbb08025.entry.js} +2 -2
  122. package/dist/calcite/p-bcbdb44e.entry.js +6 -0
  123. package/dist/calcite/{p-22527dd8.entry.js → p-be089f07.entry.js} +2 -2
  124. package/dist/calcite/{p-cccf7888.js → p-be653c75.js} +1 -1
  125. package/dist/calcite/{p-eeed1462.entry.js → p-bf8a1a90.entry.js} +2 -2
  126. package/dist/calcite/{p-788d9af6.js → p-cb4a4c11.js} +1 -1
  127. package/dist/calcite/{p-8d28bdeb.entry.js → p-cbed5ee5.entry.js} +2 -2
  128. package/dist/calcite/{p-94869dec.system.entry.js → p-cc06ca0e.system.entry.js} +2 -2
  129. package/dist/calcite/{p-65304fd3.entry.js → p-cc496db8.entry.js} +2 -2
  130. package/dist/calcite/{p-81ffe774.entry.js → p-ced91d61.entry.js} +2 -2
  131. package/dist/calcite/{p-1931fab1.system.js → p-d0dd920e.system.js} +2 -2
  132. package/dist/calcite/p-d1b2d2c5.js +6 -0
  133. package/dist/calcite/{p-577c6140.system.entry.js → p-d3a24a92.system.entry.js} +2 -2
  134. package/dist/calcite/{p-8bb3fb6e.system.entry.js → p-d49affe7.system.entry.js} +2 -2
  135. package/dist/calcite/{p-8e7e6bf1.system.js → p-d4f2f493.system.js} +2 -2
  136. package/dist/calcite/{p-4d5badd1.system.js → p-d57599f3.system.js} +1 -1
  137. package/dist/calcite/{p-018a7a88.js → p-d647b605.js} +2 -2
  138. package/dist/calcite/{p-5fe433a2.system.js → p-d6ef83f2.system.js} +1 -1
  139. package/dist/calcite/{p-dd19dab2.system.entry.js → p-d9639ef6.system.entry.js} +2 -2
  140. package/dist/calcite/{p-f600eeb3.entry.js → p-dac748b6.entry.js} +2 -2
  141. package/dist/calcite/{p-9e58d2f5.system.js → p-dcd26c5b.system.js} +2 -2
  142. package/dist/calcite/{p-2753f19d.entry.js → p-dcd66dbe.entry.js} +2 -2
  143. package/dist/calcite/{p-59164e48.entry.js → p-dd148aa5.entry.js} +2 -2
  144. package/dist/calcite/{p-8b66caeb.js → p-dd2433b8.js} +1 -1
  145. package/dist/calcite/{p-d9ca5de6.system.entry.js → p-de88a90d.system.entry.js} +2 -2
  146. package/dist/calcite/{p-270c69af.system.entry.js → p-df191ce8.system.entry.js} +2 -2
  147. package/dist/calcite/{p-63be73b7.system.entry.js → p-e455cf93.system.entry.js} +2 -2
  148. package/dist/calcite/{p-50a8b856.entry.js → p-e5147246.entry.js} +2 -2
  149. package/dist/calcite/{p-4df1f8b0.system.entry.js → p-e5c97b3c.system.entry.js} +2 -2
  150. package/dist/calcite/{p-e350bf84.system.entry.js → p-e798397b.system.entry.js} +2 -2
  151. package/dist/calcite/{p-0443feac.system.entry.js → p-e7b32606.system.entry.js} +2 -2
  152. package/dist/calcite/p-ea01de75.js +6 -0
  153. package/dist/calcite/{p-82264ba9.js → p-ec8f422f.js} +1 -1
  154. package/dist/calcite/{p-e0b0486e.system.entry.js → p-f3465688.system.entry.js} +2 -2
  155. package/dist/calcite/p-f37cb564.js +6 -0
  156. package/dist/calcite/{p-76fad783.js → p-f53b0e25.js} +1 -1
  157. package/dist/calcite/{p-5ee7283a.entry.js → p-f6795331.entry.js} +2 -2
  158. package/dist/calcite/{p-afaded78.system.js → p-f713dcde.system.js} +2 -2
  159. package/dist/calcite/{p-9cdb2412.system.entry.js → p-f7d5923a.system.entry.js} +2 -2
  160. package/dist/calcite/{p-199d6edc.system.entry.js → p-f984a8fb.system.entry.js} +2 -2
  161. package/dist/calcite/{p-0fd5298e.js → p-fa493d09.js} +1 -1
  162. package/dist/calcite/{p-eada3f06.system.js → p-fbcdf49c.system.js} +1 -1
  163. package/dist/calcite/{p-adb9456b.js → p-fe25dd66.js} +1 -1
  164. package/dist/calcite/{p-74f44d5c.entry.js → p-fecc0290.entry.js} +2 -2
  165. package/dist/calcite/{p-ee6e86eb.entry.js → p-ff299c31.entry.js} +2 -2
  166. package/dist/calcite/{p-fda6176c.system.entry.js → p-ff6ac4c3.system.entry.js} +3 -3
  167. package/dist/calcite/p-ff8e5fb9.system.entry.js +6 -0
  168. package/dist/cjs/{ExpandToggle-520a0d2c.js → ExpandToggle-1d84a30f.js} +6 -6
  169. package/dist/cjs/{Heading-4031b535.js → Heading-6c577985.js} +2 -2
  170. package/dist/cjs/{array-97a0d49e.js → array-ad1d1402.js} +1 -1
  171. package/dist/cjs/calcite-accordion_2.cjs.entry.js +4 -4
  172. package/dist/cjs/calcite-action-bar.cjs.entry.js +10 -10
  173. package/dist/cjs/calcite-action-group.cjs.entry.js +8 -8
  174. package/dist/cjs/calcite-action-menu.cjs.entry.js +10 -10
  175. package/dist/cjs/calcite-action-pad.cjs.entry.js +9 -9
  176. package/dist/cjs/calcite-action.cjs.entry.js +4 -4
  177. package/dist/cjs/calcite-alert.cjs.entry.js +6 -6
  178. package/dist/cjs/calcite-avatar.cjs.entry.js +6 -6
  179. package/dist/cjs/calcite-block_2.cjs.entry.js +8 -8
  180. package/dist/cjs/calcite-button.cjs.entry.js +7 -7
  181. package/dist/cjs/calcite-card.cjs.entry.js +6 -6
  182. package/dist/cjs/calcite-checkbox.cjs.entry.js +8 -8
  183. package/dist/cjs/calcite-chip.cjs.entry.js +7 -7
  184. package/dist/cjs/calcite-color-picker_3.cjs.entry.js +1293 -1309
  185. package/dist/cjs/calcite-combobox_3.cjs.entry.js +12 -12
  186. package/dist/cjs/calcite-date-picker_4.cjs.entry.js +10 -10
  187. package/dist/cjs/calcite-dropdown_3.cjs.entry.js +7 -7
  188. package/dist/cjs/calcite-fab.cjs.entry.js +5 -5
  189. package/dist/cjs/calcite-filter.cjs.entry.js +7 -7
  190. package/dist/cjs/calcite-flow.cjs.entry.js +4 -4
  191. package/dist/cjs/calcite-graph_2.cjs.entry.js +9 -9
  192. package/dist/cjs/calcite-handle.cjs.entry.js +2 -2
  193. package/dist/cjs/calcite-icon.cjs.entry.js +5 -5
  194. package/dist/cjs/calcite-inline-editable.cjs.entry.js +7 -7
  195. package/dist/cjs/calcite-input-date-picker.cjs.entry.js +20 -11
  196. package/dist/cjs/calcite-input-message.cjs.entry.js +4 -4
  197. package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +8 -8
  198. package/dist/cjs/calcite-input.cjs.entry.js +11 -11
  199. package/dist/cjs/calcite-label.cjs.entry.js +5 -5
  200. package/dist/cjs/calcite-link.cjs.entry.js +5 -5
  201. package/dist/cjs/calcite-list_3.cjs.entry.js +8 -8
  202. package/dist/cjs/calcite-loader.cjs.entry.js +3 -3
  203. package/dist/cjs/calcite-modal.cjs.entry.js +7 -7
  204. package/dist/cjs/calcite-notice.cjs.entry.js +7 -7
  205. package/dist/cjs/calcite-option_3.cjs.entry.js +8 -8
  206. package/dist/cjs/calcite-pagination.cjs.entry.js +2 -2
  207. package/dist/cjs/calcite-panel.cjs.entry.js +12 -10
  208. package/dist/cjs/calcite-pick-list_3.cjs.entry.js +12 -12
  209. package/dist/cjs/calcite-popover_2.cjs.entry.js +6 -6
  210. package/dist/cjs/calcite-progress.cjs.entry.js +2 -2
  211. package/dist/cjs/calcite-radio-button-group.cjs.entry.js +3 -3
  212. package/dist/cjs/calcite-radio-button.cjs.entry.js +8 -8
  213. package/dist/cjs/calcite-radio-group_2.cjs.entry.js +7 -7
  214. package/dist/cjs/calcite-rating.cjs.entry.js +7 -7
  215. package/dist/cjs/calcite-scrim.cjs.entry.js +2 -2
  216. package/dist/cjs/calcite-shell_3.cjs.entry.js +9 -9
  217. package/dist/cjs/calcite-sortable-list.cjs.entry.js +5 -5
  218. package/dist/cjs/calcite-split-button.cjs.entry.js +3 -3
  219. package/dist/cjs/calcite-stepper_2.cjs.entry.js +5 -5
  220. package/dist/cjs/calcite-switch.cjs.entry.js +7 -7
  221. package/dist/cjs/calcite-tab_4.cjs.entry.js +7 -7
  222. package/dist/cjs/calcite-tile-select_2.cjs.entry.js +4 -4
  223. package/dist/cjs/calcite-tile.cjs.entry.js +7 -7
  224. package/dist/cjs/calcite-tip_3.cjs.entry.js +10 -8
  225. package/dist/cjs/calcite-tooltip_2.cjs.entry.js +162 -133
  226. package/dist/cjs/calcite-tree_2.cjs.entry.js +6 -6
  227. package/dist/cjs/calcite-value-list_2.cjs.entry.js +11 -11
  228. package/dist/cjs/calcite.cjs.js +4 -4
  229. package/dist/cjs/{conditionalSlot-19898f15.js → conditionalSlot-df594efd.js} +3 -3
  230. package/dist/cjs/{debounce-555e4ed9.js → debounce-24461fe6.js} +1 -1
  231. package/dist/cjs/{dom-ffb42c1c.js → dom-9a2cf963.js} +2 -2
  232. package/dist/cjs/{forIn-56621a4f.js → forIn-90fffb54.js} +2 -2
  233. package/dist/cjs/{form-0df8a093.js → form-9e6d03ef.js} +3 -3
  234. package/dist/cjs/{guid-54059c72.js → guid-618238ed.js} +1 -1
  235. package/dist/cjs/{index-4713f23e.js → index-2e55547d.js} +1 -1
  236. package/dist/cjs/index.cjs.js +1 -1
  237. package/dist/cjs/{interactive-e72cf638.js → interactive-1f751ab7.js} +1 -1
  238. package/dist/cjs/{interfaces-00ba5ab7.js → interfaces-c964aaab.js} +1 -1
  239. package/dist/cjs/{label-e9a5abfd.js → label-1069d8bd.js} +10 -9
  240. package/dist/cjs/loader.cjs.js +4 -4
  241. package/dist/cjs/{locale-e8cda1ee.js → locale-8fe40b14.js} +2 -2
  242. package/dist/cjs/{math-bf4c07bb.js → math-d3124585.js} +1 -1
  243. package/dist/cjs/{number-b4ff4db6.js → number-80fc2025.js} +1 -1
  244. package/dist/cjs/{observers-0fdbbd41.js → observers-c763e03a.js} +1 -1
  245. package/dist/cjs/{popper-d8549139.js → popper-8e628970.js} +2 -2
  246. package/dist/cjs/{resources-af4d8c96.js → resources-1233bb3e.js} +5 -5
  247. package/dist/cjs/{resources-8c5beef1.js → resources-245a82b3.js} +1 -1
  248. package/dist/cjs/{resources-95373e4d.js → resources-7d180442.js} +1 -1
  249. package/dist/cjs/{resources-febfc928.js → resources-cc8ca6f0.js} +3 -3
  250. package/dist/cjs/{sortable.esm-284bc36c.js → sortable.esm-42e8dec9.js} +1 -1
  251. package/dist/cjs/{utils-ee711a3e.js → utils-0d52eee6.js} +1 -1
  252. package/dist/collection/collection-manifest.json +1 -1
  253. package/dist/collection/components/accordion/accordion.js +1 -1
  254. package/dist/collection/components/accordion/interfaces.js +1 -1
  255. package/dist/collection/components/accordion-item/accordion-item.js +1 -1
  256. package/dist/collection/components/action/action.js +1 -1
  257. package/dist/collection/components/action/resources.js +1 -1
  258. package/dist/collection/components/action-bar/action-bar.js +1 -1
  259. package/dist/collection/components/action-bar/resources.js +1 -1
  260. package/dist/collection/components/action-bar/utils.js +1 -1
  261. package/dist/collection/components/action-group/action-group.js +1 -1
  262. package/dist/collection/components/action-group/resources.js +1 -1
  263. package/dist/collection/components/action-menu/action-menu.js +3 -3
  264. package/dist/collection/components/action-menu/resources.js +1 -1
  265. package/dist/collection/components/action-pad/action-pad.js +1 -1
  266. package/dist/collection/components/action-pad/resources.js +1 -1
  267. package/dist/collection/components/alert/alert.css +2 -6
  268. package/dist/collection/components/alert/alert.js +1 -1
  269. package/dist/collection/components/alert/interfaces.js +1 -1
  270. package/dist/collection/components/alert/resources.js +1 -1
  271. package/dist/collection/components/avatar/avatar.css +1 -1
  272. package/dist/collection/components/avatar/avatar.js +1 -1
  273. package/dist/collection/components/avatar/utils.js +1 -1
  274. package/dist/collection/components/block/block.js +1 -1
  275. package/dist/collection/components/block/resources.js +1 -1
  276. package/dist/collection/components/block-section/block-section.js +1 -1
  277. package/dist/collection/components/block-section/interfaces.js +1 -1
  278. package/dist/collection/components/block-section/resources.js +1 -1
  279. package/dist/collection/components/button/button.js +1 -1
  280. package/dist/collection/components/button/interfaces.js +1 -1
  281. package/dist/collection/components/button/resources.js +1 -1
  282. package/dist/collection/components/card/card.js +1 -1
  283. package/dist/collection/components/card/resources.js +1 -1
  284. package/dist/collection/components/checkbox/checkbox.css +1 -1
  285. package/dist/collection/components/checkbox/checkbox.js +1 -1
  286. package/dist/collection/components/chip/chip.css +2 -2
  287. package/dist/collection/components/chip/chip.js +1 -1
  288. package/dist/collection/components/chip/interfaces.js +1 -1
  289. package/dist/collection/components/chip/resources.js +1 -1
  290. package/dist/collection/components/color-picker/color-picker.js +1 -1
  291. package/dist/collection/components/color-picker/interfaces.js +1 -1
  292. package/dist/collection/components/color-picker/resources.js +1 -1
  293. package/dist/collection/components/color-picker/utils.js +1 -1
  294. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +1 -1
  295. package/dist/collection/components/color-picker-hex-input/resources.js +1 -1
  296. package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +1 -1
  297. package/dist/collection/components/color-picker-swatch/resources.js +1 -1
  298. package/dist/collection/components/combobox/combobox.js +1 -1
  299. package/dist/collection/components/combobox/interfaces.js +1 -1
  300. package/dist/collection/components/combobox/resources.js +1 -1
  301. package/dist/collection/components/combobox/utils.js +1 -1
  302. package/dist/collection/components/combobox-item/combobox-item.js +1 -1
  303. package/dist/collection/components/combobox-item/resources.js +1 -1
  304. package/dist/collection/components/combobox-item-group/combobox-item-group.js +1 -1
  305. package/dist/collection/components/combobox-item-group/resources.js +1 -1
  306. package/dist/collection/components/date-picker/date-picker.js +1 -1
  307. package/dist/collection/components/date-picker/interfaces.js +1 -1
  308. package/dist/collection/components/date-picker/resources.js +1 -1
  309. package/dist/collection/components/date-picker/utils.js +1 -1
  310. package/dist/collection/components/date-picker-day/date-picker-day.css +0 -2
  311. package/dist/collection/components/date-picker-day/date-picker-day.js +1 -1
  312. package/dist/collection/components/date-picker-month/date-picker-month.js +1 -1
  313. package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +1 -1
  314. package/dist/collection/components/dropdown/dropdown.js +1 -1
  315. package/dist/collection/components/dropdown/interfaces.js +1 -1
  316. package/dist/collection/components/dropdown/resources.js +1 -1
  317. package/dist/collection/components/dropdown-group/dropdown-group.js +1 -1
  318. package/dist/collection/components/dropdown-group/interfaces.js +1 -1
  319. package/dist/collection/components/dropdown-group/resources.js +1 -1
  320. package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
  321. package/dist/collection/components/dropdown-item/resources.js +1 -1
  322. package/dist/collection/components/fab/fab.js +1 -1
  323. package/dist/collection/components/fab/resources.js +1 -1
  324. package/dist/collection/components/filter/filter.js +1 -1
  325. package/dist/collection/components/filter/resources.js +1 -1
  326. package/dist/collection/components/flow/flow.css +1 -9
  327. package/dist/collection/components/flow/flow.js +1 -1
  328. package/dist/collection/components/flow/interfaces.js +1 -1
  329. package/dist/collection/components/flow/resources.js +1 -1
  330. package/dist/collection/components/functional/ExpandToggle.js +2 -2
  331. package/dist/collection/components/functional/Heading.js +1 -1
  332. package/dist/collection/components/graph/graph.js +1 -1
  333. package/dist/collection/components/graph/interfaces.js +1 -1
  334. package/dist/collection/components/graph/util.js +1 -1
  335. package/dist/collection/components/handle/handle.js +1 -1
  336. package/dist/collection/components/handle/resources.js +1 -1
  337. package/dist/collection/components/icon/icon.js +1 -1
  338. package/dist/collection/components/icon/resources.js +1 -1
  339. package/dist/collection/components/icon/utils.js +1 -1
  340. package/dist/collection/components/inline-editable/inline-editable.js +1 -1
  341. package/dist/collection/components/inline-editable/resources.js +1 -1
  342. package/dist/collection/components/input/input.js +1 -1
  343. package/dist/collection/components/input/interfaces.js +1 -1
  344. package/dist/collection/components/input/resources.js +1 -1
  345. package/dist/collection/components/input-date-picker/input-date-picker.js +10 -1
  346. package/dist/collection/components/input-message/input-message.js +1 -1
  347. package/dist/collection/components/input-message/interfaces.js +1 -1
  348. package/dist/collection/components/input-time-picker/input-time-picker.js +1 -1
  349. package/dist/collection/components/interfaces.js +1 -1
  350. package/dist/collection/components/label/label.js +1 -1
  351. package/dist/collection/components/label/resources.js +1 -1
  352. package/dist/collection/components/link/link.js +1 -1
  353. package/dist/collection/components/list/list.js +1 -1
  354. package/dist/collection/components/list/resources.js +1 -1
  355. package/dist/collection/components/list-item/list-item.js +1 -1
  356. package/dist/collection/components/list-item/resources.js +1 -1
  357. package/dist/collection/components/list-item-group/list-item-group.js +1 -1
  358. package/dist/collection/components/list-item-group/resources.js +1 -1
  359. package/dist/collection/components/loader/loader.js +1 -1
  360. package/dist/collection/components/modal/interfaces.js +1 -1
  361. package/dist/collection/components/modal/modal.css +1 -37
  362. package/dist/collection/components/modal/modal.js +1 -1
  363. package/dist/collection/components/modal/resources.js +1 -1
  364. package/dist/collection/components/notice/notice.js +1 -1
  365. package/dist/collection/components/notice/resources.js +1 -1
  366. package/dist/collection/components/option/option.js +1 -1
  367. package/dist/collection/components/option-group/option-group.js +1 -1
  368. package/dist/collection/components/pagination/pagination.js +1 -1
  369. package/dist/collection/components/pagination/resources.js +1 -1
  370. package/dist/collection/components/panel/panel.css +1 -1
  371. package/dist/collection/components/panel/panel.js +21 -2
  372. package/dist/collection/components/panel/resources.js +1 -1
  373. package/dist/collection/components/pick-list/pick-list.js +1 -1
  374. package/dist/collection/components/pick-list/resources.js +1 -1
  375. package/dist/collection/components/pick-list/shared-list-logic.js +1 -1
  376. package/dist/collection/components/pick-list/shared-list-render.js +1 -1
  377. package/dist/collection/components/pick-list-group/pick-list-group.js +1 -1
  378. package/dist/collection/components/pick-list-group/resources.js +1 -1
  379. package/dist/collection/components/pick-list-item/pick-list-item.css +1 -1
  380. package/dist/collection/components/pick-list-item/pick-list-item.js +1 -1
  381. package/dist/collection/components/pick-list-item/resources.js +1 -1
  382. package/dist/collection/components/popover/popover.js +1 -1
  383. package/dist/collection/components/popover/resources.js +1 -1
  384. package/dist/collection/components/popover-manager/popover-manager.js +1 -1
  385. package/dist/collection/components/progress/progress.js +1 -1
  386. package/dist/collection/components/radio-button/radio-button.js +1 -1
  387. package/dist/collection/components/radio-button/resources.js +1 -1
  388. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  389. package/dist/collection/components/radio-group/interfaces.js +1 -1
  390. package/dist/collection/components/radio-group/radio-group.js +1 -1
  391. package/dist/collection/components/radio-group-item/radio-group-item.js +1 -1
  392. package/dist/collection/components/radio-group-item/resources.js +1 -1
  393. package/dist/collection/components/rating/rating.js +1 -1
  394. package/dist/collection/components/rating/resources.js +1 -1
  395. package/dist/collection/components/scrim/resources.js +1 -1
  396. package/dist/collection/components/scrim/scrim.js +1 -1
  397. package/dist/collection/components/select/resources.js +1 -1
  398. package/dist/collection/components/select/select.js +1 -1
  399. package/dist/collection/components/shell/resources.js +1 -1
  400. package/dist/collection/components/shell/shell.js +1 -1
  401. package/dist/collection/components/shell-center-row/resources.js +1 -1
  402. package/dist/collection/components/shell-center-row/shell-center-row.css +1 -1
  403. package/dist/collection/components/shell-center-row/shell-center-row.js +1 -1
  404. package/dist/collection/components/shell-panel/resources.js +1 -1
  405. package/dist/collection/components/shell-panel/shell-panel.css +1 -1
  406. package/dist/collection/components/shell-panel/shell-panel.js +5 -2
  407. package/dist/collection/components/slider/slider.js +1 -1
  408. package/dist/collection/components/sortable-list/resources.js +1 -1
  409. package/dist/collection/components/sortable-list/sortable-list.js +1 -1
  410. package/dist/collection/components/split-button/resources.js +1 -1
  411. package/dist/collection/components/split-button/split-button.js +1 -1
  412. package/dist/collection/components/stepper/stepper.js +1 -1
  413. package/dist/collection/components/stepper-item/stepper-item.js +1 -1
  414. package/dist/collection/components/switch/switch.js +1 -1
  415. package/dist/collection/components/tab/interfaces.js +1 -1
  416. package/dist/collection/components/tab/tab.js +1 -1
  417. package/dist/collection/components/tab-nav/tab-nav.js +1 -1
  418. package/dist/collection/components/tab-title/tab-title.js +1 -1
  419. package/dist/collection/components/tabs/interfaces.js +1 -1
  420. package/dist/collection/components/tabs/resources.js +1 -1
  421. package/dist/collection/components/tabs/tabs.css +1 -1
  422. package/dist/collection/components/tabs/tabs.js +1 -1
  423. package/dist/collection/components/tile/resources.js +1 -1
  424. package/dist/collection/components/tile/tile.js +1 -1
  425. package/dist/collection/components/tile-select/interfaces.js +1 -1
  426. package/dist/collection/components/tile-select/resources.js +1 -1
  427. package/dist/collection/components/tile-select/tile-select.js +1 -1
  428. package/dist/collection/components/tile-select-group/interfaces.js +1 -1
  429. package/dist/collection/components/tile-select-group/tile-select-group.js +1 -1
  430. package/dist/collection/components/time-picker/resources.js +1 -1
  431. package/dist/collection/components/time-picker/time-picker.js +1 -1
  432. package/dist/collection/components/tip/resources.js +1 -1
  433. package/dist/collection/components/tip/tip.js +1 -1
  434. package/dist/collection/components/tip-group/tip-group.js +1 -1
  435. package/dist/collection/components/tip-manager/resources.js +1 -1
  436. package/dist/collection/components/tip-manager/tip-manager.css +1 -9
  437. package/dist/collection/components/tip-manager/tip-manager.js +21 -2
  438. package/dist/collection/components/tooltip/TooltipManager.js +157 -0
  439. package/dist/collection/components/tooltip/resources.js +1 -2
  440. package/dist/collection/components/tooltip/tooltip.css +1 -1
  441. package/dist/collection/components/tooltip/tooltip.js +6 -10
  442. package/dist/collection/components/tooltip-manager/tooltip-manager.js +5 -160
  443. package/dist/collection/components/tree/interfaces.js +1 -1
  444. package/dist/collection/components/tree/tree.js +1 -1
  445. package/dist/collection/components/tree-item/interfaces.js +1 -1
  446. package/dist/collection/components/tree-item/resources.js +1 -1
  447. package/dist/collection/components/tree-item/tree-item.js +1 -1
  448. package/dist/collection/components/value-list/resources.js +1 -1
  449. package/dist/collection/components/value-list/value-list.js +1 -1
  450. package/dist/collection/components/value-list-item/resources.js +1 -1
  451. package/dist/collection/components/value-list-item/value-list-item.js +1 -1
  452. package/dist/collection/utils/array.js +1 -1
  453. package/dist/collection/utils/conditionalSlot.js +1 -1
  454. package/dist/collection/utils/date.js +1 -1
  455. package/dist/collection/utils/dom.js +1 -1
  456. package/dist/collection/utils/filter.js +1 -1
  457. package/dist/collection/utils/form.js +1 -1
  458. package/dist/collection/utils/globalAttributes.js +1 -1
  459. package/dist/collection/utils/guid.js +1 -1
  460. package/dist/collection/utils/interactive.js +1 -1
  461. package/dist/collection/utils/key.js +1 -1
  462. package/dist/collection/utils/label.js +9 -8
  463. package/dist/collection/utils/locale.js +1 -1
  464. package/dist/collection/utils/math.js +1 -1
  465. package/dist/collection/utils/number.js +1 -1
  466. package/dist/collection/utils/observers.js +1 -1
  467. package/dist/collection/utils/popper.js +1 -1
  468. package/dist/collection/utils/resources.js +1 -1
  469. package/dist/collection/utils/time.js +1 -1
  470. package/dist/components/ExpandToggle.js +2 -2
  471. package/dist/components/Heading.js +1 -1
  472. package/dist/components/action-group.js +11 -17
  473. package/dist/components/action-menu.js +11 -17
  474. package/dist/components/action.js +1 -1
  475. package/dist/components/array.js +1 -1
  476. package/dist/components/button.js +1 -1
  477. package/dist/components/calcite-accordion-item.js +1 -1
  478. package/dist/components/calcite-accordion.js +1 -1
  479. package/dist/components/calcite-action-bar.js +13 -19
  480. package/dist/components/calcite-action-group.js +1 -1
  481. package/dist/components/calcite-action-menu.js +1 -1
  482. package/dist/components/calcite-action-pad.js +13 -19
  483. package/dist/components/calcite-action.js +1 -1
  484. package/dist/components/calcite-alert.js +2 -2
  485. package/dist/components/calcite-avatar.js +2 -2
  486. package/dist/components/calcite-block-section.js +1 -1
  487. package/dist/components/calcite-block.js +15 -21
  488. package/dist/components/calcite-button.js +1 -1
  489. package/dist/components/calcite-card.js +1 -1
  490. package/dist/components/calcite-checkbox.js +1 -1
  491. package/dist/components/calcite-chip.js +1 -1
  492. package/dist/components/calcite-color-picker-hex-input.js +1 -1
  493. package/dist/components/calcite-color-picker-swatch.js +1 -1
  494. package/dist/components/calcite-color-picker.js +1 -1
  495. package/dist/components/calcite-combobox-item-group.js +1 -1
  496. package/dist/components/calcite-combobox-item.js +1 -1
  497. package/dist/components/calcite-combobox.js +1 -1
  498. package/dist/components/calcite-date-picker-day.js +1 -1
  499. package/dist/components/calcite-date-picker-month-header.js +1 -1
  500. package/dist/components/calcite-date-picker-month.js +1 -1
  501. package/dist/components/calcite-date-picker.js +1 -1
  502. package/dist/components/calcite-dropdown-group.js +1 -1
  503. package/dist/components/calcite-dropdown-item.js +1 -1
  504. package/dist/components/calcite-dropdown.js +1 -1
  505. package/dist/components/calcite-fab.js +1 -1
  506. package/dist/components/calcite-filter.js +1 -1
  507. package/dist/components/calcite-flow.js +2 -2
  508. package/dist/components/calcite-graph.js +1 -1
  509. package/dist/components/calcite-handle.js +1 -1
  510. package/dist/components/calcite-icon.js +1 -1
  511. package/dist/components/calcite-inline-editable.js +1 -1
  512. package/dist/components/calcite-input-date-picker.js +10 -1
  513. package/dist/components/calcite-input-message.js +1 -1
  514. package/dist/components/calcite-input-time-picker.js +1 -1
  515. package/dist/components/calcite-input.js +1 -1
  516. package/dist/components/calcite-label.js +1 -1
  517. package/dist/components/calcite-link.js +1 -1
  518. package/dist/components/calcite-list-item-group.js +1 -1
  519. package/dist/components/calcite-list-item.js +1 -1
  520. package/dist/components/calcite-list.js +1 -1
  521. package/dist/components/calcite-loader.js +1 -1
  522. package/dist/components/calcite-modal.js +2 -2
  523. package/dist/components/calcite-notice.js +1 -1
  524. package/dist/components/calcite-option-group.js +1 -1
  525. package/dist/components/calcite-option.js +1 -1
  526. package/dist/components/calcite-pagination.js +1 -1
  527. package/dist/components/calcite-panel.js +16 -20
  528. package/dist/components/calcite-pick-list-group.js +2 -2
  529. package/dist/components/calcite-pick-list-item.js +1 -1
  530. package/dist/components/calcite-pick-list.js +2 -2
  531. package/dist/components/calcite-popover-manager.js +1 -1
  532. package/dist/components/calcite-popover.js +1 -1
  533. package/dist/components/calcite-progress.js +1 -1
  534. package/dist/components/calcite-radio-button-group.js +1 -1
  535. package/dist/components/calcite-radio-button.js +1 -1
  536. package/dist/components/calcite-radio-group-item.js +1 -1
  537. package/dist/components/calcite-radio-group.js +1 -1
  538. package/dist/components/calcite-rating.js +1 -1
  539. package/dist/components/calcite-scrim.js +1 -1
  540. package/dist/components/calcite-select.js +1 -1
  541. package/dist/components/calcite-shell-center-row.js +2 -2
  542. package/dist/components/calcite-shell-panel.js +2 -2
  543. package/dist/components/calcite-shell.js +1 -1
  544. package/dist/components/calcite-slider.js +1 -1
  545. package/dist/components/calcite-sortable-list.js +1 -1
  546. package/dist/components/calcite-split-button.js +1 -1
  547. package/dist/components/calcite-stepper-item.js +1 -1
  548. package/dist/components/calcite-stepper.js +1 -1
  549. package/dist/components/calcite-switch.js +1 -1
  550. package/dist/components/calcite-tab-nav.js +1 -1
  551. package/dist/components/calcite-tab-title.js +1 -1
  552. package/dist/components/calcite-tab.js +1 -1
  553. package/dist/components/calcite-tabs.js +1 -1
  554. package/dist/components/calcite-tile-select-group.js +1 -1
  555. package/dist/components/calcite-tile-select.js +1 -1
  556. package/dist/components/calcite-tile.js +1 -1
  557. package/dist/components/calcite-time-picker.js +1 -1
  558. package/dist/components/calcite-tip-group.js +1 -1
  559. package/dist/components/calcite-tip-manager.js +5 -3
  560. package/dist/components/calcite-tip.js +2 -2
  561. package/dist/components/calcite-tooltip-manager.js +47 -2
  562. package/dist/components/calcite-tooltip.js +168 -15
  563. package/dist/components/calcite-tree-item.js +1 -1
  564. package/dist/components/calcite-tree.js +1 -1
  565. package/dist/components/calcite-value-list-item.js +2 -2
  566. package/dist/components/calcite-value-list.js +1 -1
  567. package/dist/components/checkbox.js +2 -2
  568. package/dist/components/chip.js +2 -2
  569. package/dist/components/color-picker-hex-input.js +1 -1
  570. package/dist/components/color-picker-swatch.js +1335 -1351
  571. package/dist/components/conditionalSlot.js +1 -1
  572. package/dist/components/date-picker-day.js +2 -2
  573. package/dist/components/date-picker-month-header.js +1 -1
  574. package/dist/components/date-picker-month.js +1 -1
  575. package/dist/components/date-picker.js +1 -1
  576. package/dist/components/date.js +1 -1
  577. package/dist/components/debounce.js +1 -1
  578. package/dist/components/dom.js +1 -1
  579. package/dist/components/dropdown.js +1 -1
  580. package/dist/components/filter.js +1 -1
  581. package/dist/components/forIn.js +1 -1
  582. package/dist/components/form.js +1 -1
  583. package/dist/components/graph.js +1 -1
  584. package/dist/components/guid.js +1 -1
  585. package/dist/components/handle.js +1 -1
  586. package/dist/components/icon.js +1 -1
  587. package/dist/components/index.js +1 -1
  588. package/dist/components/input.js +1 -1
  589. package/dist/components/interactive.js +1 -1
  590. package/dist/components/interfaces.js +1 -1
  591. package/dist/components/interfaces2.js +1 -1
  592. package/dist/components/label.js +9 -8
  593. package/dist/components/label2.js +1 -1
  594. package/dist/components/link.js +1 -1
  595. package/dist/components/loader.js +1 -1
  596. package/dist/components/locale.js +1 -1
  597. package/dist/components/math.js +1 -1
  598. package/dist/components/number.js +1 -1
  599. package/dist/components/observers.js +1 -1
  600. package/dist/components/pick-list-item.js +3 -3
  601. package/dist/components/popover.js +1 -1
  602. package/dist/components/popper.js +1 -1
  603. package/dist/components/progress.js +1 -1
  604. package/dist/components/resources.js +1 -1
  605. package/dist/components/resources2.js +12 -7
  606. package/dist/components/resources3.js +7 -10
  607. package/dist/components/resources4.js +23 -6
  608. package/dist/components/scrim.js +1 -1
  609. package/dist/components/shared-list-render.js +3 -3
  610. package/dist/components/sortable.esm.js +1 -1
  611. package/dist/components/switch.js +1 -1
  612. package/dist/components/tab-nav.js +1 -1
  613. package/dist/components/tab-title.js +1 -1
  614. package/dist/components/tab.js +1 -1
  615. package/dist/components/tabs.js +2 -2
  616. package/dist/components/tile.js +1 -1
  617. package/dist/components/time-picker.js +1 -1
  618. package/dist/components/utils.js +1 -1
  619. package/dist/components/utils2.js +1 -1
  620. package/dist/custom-elements/index.js +1474 -1447
  621. package/dist/esm/{ExpandToggle-ff36d4fc.js → ExpandToggle-2718b8f6.js} +6 -6
  622. package/dist/esm/{Heading-c533056b.js → Heading-0e4aea69.js} +2 -2
  623. package/dist/esm/{array-0f0c73df.js → array-9f67c25d.js} +1 -1
  624. package/dist/esm/calcite-accordion_2.entry.js +4 -4
  625. package/dist/esm/calcite-action-bar.entry.js +10 -10
  626. package/dist/esm/calcite-action-group.entry.js +8 -8
  627. package/dist/esm/calcite-action-menu.entry.js +10 -10
  628. package/dist/esm/calcite-action-pad.entry.js +9 -9
  629. package/dist/esm/calcite-action.entry.js +4 -4
  630. package/dist/esm/calcite-alert.entry.js +6 -6
  631. package/dist/esm/calcite-avatar.entry.js +6 -6
  632. package/dist/esm/calcite-block_2.entry.js +8 -8
  633. package/dist/esm/calcite-button.entry.js +7 -7
  634. package/dist/esm/calcite-card.entry.js +6 -6
  635. package/dist/esm/calcite-checkbox.entry.js +8 -8
  636. package/dist/esm/calcite-chip.entry.js +7 -7
  637. package/dist/esm/calcite-color-picker_3.entry.js +1293 -1309
  638. package/dist/esm/calcite-combobox_3.entry.js +12 -12
  639. package/dist/esm/calcite-date-picker_4.entry.js +10 -10
  640. package/dist/esm/calcite-dropdown_3.entry.js +7 -7
  641. package/dist/esm/calcite-fab.entry.js +5 -5
  642. package/dist/esm/calcite-filter.entry.js +7 -7
  643. package/dist/esm/calcite-flow.entry.js +4 -4
  644. package/dist/esm/calcite-graph_2.entry.js +9 -9
  645. package/dist/esm/calcite-handle.entry.js +2 -2
  646. package/dist/esm/calcite-icon.entry.js +5 -5
  647. package/dist/esm/calcite-inline-editable.entry.js +7 -7
  648. package/dist/esm/calcite-input-date-picker.entry.js +20 -11
  649. package/dist/esm/calcite-input-message.entry.js +4 -4
  650. package/dist/esm/calcite-input-time-picker_2.entry.js +8 -8
  651. package/dist/esm/calcite-input.entry.js +11 -11
  652. package/dist/esm/calcite-label.entry.js +5 -5
  653. package/dist/esm/calcite-link.entry.js +5 -5
  654. package/dist/esm/calcite-list_3.entry.js +8 -8
  655. package/dist/esm/calcite-loader.entry.js +3 -3
  656. package/dist/esm/calcite-modal.entry.js +7 -7
  657. package/dist/esm/calcite-notice.entry.js +7 -7
  658. package/dist/esm/calcite-option_3.entry.js +8 -8
  659. package/dist/esm/calcite-pagination.entry.js +2 -2
  660. package/dist/esm/calcite-panel.entry.js +12 -10
  661. package/dist/esm/calcite-pick-list_3.entry.js +12 -12
  662. package/dist/esm/calcite-popover_2.entry.js +6 -6
  663. package/dist/esm/calcite-progress.entry.js +2 -2
  664. package/dist/esm/calcite-radio-button-group.entry.js +3 -3
  665. package/dist/esm/calcite-radio-button.entry.js +8 -8
  666. package/dist/esm/calcite-radio-group_2.entry.js +7 -7
  667. package/dist/esm/calcite-rating.entry.js +7 -7
  668. package/dist/esm/calcite-scrim.entry.js +2 -2
  669. package/dist/esm/calcite-shell_3.entry.js +9 -9
  670. package/dist/esm/calcite-sortable-list.entry.js +5 -5
  671. package/dist/esm/calcite-split-button.entry.js +3 -3
  672. package/dist/esm/calcite-stepper_2.entry.js +5 -5
  673. package/dist/esm/calcite-switch.entry.js +7 -7
  674. package/dist/esm/calcite-tab_4.entry.js +7 -7
  675. package/dist/esm/calcite-tile-select_2.entry.js +4 -4
  676. package/dist/esm/calcite-tile.entry.js +7 -7
  677. package/dist/esm/calcite-tip_3.entry.js +10 -8
  678. package/dist/esm/calcite-tooltip_2.entry.js +162 -133
  679. package/dist/esm/calcite-tree_2.entry.js +6 -6
  680. package/dist/esm/calcite-value-list_2.entry.js +11 -11
  681. package/dist/esm/calcite.js +4 -4
  682. package/dist/esm/{conditionalSlot-ed38fca0.js → conditionalSlot-2522e30f.js} +3 -3
  683. package/dist/esm/{debounce-53edee6a.js → debounce-1b741867.js} +1 -1
  684. package/dist/esm/{dom-56d2cefe.js → dom-db598077.js} +2 -2
  685. package/dist/esm/{forIn-e13f90af.js → forIn-c5b795e6.js} +2 -2
  686. package/dist/esm/{form-e118b118.js → form-61a289f0.js} +3 -3
  687. package/dist/esm/{guid-11fa23a4.js → guid-9fa375f5.js} +1 -1
  688. package/dist/esm/{index-971981a8.js → index-894dfc81.js} +1 -1
  689. package/dist/esm/index.js +1 -1
  690. package/dist/esm/{interactive-3f20f596.js → interactive-09f3618d.js} +1 -1
  691. package/dist/esm/{interfaces-c3dd93ae.js → interfaces-a5204d8f.js} +1 -1
  692. package/dist/esm/{label-6596400a.js → label-6c0e1ae1.js} +10 -9
  693. package/dist/esm/loader.js +4 -4
  694. package/dist/esm/{locale-3fefdde0.js → locale-3981cfde.js} +2 -2
  695. package/dist/esm/{math-3a3d00c6.js → math-acdc37ac.js} +1 -1
  696. package/dist/esm/{number-bb529b14.js → number-84278938.js} +1 -1
  697. package/dist/esm/{observers-475be65a.js → observers-9608d2fa.js} +1 -1
  698. package/dist/esm/polyfills/css-shim.js +1 -1
  699. package/dist/esm/{popper-e39fe9b7.js → popper-7f6cf197.js} +2 -2
  700. package/dist/esm/{resources-10754ff5.js → resources-2275dd9a.js} +3 -3
  701. package/dist/esm/{resources-2b57ce37.js → resources-7941421d.js} +5 -5
  702. package/dist/esm/{resources-fa277bee.js → resources-b064c016.js} +1 -1
  703. package/dist/esm/{resources-4d608b62.js → resources-b0ef8228.js} +1 -1
  704. package/dist/esm/{sortable.esm-1e94286b.js → sortable.esm-a9eb30f8.js} +1 -1
  705. package/dist/esm/{utils-6ce13142.js → utils-442279d6.js} +1 -1
  706. package/dist/esm-es5/{ExpandToggle-ff36d4fc.js → ExpandToggle-2718b8f6.js} +2 -2
  707. package/dist/esm-es5/{Heading-c533056b.js → Heading-0e4aea69.js} +2 -2
  708. package/dist/esm-es5/{array-0f0c73df.js → array-9f67c25d.js} +1 -1
  709. package/dist/esm-es5/calcite-accordion_2.entry.js +2 -2
  710. package/dist/esm-es5/calcite-action-bar.entry.js +2 -2
  711. package/dist/esm-es5/calcite-action-group.entry.js +2 -2
  712. package/dist/esm-es5/calcite-action-menu.entry.js +2 -2
  713. package/dist/esm-es5/calcite-action-pad.entry.js +2 -2
  714. package/dist/esm-es5/calcite-action.entry.js +2 -2
  715. package/dist/esm-es5/calcite-alert.entry.js +2 -2
  716. package/dist/esm-es5/calcite-avatar.entry.js +2 -2
  717. package/dist/esm-es5/calcite-block_2.entry.js +2 -2
  718. package/dist/esm-es5/calcite-button.entry.js +2 -2
  719. package/dist/esm-es5/calcite-card.entry.js +2 -2
  720. package/dist/esm-es5/calcite-checkbox.entry.js +2 -2
  721. package/dist/esm-es5/calcite-chip.entry.js +2 -2
  722. package/dist/esm-es5/calcite-color-picker_3.entry.js +2 -2
  723. package/dist/esm-es5/calcite-combobox_3.entry.js +2 -2
  724. package/dist/esm-es5/calcite-date-picker_4.entry.js +2 -2
  725. package/dist/esm-es5/calcite-dropdown_3.entry.js +2 -2
  726. package/dist/esm-es5/calcite-fab.entry.js +2 -2
  727. package/dist/esm-es5/calcite-filter.entry.js +2 -2
  728. package/dist/esm-es5/calcite-flow.entry.js +2 -2
  729. package/dist/esm-es5/calcite-graph_2.entry.js +2 -2
  730. package/dist/esm-es5/calcite-handle.entry.js +2 -2
  731. package/dist/esm-es5/calcite-icon.entry.js +2 -2
  732. package/dist/esm-es5/calcite-inline-editable.entry.js +2 -2
  733. package/dist/esm-es5/calcite-input-date-picker.entry.js +2 -2
  734. package/dist/esm-es5/calcite-input-message.entry.js +2 -2
  735. package/dist/esm-es5/calcite-input-time-picker_2.entry.js +2 -2
  736. package/dist/esm-es5/calcite-input.entry.js +2 -2
  737. package/dist/esm-es5/calcite-label.entry.js +2 -2
  738. package/dist/esm-es5/calcite-link.entry.js +2 -2
  739. package/dist/esm-es5/calcite-list_3.entry.js +2 -2
  740. package/dist/esm-es5/calcite-loader.entry.js +2 -2
  741. package/dist/esm-es5/calcite-modal.entry.js +3 -3
  742. package/dist/esm-es5/calcite-notice.entry.js +2 -2
  743. package/dist/esm-es5/calcite-option_3.entry.js +2 -2
  744. package/dist/esm-es5/calcite-pagination.entry.js +2 -2
  745. package/dist/esm-es5/calcite-panel.entry.js +2 -2
  746. package/dist/esm-es5/calcite-pick-list_3.entry.js +2 -2
  747. package/dist/esm-es5/calcite-popover_2.entry.js +2 -2
  748. package/dist/esm-es5/calcite-progress.entry.js +2 -2
  749. package/dist/esm-es5/calcite-radio-button-group.entry.js +2 -2
  750. package/dist/esm-es5/calcite-radio-button.entry.js +2 -2
  751. package/dist/esm-es5/calcite-radio-group_2.entry.js +2 -2
  752. package/dist/esm-es5/calcite-rating.entry.js +2 -2
  753. package/dist/esm-es5/calcite-scrim.entry.js +2 -2
  754. package/dist/esm-es5/calcite-shell_3.entry.js +2 -2
  755. package/dist/esm-es5/calcite-sortable-list.entry.js +2 -2
  756. package/dist/esm-es5/calcite-split-button.entry.js +2 -2
  757. package/dist/esm-es5/calcite-stepper_2.entry.js +2 -2
  758. package/dist/esm-es5/calcite-switch.entry.js +2 -2
  759. package/dist/esm-es5/calcite-tab_4.entry.js +2 -2
  760. package/dist/esm-es5/calcite-tile-select_2.entry.js +2 -2
  761. package/dist/esm-es5/calcite-tile.entry.js +2 -2
  762. package/dist/esm-es5/calcite-tip_3.entry.js +2 -2
  763. package/dist/esm-es5/calcite-tooltip_2.entry.js +3 -3
  764. package/dist/esm-es5/calcite-tree_2.entry.js +2 -2
  765. package/dist/esm-es5/calcite-value-list_2.entry.js +2 -2
  766. package/dist/esm-es5/calcite.js +2 -2
  767. package/dist/esm-es5/{conditionalSlot-ed38fca0.js → conditionalSlot-2522e30f.js} +2 -2
  768. package/dist/esm-es5/{debounce-53edee6a.js → debounce-1b741867.js} +1 -1
  769. package/dist/esm-es5/{dom-56d2cefe.js → dom-db598077.js} +2 -2
  770. package/dist/esm-es5/{forIn-e13f90af.js → forIn-c5b795e6.js} +2 -2
  771. package/dist/esm-es5/{form-e118b118.js → form-61a289f0.js} +2 -2
  772. package/dist/esm-es5/{guid-11fa23a4.js → guid-9fa375f5.js} +1 -1
  773. package/dist/esm-es5/{index-971981a8.js → index-894dfc81.js} +1 -1
  774. package/dist/esm-es5/index.js +1 -1
  775. package/dist/esm-es5/{interactive-3f20f596.js → interactive-09f3618d.js} +1 -1
  776. package/dist/esm-es5/{interfaces-c3dd93ae.js → interfaces-a5204d8f.js} +1 -1
  777. package/dist/esm-es5/label-6c0e1ae1.js +6 -0
  778. package/dist/esm-es5/loader.js +2 -2
  779. package/dist/esm-es5/{locale-3fefdde0.js → locale-3981cfde.js} +2 -2
  780. package/dist/esm-es5/{math-3a3d00c6.js → math-acdc37ac.js} +1 -1
  781. package/dist/esm-es5/{number-bb529b14.js → number-84278938.js} +1 -1
  782. package/dist/esm-es5/{observers-475be65a.js → observers-9608d2fa.js} +1 -1
  783. package/dist/esm-es5/{popper-e39fe9b7.js → popper-7f6cf197.js} +2 -2
  784. package/dist/esm-es5/{resources-10754ff5.js → resources-2275dd9a.js} +2 -2
  785. package/dist/esm-es5/{resources-2b57ce37.js → resources-7941421d.js} +2 -2
  786. package/dist/esm-es5/{resources-fa277bee.js → resources-b064c016.js} +1 -1
  787. package/dist/esm-es5/{resources-4d608b62.js → resources-b0ef8228.js} +1 -1
  788. package/dist/esm-es5/{sortable.esm-1e94286b.js → sortable.esm-a9eb30f8.js} +1 -1
  789. package/dist/esm-es5/{utils-6ce13142.js → utils-442279d6.js} +1 -1
  790. package/dist/extras/docs-json.json +55 -71
  791. package/dist/loader/cdn.js +1 -1
  792. package/dist/loader/index.cjs.js +1 -1
  793. package/dist/loader/index.es2017.js +1 -1
  794. package/dist/loader/index.js +1 -1
  795. package/dist/types/components/panel/panel.d.ts +5 -0
  796. package/dist/types/components/shell-panel/shell-panel.d.ts +1 -0
  797. package/dist/types/components/tip-manager/tip-manager.d.ts +5 -0
  798. package/dist/types/components/tooltip/TooltipManager.d.ts +27 -0
  799. package/dist/types/components/tooltip/resources.d.ts +0 -1
  800. package/dist/types/components/tooltip/tooltip.d.ts +0 -2
  801. package/dist/types/components/tooltip-manager/tooltip-manager.d.ts +1 -29
  802. package/dist/types/components.d.ts +11 -0
  803. package/dist/types/preact.d.ts +4 -2
  804. package/hydrate/index.js +1493 -1455
  805. package/package.json +14 -16
  806. package/dist/calcite/p-3dba6477.js +0 -6
  807. package/dist/calcite/p-5b46f643.entry.js +0 -6
  808. package/dist/calcite/p-738cd7bf.js +0 -6
  809. package/dist/calcite/p-91bf6b14.entry.js +0 -6
  810. package/dist/calcite/p-a729f472.system.js +0 -6
  811. package/dist/calcite/p-c8e8cbf8.system.js +0 -6
  812. package/dist/calcite/p-d7dd9ab1.entry.js +0 -6
  813. package/dist/calcite/p-dd2d3722.js +0 -6
  814. package/dist/calcite/p-e3ba876d.entry.js +0 -6
  815. package/dist/calcite/p-e54cf4d5.system.entry.js +0 -6
  816. package/dist/calcite/p-f10a9390.entry.js +0 -6
  817. package/dist/calcite/p-f4a430e9.js +0 -6
  818. package/dist/calcite/p-f58f22f5.entry.js +0 -6
  819. package/dist/calcite/p-f78e589a.system.js +0 -6
  820. package/dist/calcite/p-fad0ea8b.js +0 -6
  821. package/dist/components/resources5.js +0 -33
  822. package/dist/components/tooltip-manager.js +0 -172
  823. package/dist/esm-es5/label-6596400a.js +0 -6
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
4
- * v1.0.0-next.442
4
+ * v1.0.0-next.445
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
7
7
  import { c as getThemeName } from './dom.js';
@@ -457,1023 +457,995 @@ function hexDouble(num) {
457
457
  }
458
458
  });
459
459
 
460
- var colorName = {
461
- "aliceblue": [240, 248, 255],
462
- "antiquewhite": [250, 235, 215],
463
- "aqua": [0, 255, 255],
464
- "aquamarine": [127, 255, 212],
465
- "azure": [240, 255, 255],
466
- "beige": [245, 245, 220],
467
- "bisque": [255, 228, 196],
468
- "black": [0, 0, 0],
469
- "blanchedalmond": [255, 235, 205],
470
- "blue": [0, 0, 255],
471
- "blueviolet": [138, 43, 226],
472
- "brown": [165, 42, 42],
473
- "burlywood": [222, 184, 135],
474
- "cadetblue": [95, 158, 160],
475
- "chartreuse": [127, 255, 0],
476
- "chocolate": [210, 105, 30],
477
- "coral": [255, 127, 80],
478
- "cornflowerblue": [100, 149, 237],
479
- "cornsilk": [255, 248, 220],
480
- "crimson": [220, 20, 60],
481
- "cyan": [0, 255, 255],
482
- "darkblue": [0, 0, 139],
483
- "darkcyan": [0, 139, 139],
484
- "darkgoldenrod": [184, 134, 11],
485
- "darkgray": [169, 169, 169],
486
- "darkgreen": [0, 100, 0],
487
- "darkgrey": [169, 169, 169],
488
- "darkkhaki": [189, 183, 107],
489
- "darkmagenta": [139, 0, 139],
490
- "darkolivegreen": [85, 107, 47],
491
- "darkorange": [255, 140, 0],
492
- "darkorchid": [153, 50, 204],
493
- "darkred": [139, 0, 0],
494
- "darksalmon": [233, 150, 122],
495
- "darkseagreen": [143, 188, 143],
496
- "darkslateblue": [72, 61, 139],
497
- "darkslategray": [47, 79, 79],
498
- "darkslategrey": [47, 79, 79],
499
- "darkturquoise": [0, 206, 209],
500
- "darkviolet": [148, 0, 211],
501
- "deeppink": [255, 20, 147],
502
- "deepskyblue": [0, 191, 255],
503
- "dimgray": [105, 105, 105],
504
- "dimgrey": [105, 105, 105],
505
- "dodgerblue": [30, 144, 255],
506
- "firebrick": [178, 34, 34],
507
- "floralwhite": [255, 250, 240],
508
- "forestgreen": [34, 139, 34],
509
- "fuchsia": [255, 0, 255],
510
- "gainsboro": [220, 220, 220],
511
- "ghostwhite": [248, 248, 255],
512
- "gold": [255, 215, 0],
513
- "goldenrod": [218, 165, 32],
514
- "gray": [128, 128, 128],
515
- "green": [0, 128, 0],
516
- "greenyellow": [173, 255, 47],
517
- "grey": [128, 128, 128],
518
- "honeydew": [240, 255, 240],
519
- "hotpink": [255, 105, 180],
520
- "indianred": [205, 92, 92],
521
- "indigo": [75, 0, 130],
522
- "ivory": [255, 255, 240],
523
- "khaki": [240, 230, 140],
524
- "lavender": [230, 230, 250],
525
- "lavenderblush": [255, 240, 245],
526
- "lawngreen": [124, 252, 0],
527
- "lemonchiffon": [255, 250, 205],
528
- "lightblue": [173, 216, 230],
529
- "lightcoral": [240, 128, 128],
530
- "lightcyan": [224, 255, 255],
531
- "lightgoldenrodyellow": [250, 250, 210],
532
- "lightgray": [211, 211, 211],
533
- "lightgreen": [144, 238, 144],
534
- "lightgrey": [211, 211, 211],
535
- "lightpink": [255, 182, 193],
536
- "lightsalmon": [255, 160, 122],
537
- "lightseagreen": [32, 178, 170],
538
- "lightskyblue": [135, 206, 250],
539
- "lightslategray": [119, 136, 153],
540
- "lightslategrey": [119, 136, 153],
541
- "lightsteelblue": [176, 196, 222],
542
- "lightyellow": [255, 255, 224],
543
- "lime": [0, 255, 0],
544
- "limegreen": [50, 205, 50],
545
- "linen": [250, 240, 230],
546
- "magenta": [255, 0, 255],
547
- "maroon": [128, 0, 0],
548
- "mediumaquamarine": [102, 205, 170],
549
- "mediumblue": [0, 0, 205],
550
- "mediumorchid": [186, 85, 211],
551
- "mediumpurple": [147, 112, 219],
552
- "mediumseagreen": [60, 179, 113],
553
- "mediumslateblue": [123, 104, 238],
554
- "mediumspringgreen": [0, 250, 154],
555
- "mediumturquoise": [72, 209, 204],
556
- "mediumvioletred": [199, 21, 133],
557
- "midnightblue": [25, 25, 112],
558
- "mintcream": [245, 255, 250],
559
- "mistyrose": [255, 228, 225],
560
- "moccasin": [255, 228, 181],
561
- "navajowhite": [255, 222, 173],
562
- "navy": [0, 0, 128],
563
- "oldlace": [253, 245, 230],
564
- "olive": [128, 128, 0],
565
- "olivedrab": [107, 142, 35],
566
- "orange": [255, 165, 0],
567
- "orangered": [255, 69, 0],
568
- "orchid": [218, 112, 214],
569
- "palegoldenrod": [238, 232, 170],
570
- "palegreen": [152, 251, 152],
571
- "paleturquoise": [175, 238, 238],
572
- "palevioletred": [219, 112, 147],
573
- "papayawhip": [255, 239, 213],
574
- "peachpuff": [255, 218, 185],
575
- "peru": [205, 133, 63],
576
- "pink": [255, 192, 203],
577
- "plum": [221, 160, 221],
578
- "powderblue": [176, 224, 230],
579
- "purple": [128, 0, 128],
580
- "rebeccapurple": [102, 51, 153],
581
- "red": [255, 0, 0],
582
- "rosybrown": [188, 143, 143],
583
- "royalblue": [65, 105, 225],
584
- "saddlebrown": [139, 69, 19],
585
- "salmon": [250, 128, 114],
586
- "sandybrown": [244, 164, 96],
587
- "seagreen": [46, 139, 87],
588
- "seashell": [255, 245, 238],
589
- "sienna": [160, 82, 45],
590
- "silver": [192, 192, 192],
591
- "skyblue": [135, 206, 235],
592
- "slateblue": [106, 90, 205],
593
- "slategray": [112, 128, 144],
594
- "slategrey": [112, 128, 144],
595
- "snow": [255, 250, 250],
596
- "springgreen": [0, 255, 127],
597
- "steelblue": [70, 130, 180],
598
- "tan": [210, 180, 140],
599
- "teal": [0, 128, 128],
600
- "thistle": [216, 191, 216],
601
- "tomato": [255, 99, 71],
602
- "turquoise": [64, 224, 208],
603
- "violet": [238, 130, 238],
604
- "wheat": [245, 222, 179],
605
- "white": [255, 255, 255],
606
- "whitesmoke": [245, 245, 245],
607
- "yellow": [255, 255, 0],
608
- "yellowgreen": [154, 205, 50]
460
+ var colorName = {
461
+ "aliceblue": [240, 248, 255],
462
+ "antiquewhite": [250, 235, 215],
463
+ "aqua": [0, 255, 255],
464
+ "aquamarine": [127, 255, 212],
465
+ "azure": [240, 255, 255],
466
+ "beige": [245, 245, 220],
467
+ "bisque": [255, 228, 196],
468
+ "black": [0, 0, 0],
469
+ "blanchedalmond": [255, 235, 205],
470
+ "blue": [0, 0, 255],
471
+ "blueviolet": [138, 43, 226],
472
+ "brown": [165, 42, 42],
473
+ "burlywood": [222, 184, 135],
474
+ "cadetblue": [95, 158, 160],
475
+ "chartreuse": [127, 255, 0],
476
+ "chocolate": [210, 105, 30],
477
+ "coral": [255, 127, 80],
478
+ "cornflowerblue": [100, 149, 237],
479
+ "cornsilk": [255, 248, 220],
480
+ "crimson": [220, 20, 60],
481
+ "cyan": [0, 255, 255],
482
+ "darkblue": [0, 0, 139],
483
+ "darkcyan": [0, 139, 139],
484
+ "darkgoldenrod": [184, 134, 11],
485
+ "darkgray": [169, 169, 169],
486
+ "darkgreen": [0, 100, 0],
487
+ "darkgrey": [169, 169, 169],
488
+ "darkkhaki": [189, 183, 107],
489
+ "darkmagenta": [139, 0, 139],
490
+ "darkolivegreen": [85, 107, 47],
491
+ "darkorange": [255, 140, 0],
492
+ "darkorchid": [153, 50, 204],
493
+ "darkred": [139, 0, 0],
494
+ "darksalmon": [233, 150, 122],
495
+ "darkseagreen": [143, 188, 143],
496
+ "darkslateblue": [72, 61, 139],
497
+ "darkslategray": [47, 79, 79],
498
+ "darkslategrey": [47, 79, 79],
499
+ "darkturquoise": [0, 206, 209],
500
+ "darkviolet": [148, 0, 211],
501
+ "deeppink": [255, 20, 147],
502
+ "deepskyblue": [0, 191, 255],
503
+ "dimgray": [105, 105, 105],
504
+ "dimgrey": [105, 105, 105],
505
+ "dodgerblue": [30, 144, 255],
506
+ "firebrick": [178, 34, 34],
507
+ "floralwhite": [255, 250, 240],
508
+ "forestgreen": [34, 139, 34],
509
+ "fuchsia": [255, 0, 255],
510
+ "gainsboro": [220, 220, 220],
511
+ "ghostwhite": [248, 248, 255],
512
+ "gold": [255, 215, 0],
513
+ "goldenrod": [218, 165, 32],
514
+ "gray": [128, 128, 128],
515
+ "green": [0, 128, 0],
516
+ "greenyellow": [173, 255, 47],
517
+ "grey": [128, 128, 128],
518
+ "honeydew": [240, 255, 240],
519
+ "hotpink": [255, 105, 180],
520
+ "indianred": [205, 92, 92],
521
+ "indigo": [75, 0, 130],
522
+ "ivory": [255, 255, 240],
523
+ "khaki": [240, 230, 140],
524
+ "lavender": [230, 230, 250],
525
+ "lavenderblush": [255, 240, 245],
526
+ "lawngreen": [124, 252, 0],
527
+ "lemonchiffon": [255, 250, 205],
528
+ "lightblue": [173, 216, 230],
529
+ "lightcoral": [240, 128, 128],
530
+ "lightcyan": [224, 255, 255],
531
+ "lightgoldenrodyellow": [250, 250, 210],
532
+ "lightgray": [211, 211, 211],
533
+ "lightgreen": [144, 238, 144],
534
+ "lightgrey": [211, 211, 211],
535
+ "lightpink": [255, 182, 193],
536
+ "lightsalmon": [255, 160, 122],
537
+ "lightseagreen": [32, 178, 170],
538
+ "lightskyblue": [135, 206, 250],
539
+ "lightslategray": [119, 136, 153],
540
+ "lightslategrey": [119, 136, 153],
541
+ "lightsteelblue": [176, 196, 222],
542
+ "lightyellow": [255, 255, 224],
543
+ "lime": [0, 255, 0],
544
+ "limegreen": [50, 205, 50],
545
+ "linen": [250, 240, 230],
546
+ "magenta": [255, 0, 255],
547
+ "maroon": [128, 0, 0],
548
+ "mediumaquamarine": [102, 205, 170],
549
+ "mediumblue": [0, 0, 205],
550
+ "mediumorchid": [186, 85, 211],
551
+ "mediumpurple": [147, 112, 219],
552
+ "mediumseagreen": [60, 179, 113],
553
+ "mediumslateblue": [123, 104, 238],
554
+ "mediumspringgreen": [0, 250, 154],
555
+ "mediumturquoise": [72, 209, 204],
556
+ "mediumvioletred": [199, 21, 133],
557
+ "midnightblue": [25, 25, 112],
558
+ "mintcream": [245, 255, 250],
559
+ "mistyrose": [255, 228, 225],
560
+ "moccasin": [255, 228, 181],
561
+ "navajowhite": [255, 222, 173],
562
+ "navy": [0, 0, 128],
563
+ "oldlace": [253, 245, 230],
564
+ "olive": [128, 128, 0],
565
+ "olivedrab": [107, 142, 35],
566
+ "orange": [255, 165, 0],
567
+ "orangered": [255, 69, 0],
568
+ "orchid": [218, 112, 214],
569
+ "palegoldenrod": [238, 232, 170],
570
+ "palegreen": [152, 251, 152],
571
+ "paleturquoise": [175, 238, 238],
572
+ "palevioletred": [219, 112, 147],
573
+ "papayawhip": [255, 239, 213],
574
+ "peachpuff": [255, 218, 185],
575
+ "peru": [205, 133, 63],
576
+ "pink": [255, 192, 203],
577
+ "plum": [221, 160, 221],
578
+ "powderblue": [176, 224, 230],
579
+ "purple": [128, 0, 128],
580
+ "rebeccapurple": [102, 51, 153],
581
+ "red": [255, 0, 0],
582
+ "rosybrown": [188, 143, 143],
583
+ "royalblue": [65, 105, 225],
584
+ "saddlebrown": [139, 69, 19],
585
+ "salmon": [250, 128, 114],
586
+ "sandybrown": [244, 164, 96],
587
+ "seagreen": [46, 139, 87],
588
+ "seashell": [255, 245, 238],
589
+ "sienna": [160, 82, 45],
590
+ "silver": [192, 192, 192],
591
+ "skyblue": [135, 206, 235],
592
+ "slateblue": [106, 90, 205],
593
+ "slategray": [112, 128, 144],
594
+ "slategrey": [112, 128, 144],
595
+ "snow": [255, 250, 250],
596
+ "springgreen": [0, 255, 127],
597
+ "steelblue": [70, 130, 180],
598
+ "tan": [210, 180, 140],
599
+ "teal": [0, 128, 128],
600
+ "thistle": [216, 191, 216],
601
+ "tomato": [255, 99, 71],
602
+ "turquoise": [64, 224, 208],
603
+ "violet": [238, 130, 238],
604
+ "wheat": [245, 222, 179],
605
+ "white": [255, 255, 255],
606
+ "whitesmoke": [245, 245, 245],
607
+ "yellow": [255, 255, 0],
608
+ "yellowgreen": [154, 205, 50]
609
609
  };
610
610
 
611
611
  /* MIT license */
612
-
613
612
  /* eslint-disable no-mixed-operators */
613
+
614
+
614
615
  // NOTE: conversions should only return primitive values (i.e. arrays, or
615
616
  // values that give correct `typeof` results).
616
617
  // do not use box values types (i.e. Number(), String(), etc.)
617
618
 
618
619
  const reverseKeywords = {};
619
-
620
620
  for (const key of Object.keys(colorName)) {
621
- reverseKeywords[colorName[key]] = key;
621
+ reverseKeywords[colorName[key]] = key;
622
622
  }
623
623
 
624
624
  const convert$1 = {
625
- rgb: {
626
- channels: 3,
627
- labels: 'rgb'
628
- },
629
- hsl: {
630
- channels: 3,
631
- labels: 'hsl'
632
- },
633
- hsv: {
634
- channels: 3,
635
- labels: 'hsv'
636
- },
637
- hwb: {
638
- channels: 3,
639
- labels: 'hwb'
640
- },
641
- cmyk: {
642
- channels: 4,
643
- labels: 'cmyk'
644
- },
645
- xyz: {
646
- channels: 3,
647
- labels: 'xyz'
648
- },
649
- lab: {
650
- channels: 3,
651
- labels: 'lab'
652
- },
653
- lch: {
654
- channels: 3,
655
- labels: 'lch'
656
- },
657
- hex: {
658
- channels: 1,
659
- labels: ['hex']
660
- },
661
- keyword: {
662
- channels: 1,
663
- labels: ['keyword']
664
- },
665
- ansi16: {
666
- channels: 1,
667
- labels: ['ansi16']
668
- },
669
- ansi256: {
670
- channels: 1,
671
- labels: ['ansi256']
672
- },
673
- hcg: {
674
- channels: 3,
675
- labels: ['h', 'c', 'g']
676
- },
677
- apple: {
678
- channels: 3,
679
- labels: ['r16', 'g16', 'b16']
680
- },
681
- gray: {
682
- channels: 1,
683
- labels: ['gray']
684
- }
625
+ rgb: {channels: 3, labels: 'rgb'},
626
+ hsl: {channels: 3, labels: 'hsl'},
627
+ hsv: {channels: 3, labels: 'hsv'},
628
+ hwb: {channels: 3, labels: 'hwb'},
629
+ cmyk: {channels: 4, labels: 'cmyk'},
630
+ xyz: {channels: 3, labels: 'xyz'},
631
+ lab: {channels: 3, labels: 'lab'},
632
+ lch: {channels: 3, labels: 'lch'},
633
+ hex: {channels: 1, labels: ['hex']},
634
+ keyword: {channels: 1, labels: ['keyword']},
635
+ ansi16: {channels: 1, labels: ['ansi16']},
636
+ ansi256: {channels: 1, labels: ['ansi256']},
637
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
638
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
639
+ gray: {channels: 1, labels: ['gray']}
685
640
  };
686
- var conversions = convert$1; // Hide .channels and .labels properties
687
641
 
642
+ var conversions = convert$1;
643
+
644
+ // Hide .channels and .labels properties
688
645
  for (const model of Object.keys(convert$1)) {
689
- if (!('channels' in convert$1[model])) {
690
- throw new Error('missing channels property: ' + model);
691
- }
646
+ if (!('channels' in convert$1[model])) {
647
+ throw new Error('missing channels property: ' + model);
648
+ }
692
649
 
693
- if (!('labels' in convert$1[model])) {
694
- throw new Error('missing channel labels property: ' + model);
695
- }
650
+ if (!('labels' in convert$1[model])) {
651
+ throw new Error('missing channel labels property: ' + model);
652
+ }
696
653
 
697
- if (convert$1[model].labels.length !== convert$1[model].channels) {
698
- throw new Error('channel and label counts mismatch: ' + model);
699
- }
654
+ if (convert$1[model].labels.length !== convert$1[model].channels) {
655
+ throw new Error('channel and label counts mismatch: ' + model);
656
+ }
700
657
 
701
- const {
702
- channels,
703
- labels
704
- } = convert$1[model];
705
- delete convert$1[model].channels;
706
- delete convert$1[model].labels;
707
- Object.defineProperty(convert$1[model], 'channels', {
708
- value: channels
709
- });
710
- Object.defineProperty(convert$1[model], 'labels', {
711
- value: labels
712
- });
658
+ const {channels, labels} = convert$1[model];
659
+ delete convert$1[model].channels;
660
+ delete convert$1[model].labels;
661
+ Object.defineProperty(convert$1[model], 'channels', {value: channels});
662
+ Object.defineProperty(convert$1[model], 'labels', {value: labels});
713
663
  }
714
664
 
715
665
  convert$1.rgb.hsl = function (rgb) {
716
- const r = rgb[0] / 255;
717
- const g = rgb[1] / 255;
718
- const b = rgb[2] / 255;
719
- const min = Math.min(r, g, b);
720
- const max = Math.max(r, g, b);
721
- const delta = max - min;
722
- let h;
723
- let s;
724
-
725
- if (max === min) {
726
- h = 0;
727
- } else if (r === max) {
728
- h = (g - b) / delta;
729
- } else if (g === max) {
730
- h = 2 + (b - r) / delta;
731
- } else if (b === max) {
732
- h = 4 + (r - g) / delta;
733
- }
666
+ const r = rgb[0] / 255;
667
+ const g = rgb[1] / 255;
668
+ const b = rgb[2] / 255;
669
+ const min = Math.min(r, g, b);
670
+ const max = Math.max(r, g, b);
671
+ const delta = max - min;
672
+ let h;
673
+ let s;
674
+
675
+ if (max === min) {
676
+ h = 0;
677
+ } else if (r === max) {
678
+ h = (g - b) / delta;
679
+ } else if (g === max) {
680
+ h = 2 + (b - r) / delta;
681
+ } else if (b === max) {
682
+ h = 4 + (r - g) / delta;
683
+ }
734
684
 
735
- h = Math.min(h * 60, 360);
685
+ h = Math.min(h * 60, 360);
736
686
 
737
- if (h < 0) {
738
- h += 360;
739
- }
687
+ if (h < 0) {
688
+ h += 360;
689
+ }
740
690
 
741
- const l = (min + max) / 2;
691
+ const l = (min + max) / 2;
742
692
 
743
- if (max === min) {
744
- s = 0;
745
- } else if (l <= 0.5) {
746
- s = delta / (max + min);
747
- } else {
748
- s = delta / (2 - max - min);
749
- }
693
+ if (max === min) {
694
+ s = 0;
695
+ } else if (l <= 0.5) {
696
+ s = delta / (max + min);
697
+ } else {
698
+ s = delta / (2 - max - min);
699
+ }
750
700
 
751
- return [h, s * 100, l * 100];
701
+ return [h, s * 100, l * 100];
752
702
  };
753
703
 
754
704
  convert$1.rgb.hsv = function (rgb) {
755
- let rdif;
756
- let gdif;
757
- let bdif;
758
- let h;
759
- let s;
760
- const r = rgb[0] / 255;
761
- const g = rgb[1] / 255;
762
- const b = rgb[2] / 255;
763
- const v = Math.max(r, g, b);
764
- const diff = v - Math.min(r, g, b);
765
-
766
- const diffc = function (c) {
767
- return (v - c) / 6 / diff + 1 / 2;
768
- };
769
-
770
- if (diff === 0) {
771
- h = 0;
772
- s = 0;
773
- } else {
774
- s = diff / v;
775
- rdif = diffc(r);
776
- gdif = diffc(g);
777
- bdif = diffc(b);
778
-
779
- if (r === v) {
780
- h = bdif - gdif;
781
- } else if (g === v) {
782
- h = 1 / 3 + rdif - bdif;
783
- } else if (b === v) {
784
- h = 2 / 3 + gdif - rdif;
785
- }
786
-
787
- if (h < 0) {
788
- h += 1;
789
- } else if (h > 1) {
790
- h -= 1;
791
- }
792
- }
705
+ let rdif;
706
+ let gdif;
707
+ let bdif;
708
+ let h;
709
+ let s;
710
+
711
+ const r = rgb[0] / 255;
712
+ const g = rgb[1] / 255;
713
+ const b = rgb[2] / 255;
714
+ const v = Math.max(r, g, b);
715
+ const diff = v - Math.min(r, g, b);
716
+ const diffc = function (c) {
717
+ return (v - c) / 6 / diff + 1 / 2;
718
+ };
793
719
 
794
- return [h * 360, s * 100, v * 100];
720
+ if (diff === 0) {
721
+ h = 0;
722
+ s = 0;
723
+ } else {
724
+ s = diff / v;
725
+ rdif = diffc(r);
726
+ gdif = diffc(g);
727
+ bdif = diffc(b);
728
+
729
+ if (r === v) {
730
+ h = bdif - gdif;
731
+ } else if (g === v) {
732
+ h = (1 / 3) + rdif - bdif;
733
+ } else if (b === v) {
734
+ h = (2 / 3) + gdif - rdif;
735
+ }
736
+
737
+ if (h < 0) {
738
+ h += 1;
739
+ } else if (h > 1) {
740
+ h -= 1;
741
+ }
742
+ }
743
+
744
+ return [
745
+ h * 360,
746
+ s * 100,
747
+ v * 100
748
+ ];
795
749
  };
796
750
 
797
751
  convert$1.rgb.hwb = function (rgb) {
798
- const r = rgb[0];
799
- const g = rgb[1];
800
- let b = rgb[2];
801
- const h = convert$1.rgb.hsl(rgb)[0];
802
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
803
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
804
- return [h, w * 100, b * 100];
752
+ const r = rgb[0];
753
+ const g = rgb[1];
754
+ let b = rgb[2];
755
+ const h = convert$1.rgb.hsl(rgb)[0];
756
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
757
+
758
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
759
+
760
+ return [h, w * 100, b * 100];
805
761
  };
806
762
 
807
763
  convert$1.rgb.cmyk = function (rgb) {
808
- const r = rgb[0] / 255;
809
- const g = rgb[1] / 255;
810
- const b = rgb[2] / 255;
811
- const k = Math.min(1 - r, 1 - g, 1 - b);
812
- const c = (1 - r - k) / (1 - k) || 0;
813
- const m = (1 - g - k) / (1 - k) || 0;
814
- const y = (1 - b - k) / (1 - k) || 0;
815
- return [c * 100, m * 100, y * 100, k * 100];
764
+ const r = rgb[0] / 255;
765
+ const g = rgb[1] / 255;
766
+ const b = rgb[2] / 255;
767
+
768
+ const k = Math.min(1 - r, 1 - g, 1 - b);
769
+ const c = (1 - r - k) / (1 - k) || 0;
770
+ const m = (1 - g - k) / (1 - k) || 0;
771
+ const y = (1 - b - k) / (1 - k) || 0;
772
+
773
+ return [c * 100, m * 100, y * 100, k * 100];
816
774
  };
817
775
 
818
776
  function comparativeDistance(x, y) {
819
- /*
820
- See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
821
- */
822
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
777
+ /*
778
+ See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
779
+ */
780
+ return (
781
+ ((x[0] - y[0]) ** 2) +
782
+ ((x[1] - y[1]) ** 2) +
783
+ ((x[2] - y[2]) ** 2)
784
+ );
823
785
  }
824
786
 
825
787
  convert$1.rgb.keyword = function (rgb) {
826
- const reversed = reverseKeywords[rgb];
827
-
828
- if (reversed) {
829
- return reversed;
830
- }
788
+ const reversed = reverseKeywords[rgb];
789
+ if (reversed) {
790
+ return reversed;
791
+ }
831
792
 
832
- let currentClosestDistance = Infinity;
833
- let currentClosestKeyword;
793
+ let currentClosestDistance = Infinity;
794
+ let currentClosestKeyword;
834
795
 
835
- for (const keyword of Object.keys(colorName)) {
836
- const value = colorName[keyword]; // Compute comparative distance
796
+ for (const keyword of Object.keys(colorName)) {
797
+ const value = colorName[keyword];
837
798
 
838
- const distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest
799
+ // Compute comparative distance
800
+ const distance = comparativeDistance(rgb, value);
839
801
 
840
- if (distance < currentClosestDistance) {
841
- currentClosestDistance = distance;
842
- currentClosestKeyword = keyword;
843
- }
844
- }
802
+ // Check if its less, if so set as closest
803
+ if (distance < currentClosestDistance) {
804
+ currentClosestDistance = distance;
805
+ currentClosestKeyword = keyword;
806
+ }
807
+ }
845
808
 
846
- return currentClosestKeyword;
809
+ return currentClosestKeyword;
847
810
  };
848
811
 
849
812
  convert$1.keyword.rgb = function (keyword) {
850
- return colorName[keyword];
813
+ return colorName[keyword];
851
814
  };
852
815
 
853
816
  convert$1.rgb.xyz = function (rgb) {
854
- let r = rgb[0] / 255;
855
- let g = rgb[1] / 255;
856
- let b = rgb[2] / 255; // Assume sRGB
817
+ let r = rgb[0] / 255;
818
+ let g = rgb[1] / 255;
819
+ let b = rgb[2] / 255;
820
+
821
+ // Assume sRGB
822
+ r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
823
+ g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
824
+ b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
825
+
826
+ const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
827
+ const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
828
+ const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
857
829
 
858
- r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
859
- g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
860
- b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
861
- const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
862
- const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
863
- const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
864
- return [x * 100, y * 100, z * 100];
830
+ return [x * 100, y * 100, z * 100];
865
831
  };
866
832
 
867
833
  convert$1.rgb.lab = function (rgb) {
868
- const xyz = convert$1.rgb.xyz(rgb);
869
- let x = xyz[0];
870
- let y = xyz[1];
871
- let z = xyz[2];
872
- x /= 95.047;
873
- y /= 100;
874
- z /= 108.883;
875
- x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
876
- y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
877
- z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
878
- const l = 116 * y - 16;
879
- const a = 500 * (x - y);
880
- const b = 200 * (y - z);
881
- return [l, a, b];
834
+ const xyz = convert$1.rgb.xyz(rgb);
835
+ let x = xyz[0];
836
+ let y = xyz[1];
837
+ let z = xyz[2];
838
+
839
+ x /= 95.047;
840
+ y /= 100;
841
+ z /= 108.883;
842
+
843
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
844
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
845
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
846
+
847
+ const l = (116 * y) - 16;
848
+ const a = 500 * (x - y);
849
+ const b = 200 * (y - z);
850
+
851
+ return [l, a, b];
882
852
  };
883
853
 
884
854
  convert$1.hsl.rgb = function (hsl) {
885
- const h = hsl[0] / 360;
886
- const s = hsl[1] / 100;
887
- const l = hsl[2] / 100;
888
- let t2;
889
- let t3;
890
- let val;
891
-
892
- if (s === 0) {
893
- val = l * 255;
894
- return [val, val, val];
895
- }
896
-
897
- if (l < 0.5) {
898
- t2 = l * (1 + s);
899
- } else {
900
- t2 = l + s - l * s;
901
- }
855
+ const h = hsl[0] / 360;
856
+ const s = hsl[1] / 100;
857
+ const l = hsl[2] / 100;
858
+ let t2;
859
+ let t3;
860
+ let val;
861
+
862
+ if (s === 0) {
863
+ val = l * 255;
864
+ return [val, val, val];
865
+ }
902
866
 
903
- const t1 = 2 * l - t2;
904
- const rgb = [0, 0, 0];
867
+ if (l < 0.5) {
868
+ t2 = l * (1 + s);
869
+ } else {
870
+ t2 = l + s - l * s;
871
+ }
905
872
 
906
- for (let i = 0; i < 3; i++) {
907
- t3 = h + 1 / 3 * -(i - 1);
873
+ const t1 = 2 * l - t2;
908
874
 
909
- if (t3 < 0) {
910
- t3++;
911
- }
875
+ const rgb = [0, 0, 0];
876
+ for (let i = 0; i < 3; i++) {
877
+ t3 = h + 1 / 3 * -(i - 1);
878
+ if (t3 < 0) {
879
+ t3++;
880
+ }
912
881
 
913
- if (t3 > 1) {
914
- t3--;
915
- }
882
+ if (t3 > 1) {
883
+ t3--;
884
+ }
916
885
 
917
- if (6 * t3 < 1) {
918
- val = t1 + (t2 - t1) * 6 * t3;
919
- } else if (2 * t3 < 1) {
920
- val = t2;
921
- } else if (3 * t3 < 2) {
922
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
923
- } else {
924
- val = t1;
925
- }
886
+ if (6 * t3 < 1) {
887
+ val = t1 + (t2 - t1) * 6 * t3;
888
+ } else if (2 * t3 < 1) {
889
+ val = t2;
890
+ } else if (3 * t3 < 2) {
891
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
892
+ } else {
893
+ val = t1;
894
+ }
926
895
 
927
- rgb[i] = val * 255;
928
- }
896
+ rgb[i] = val * 255;
897
+ }
929
898
 
930
- return rgb;
899
+ return rgb;
931
900
  };
932
901
 
933
902
  convert$1.hsl.hsv = function (hsl) {
934
- const h = hsl[0];
935
- let s = hsl[1] / 100;
936
- let l = hsl[2] / 100;
937
- let smin = s;
938
- const lmin = Math.max(l, 0.01);
939
- l *= 2;
940
- s *= l <= 1 ? l : 2 - l;
941
- smin *= lmin <= 1 ? lmin : 2 - lmin;
942
- const v = (l + s) / 2;
943
- const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
944
- return [h, sv * 100, v * 100];
903
+ const h = hsl[0];
904
+ let s = hsl[1] / 100;
905
+ let l = hsl[2] / 100;
906
+ let smin = s;
907
+ const lmin = Math.max(l, 0.01);
908
+
909
+ l *= 2;
910
+ s *= (l <= 1) ? l : 2 - l;
911
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
912
+ const v = (l + s) / 2;
913
+ const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
914
+
915
+ return [h, sv * 100, v * 100];
945
916
  };
946
917
 
947
918
  convert$1.hsv.rgb = function (hsv) {
948
- const h = hsv[0] / 60;
949
- const s = hsv[1] / 100;
950
- let v = hsv[2] / 100;
951
- const hi = Math.floor(h) % 6;
952
- const f = h - Math.floor(h);
953
- const p = 255 * v * (1 - s);
954
- const q = 255 * v * (1 - s * f);
955
- const t = 255 * v * (1 - s * (1 - f));
956
- v *= 255;
957
-
958
- switch (hi) {
959
- case 0:
960
- return [v, t, p];
961
-
962
- case 1:
963
- return [q, v, p];
964
-
965
- case 2:
966
- return [p, v, t];
967
-
968
- case 3:
969
- return [p, q, v];
970
-
971
- case 4:
972
- return [t, p, v];
973
-
974
- case 5:
975
- return [v, p, q];
976
- }
919
+ const h = hsv[0] / 60;
920
+ const s = hsv[1] / 100;
921
+ let v = hsv[2] / 100;
922
+ const hi = Math.floor(h) % 6;
923
+
924
+ const f = h - Math.floor(h);
925
+ const p = 255 * v * (1 - s);
926
+ const q = 255 * v * (1 - (s * f));
927
+ const t = 255 * v * (1 - (s * (1 - f)));
928
+ v *= 255;
929
+
930
+ switch (hi) {
931
+ case 0:
932
+ return [v, t, p];
933
+ case 1:
934
+ return [q, v, p];
935
+ case 2:
936
+ return [p, v, t];
937
+ case 3:
938
+ return [p, q, v];
939
+ case 4:
940
+ return [t, p, v];
941
+ case 5:
942
+ return [v, p, q];
943
+ }
977
944
  };
978
945
 
979
946
  convert$1.hsv.hsl = function (hsv) {
980
- const h = hsv[0];
981
- const s = hsv[1] / 100;
982
- const v = hsv[2] / 100;
983
- const vmin = Math.max(v, 0.01);
984
- let sl;
985
- let l;
986
- l = (2 - s) * v;
987
- const lmin = (2 - s) * vmin;
988
- sl = s * vmin;
989
- sl /= lmin <= 1 ? lmin : 2 - lmin;
990
- sl = sl || 0;
991
- l /= 2;
992
- return [h, sl * 100, l * 100];
993
- }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
994
-
947
+ const h = hsv[0];
948
+ const s = hsv[1] / 100;
949
+ const v = hsv[2] / 100;
950
+ const vmin = Math.max(v, 0.01);
951
+ let sl;
952
+ let l;
953
+
954
+ l = (2 - s) * v;
955
+ const lmin = (2 - s) * vmin;
956
+ sl = s * vmin;
957
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
958
+ sl = sl || 0;
959
+ l /= 2;
960
+
961
+ return [h, sl * 100, l * 100];
962
+ };
995
963
 
964
+ // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
996
965
  convert$1.hwb.rgb = function (hwb) {
997
- const h = hwb[0] / 360;
998
- let wh = hwb[1] / 100;
999
- let bl = hwb[2] / 100;
1000
- const ratio = wh + bl;
1001
- let f; // Wh + bl cant be > 1
1002
-
1003
- if (ratio > 1) {
1004
- wh /= ratio;
1005
- bl /= ratio;
1006
- }
1007
-
1008
- const i = Math.floor(6 * h);
1009
- const v = 1 - bl;
1010
- f = 6 * h - i;
1011
-
1012
- if ((i & 0x01) !== 0) {
1013
- f = 1 - f;
1014
- }
1015
-
1016
- const n = wh + f * (v - wh); // Linear interpolation
1017
-
1018
- let r;
1019
- let g;
1020
- let b;
1021
- /* eslint-disable max-statements-per-line,no-multi-spaces */
1022
-
1023
- switch (i) {
1024
- default:
1025
- case 6:
1026
- case 0:
1027
- r = v;
1028
- g = n;
1029
- b = wh;
1030
- break;
1031
-
1032
- case 1:
1033
- r = n;
1034
- g = v;
1035
- b = wh;
1036
- break;
1037
-
1038
- case 2:
1039
- r = wh;
1040
- g = v;
1041
- b = n;
1042
- break;
966
+ const h = hwb[0] / 360;
967
+ let wh = hwb[1] / 100;
968
+ let bl = hwb[2] / 100;
969
+ const ratio = wh + bl;
970
+ let f;
971
+
972
+ // Wh + bl cant be > 1
973
+ if (ratio > 1) {
974
+ wh /= ratio;
975
+ bl /= ratio;
976
+ }
1043
977
 
1044
- case 3:
1045
- r = wh;
1046
- g = n;
1047
- b = v;
1048
- break;
978
+ const i = Math.floor(6 * h);
979
+ const v = 1 - bl;
980
+ f = 6 * h - i;
1049
981
 
1050
- case 4:
1051
- r = n;
1052
- g = wh;
1053
- b = v;
1054
- break;
982
+ if ((i & 0x01) !== 0) {
983
+ f = 1 - f;
984
+ }
1055
985
 
1056
- case 5:
1057
- r = v;
1058
- g = wh;
1059
- b = n;
1060
- break;
1061
- }
1062
- /* eslint-enable max-statements-per-line,no-multi-spaces */
986
+ const n = wh + f * (v - wh); // Linear interpolation
1063
987
 
988
+ let r;
989
+ let g;
990
+ let b;
991
+ /* eslint-disable max-statements-per-line,no-multi-spaces */
992
+ switch (i) {
993
+ default:
994
+ case 6:
995
+ case 0: r = v; g = n; b = wh; break;
996
+ case 1: r = n; g = v; b = wh; break;
997
+ case 2: r = wh; g = v; b = n; break;
998
+ case 3: r = wh; g = n; b = v; break;
999
+ case 4: r = n; g = wh; b = v; break;
1000
+ case 5: r = v; g = wh; b = n; break;
1001
+ }
1002
+ /* eslint-enable max-statements-per-line,no-multi-spaces */
1064
1003
 
1065
- return [r * 255, g * 255, b * 255];
1004
+ return [r * 255, g * 255, b * 255];
1066
1005
  };
1067
1006
 
1068
1007
  convert$1.cmyk.rgb = function (cmyk) {
1069
- const c = cmyk[0] / 100;
1070
- const m = cmyk[1] / 100;
1071
- const y = cmyk[2] / 100;
1072
- const k = cmyk[3] / 100;
1073
- const r = 1 - Math.min(1, c * (1 - k) + k);
1074
- const g = 1 - Math.min(1, m * (1 - k) + k);
1075
- const b = 1 - Math.min(1, y * (1 - k) + k);
1076
- return [r * 255, g * 255, b * 255];
1008
+ const c = cmyk[0] / 100;
1009
+ const m = cmyk[1] / 100;
1010
+ const y = cmyk[2] / 100;
1011
+ const k = cmyk[3] / 100;
1012
+
1013
+ const r = 1 - Math.min(1, c * (1 - k) + k);
1014
+ const g = 1 - Math.min(1, m * (1 - k) + k);
1015
+ const b = 1 - Math.min(1, y * (1 - k) + k);
1016
+
1017
+ return [r * 255, g * 255, b * 255];
1077
1018
  };
1078
1019
 
1079
1020
  convert$1.xyz.rgb = function (xyz) {
1080
- const x = xyz[0] / 100;
1081
- const y = xyz[1] / 100;
1082
- const z = xyz[2] / 100;
1083
- let r;
1084
- let g;
1085
- let b;
1086
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
1087
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
1088
- b = x * 0.0557 + y * -0.2040 + z * 1.0570; // Assume sRGB
1089
-
1090
- r = r > 0.0031308 ? 1.055 * r ** (1.0 / 2.4) - 0.055 : r * 12.92;
1091
- g = g > 0.0031308 ? 1.055 * g ** (1.0 / 2.4) - 0.055 : g * 12.92;
1092
- b = b > 0.0031308 ? 1.055 * b ** (1.0 / 2.4) - 0.055 : b * 12.92;
1093
- r = Math.min(Math.max(0, r), 1);
1094
- g = Math.min(Math.max(0, g), 1);
1095
- b = Math.min(Math.max(0, b), 1);
1096
- return [r * 255, g * 255, b * 255];
1021
+ const x = xyz[0] / 100;
1022
+ const y = xyz[1] / 100;
1023
+ const z = xyz[2] / 100;
1024
+ let r;
1025
+ let g;
1026
+ let b;
1027
+
1028
+ r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
1029
+ g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
1030
+ b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
1031
+
1032
+ // Assume sRGB
1033
+ r = r > 0.0031308
1034
+ ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
1035
+ : r * 12.92;
1036
+
1037
+ g = g > 0.0031308
1038
+ ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
1039
+ : g * 12.92;
1040
+
1041
+ b = b > 0.0031308
1042
+ ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
1043
+ : b * 12.92;
1044
+
1045
+ r = Math.min(Math.max(0, r), 1);
1046
+ g = Math.min(Math.max(0, g), 1);
1047
+ b = Math.min(Math.max(0, b), 1);
1048
+
1049
+ return [r * 255, g * 255, b * 255];
1097
1050
  };
1098
1051
 
1099
1052
  convert$1.xyz.lab = function (xyz) {
1100
- let x = xyz[0];
1101
- let y = xyz[1];
1102
- let z = xyz[2];
1103
- x /= 95.047;
1104
- y /= 100;
1105
- z /= 108.883;
1106
- x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
1107
- y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
1108
- z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
1109
- const l = 116 * y - 16;
1110
- const a = 500 * (x - y);
1111
- const b = 200 * (y - z);
1112
- return [l, a, b];
1053
+ let x = xyz[0];
1054
+ let y = xyz[1];
1055
+ let z = xyz[2];
1056
+
1057
+ x /= 95.047;
1058
+ y /= 100;
1059
+ z /= 108.883;
1060
+
1061
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
1062
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
1063
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
1064
+
1065
+ const l = (116 * y) - 16;
1066
+ const a = 500 * (x - y);
1067
+ const b = 200 * (y - z);
1068
+
1069
+ return [l, a, b];
1113
1070
  };
1114
1071
 
1115
1072
  convert$1.lab.xyz = function (lab) {
1116
- const l = lab[0];
1117
- const a = lab[1];
1118
- const b = lab[2];
1119
- let x;
1120
- let y;
1121
- let z;
1122
- y = (l + 16) / 116;
1123
- x = a / 500 + y;
1124
- z = y - b / 200;
1125
- const y2 = y ** 3;
1126
- const x2 = x ** 3;
1127
- const z2 = z ** 3;
1128
- y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1129
- x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1130
- z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1131
- x *= 95.047;
1132
- y *= 100;
1133
- z *= 108.883;
1134
- return [x, y, z];
1073
+ const l = lab[0];
1074
+ const a = lab[1];
1075
+ const b = lab[2];
1076
+ let x;
1077
+ let y;
1078
+ let z;
1079
+
1080
+ y = (l + 16) / 116;
1081
+ x = a / 500 + y;
1082
+ z = y - b / 200;
1083
+
1084
+ const y2 = y ** 3;
1085
+ const x2 = x ** 3;
1086
+ const z2 = z ** 3;
1087
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1088
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1089
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1090
+
1091
+ x *= 95.047;
1092
+ y *= 100;
1093
+ z *= 108.883;
1094
+
1095
+ return [x, y, z];
1135
1096
  };
1136
1097
 
1137
1098
  convert$1.lab.lch = function (lab) {
1138
- const l = lab[0];
1139
- const a = lab[1];
1140
- const b = lab[2];
1141
- let h;
1142
- const hr = Math.atan2(b, a);
1143
- h = hr * 360 / 2 / Math.PI;
1144
-
1145
- if (h < 0) {
1146
- h += 360;
1147
- }
1099
+ const l = lab[0];
1100
+ const a = lab[1];
1101
+ const b = lab[2];
1102
+ let h;
1148
1103
 
1149
- const c = Math.sqrt(a * a + b * b);
1150
- return [l, c, h];
1104
+ const hr = Math.atan2(b, a);
1105
+ h = hr * 360 / 2 / Math.PI;
1106
+
1107
+ if (h < 0) {
1108
+ h += 360;
1109
+ }
1110
+
1111
+ const c = Math.sqrt(a * a + b * b);
1112
+
1113
+ return [l, c, h];
1151
1114
  };
1152
1115
 
1153
1116
  convert$1.lch.lab = function (lch) {
1154
- const l = lch[0];
1155
- const c = lch[1];
1156
- const h = lch[2];
1157
- const hr = h / 360 * 2 * Math.PI;
1158
- const a = c * Math.cos(hr);
1159
- const b = c * Math.sin(hr);
1160
- return [l, a, b];
1117
+ const l = lch[0];
1118
+ const c = lch[1];
1119
+ const h = lch[2];
1120
+
1121
+ const hr = h / 360 * 2 * Math.PI;
1122
+ const a = c * Math.cos(hr);
1123
+ const b = c * Math.sin(hr);
1124
+
1125
+ return [l, a, b];
1161
1126
  };
1162
1127
 
1163
1128
  convert$1.rgb.ansi16 = function (args, saturation = null) {
1164
- const [r, g, b] = args;
1165
- let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1129
+ const [r, g, b] = args;
1130
+ let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1166
1131
 
1167
- value = Math.round(value / 50);
1132
+ value = Math.round(value / 50);
1168
1133
 
1169
- if (value === 0) {
1170
- return 30;
1171
- }
1134
+ if (value === 0) {
1135
+ return 30;
1136
+ }
1172
1137
 
1173
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
1138
+ let ansi = 30
1139
+ + ((Math.round(b / 255) << 2)
1140
+ | (Math.round(g / 255) << 1)
1141
+ | Math.round(r / 255));
1174
1142
 
1175
- if (value === 2) {
1176
- ansi += 60;
1177
- }
1143
+ if (value === 2) {
1144
+ ansi += 60;
1145
+ }
1178
1146
 
1179
- return ansi;
1147
+ return ansi;
1180
1148
  };
1181
1149
 
1182
1150
  convert$1.hsv.ansi16 = function (args) {
1183
- // Optimization here; we already know the value and don't need to get
1184
- // it converted for us.
1185
- return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
1151
+ // Optimization here; we already know the value and don't need to get
1152
+ // it converted for us.
1153
+ return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
1186
1154
  };
1187
1155
 
1188
1156
  convert$1.rgb.ansi256 = function (args) {
1189
- const r = args[0];
1190
- const g = args[1];
1191
- const b = args[2]; // We use the extended greyscale palette here, with the exception of
1192
- // black and white. normal palette only has 4 greyscale shades.
1157
+ const r = args[0];
1158
+ const g = args[1];
1159
+ const b = args[2];
1160
+
1161
+ // We use the extended greyscale palette here, with the exception of
1162
+ // black and white. normal palette only has 4 greyscale shades.
1163
+ if (r === g && g === b) {
1164
+ if (r < 8) {
1165
+ return 16;
1166
+ }
1193
1167
 
1194
- if (r === g && g === b) {
1195
- if (r < 8) {
1196
- return 16;
1197
- }
1168
+ if (r > 248) {
1169
+ return 231;
1170
+ }
1198
1171
 
1199
- if (r > 248) {
1200
- return 231;
1201
- }
1172
+ return Math.round(((r - 8) / 247) * 24) + 232;
1173
+ }
1202
1174
 
1203
- return Math.round((r - 8) / 247 * 24) + 232;
1204
- }
1175
+ const ansi = 16
1176
+ + (36 * Math.round(r / 255 * 5))
1177
+ + (6 * Math.round(g / 255 * 5))
1178
+ + Math.round(b / 255 * 5);
1205
1179
 
1206
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
1207
- return ansi;
1180
+ return ansi;
1208
1181
  };
1209
1182
 
1210
1183
  convert$1.ansi16.rgb = function (args) {
1211
- let color = args % 10; // Handle greyscale
1184
+ let color = args % 10;
1212
1185
 
1213
- if (color === 0 || color === 7) {
1214
- if (args > 50) {
1215
- color += 3.5;
1216
- }
1186
+ // Handle greyscale
1187
+ if (color === 0 || color === 7) {
1188
+ if (args > 50) {
1189
+ color += 3.5;
1190
+ }
1217
1191
 
1218
- color = color / 10.5 * 255;
1219
- return [color, color, color];
1220
- }
1192
+ color = color / 10.5 * 255;
1193
+
1194
+ return [color, color, color];
1195
+ }
1196
+
1197
+ const mult = (~~(args > 50) + 1) * 0.5;
1198
+ const r = ((color & 1) * mult) * 255;
1199
+ const g = (((color >> 1) & 1) * mult) * 255;
1200
+ const b = (((color >> 2) & 1) * mult) * 255;
1221
1201
 
1222
- const mult = (~~(args > 50) + 1) * 0.5;
1223
- const r = (color & 1) * mult * 255;
1224
- const g = (color >> 1 & 1) * mult * 255;
1225
- const b = (color >> 2 & 1) * mult * 255;
1226
- return [r, g, b];
1202
+ return [r, g, b];
1227
1203
  };
1228
1204
 
1229
1205
  convert$1.ansi256.rgb = function (args) {
1230
- // Handle greyscale
1231
- if (args >= 232) {
1232
- const c = (args - 232) * 10 + 8;
1233
- return [c, c, c];
1234
- }
1206
+ // Handle greyscale
1207
+ if (args >= 232) {
1208
+ const c = (args - 232) * 10 + 8;
1209
+ return [c, c, c];
1210
+ }
1211
+
1212
+ args -= 16;
1213
+
1214
+ let rem;
1215
+ const r = Math.floor(args / 36) / 5 * 255;
1216
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1217
+ const b = (rem % 6) / 5 * 255;
1235
1218
 
1236
- args -= 16;
1237
- let rem;
1238
- const r = Math.floor(args / 36) / 5 * 255;
1239
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1240
- const b = rem % 6 / 5 * 255;
1241
- return [r, g, b];
1219
+ return [r, g, b];
1242
1220
  };
1243
1221
 
1244
1222
  convert$1.rgb.hex = function (args) {
1245
- const integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);
1246
- const string = integer.toString(16).toUpperCase();
1247
- return '000000'.substring(string.length) + string;
1223
+ const integer = ((Math.round(args[0]) & 0xFF) << 16)
1224
+ + ((Math.round(args[1]) & 0xFF) << 8)
1225
+ + (Math.round(args[2]) & 0xFF);
1226
+
1227
+ const string = integer.toString(16).toUpperCase();
1228
+ return '000000'.substring(string.length) + string;
1248
1229
  };
1249
1230
 
1250
1231
  convert$1.hex.rgb = function (args) {
1251
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1232
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1233
+ if (!match) {
1234
+ return [0, 0, 0];
1235
+ }
1252
1236
 
1253
- if (!match) {
1254
- return [0, 0, 0];
1255
- }
1237
+ let colorString = match[0];
1256
1238
 
1257
- let colorString = match[0];
1239
+ if (match[0].length === 3) {
1240
+ colorString = colorString.split('').map(char => {
1241
+ return char + char;
1242
+ }).join('');
1243
+ }
1258
1244
 
1259
- if (match[0].length === 3) {
1260
- colorString = colorString.split('').map(char => {
1261
- return char + char;
1262
- }).join('');
1263
- }
1245
+ const integer = parseInt(colorString, 16);
1246
+ const r = (integer >> 16) & 0xFF;
1247
+ const g = (integer >> 8) & 0xFF;
1248
+ const b = integer & 0xFF;
1264
1249
 
1265
- const integer = parseInt(colorString, 16);
1266
- const r = integer >> 16 & 0xFF;
1267
- const g = integer >> 8 & 0xFF;
1268
- const b = integer & 0xFF;
1269
- return [r, g, b];
1250
+ return [r, g, b];
1270
1251
  };
1271
1252
 
1272
1253
  convert$1.rgb.hcg = function (rgb) {
1273
- const r = rgb[0] / 255;
1274
- const g = rgb[1] / 255;
1275
- const b = rgb[2] / 255;
1276
- const max = Math.max(Math.max(r, g), b);
1277
- const min = Math.min(Math.min(r, g), b);
1278
- const chroma = max - min;
1279
- let grayscale;
1280
- let hue;
1281
-
1282
- if (chroma < 1) {
1283
- grayscale = min / (1 - chroma);
1284
- } else {
1285
- grayscale = 0;
1286
- }
1254
+ const r = rgb[0] / 255;
1255
+ const g = rgb[1] / 255;
1256
+ const b = rgb[2] / 255;
1257
+ const max = Math.max(Math.max(r, g), b);
1258
+ const min = Math.min(Math.min(r, g), b);
1259
+ const chroma = (max - min);
1260
+ let grayscale;
1261
+ let hue;
1262
+
1263
+ if (chroma < 1) {
1264
+ grayscale = min / (1 - chroma);
1265
+ } else {
1266
+ grayscale = 0;
1267
+ }
1287
1268
 
1288
- if (chroma <= 0) {
1289
- hue = 0;
1290
- } else if (max === r) {
1291
- hue = (g - b) / chroma % 6;
1292
- } else if (max === g) {
1293
- hue = 2 + (b - r) / chroma;
1294
- } else {
1295
- hue = 4 + (r - g) / chroma;
1296
- }
1269
+ if (chroma <= 0) {
1270
+ hue = 0;
1271
+ } else
1272
+ if (max === r) {
1273
+ hue = ((g - b) / chroma) % 6;
1274
+ } else
1275
+ if (max === g) {
1276
+ hue = 2 + (b - r) / chroma;
1277
+ } else {
1278
+ hue = 4 + (r - g) / chroma;
1279
+ }
1280
+
1281
+ hue /= 6;
1282
+ hue %= 1;
1297
1283
 
1298
- hue /= 6;
1299
- hue %= 1;
1300
- return [hue * 360, chroma * 100, grayscale * 100];
1284
+ return [hue * 360, chroma * 100, grayscale * 100];
1301
1285
  };
1302
1286
 
1303
1287
  convert$1.hsl.hcg = function (hsl) {
1304
- const s = hsl[1] / 100;
1305
- const l = hsl[2] / 100;
1306
- const c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l);
1307
- let f = 0;
1288
+ const s = hsl[1] / 100;
1289
+ const l = hsl[2] / 100;
1308
1290
 
1309
- if (c < 1.0) {
1310
- f = (l - 0.5 * c) / (1.0 - c);
1311
- }
1291
+ const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
1312
1292
 
1313
- return [hsl[0], c * 100, f * 100];
1293
+ let f = 0;
1294
+ if (c < 1.0) {
1295
+ f = (l - 0.5 * c) / (1.0 - c);
1296
+ }
1297
+
1298
+ return [hsl[0], c * 100, f * 100];
1314
1299
  };
1315
1300
 
1316
1301
  convert$1.hsv.hcg = function (hsv) {
1317
- const s = hsv[1] / 100;
1318
- const v = hsv[2] / 100;
1319
- const c = s * v;
1320
- let f = 0;
1302
+ const s = hsv[1] / 100;
1303
+ const v = hsv[2] / 100;
1321
1304
 
1322
- if (c < 1.0) {
1323
- f = (v - c) / (1 - c);
1324
- }
1305
+ const c = s * v;
1306
+ let f = 0;
1307
+
1308
+ if (c < 1.0) {
1309
+ f = (v - c) / (1 - c);
1310
+ }
1325
1311
 
1326
- return [hsv[0], c * 100, f * 100];
1312
+ return [hsv[0], c * 100, f * 100];
1327
1313
  };
1328
1314
 
1329
1315
  convert$1.hcg.rgb = function (hcg) {
1330
- const h = hcg[0] / 360;
1331
- const c = hcg[1] / 100;
1332
- const g = hcg[2] / 100;
1333
-
1334
- if (c === 0.0) {
1335
- return [g * 255, g * 255, g * 255];
1336
- }
1337
-
1338
- const pure = [0, 0, 0];
1339
- const hi = h % 1 * 6;
1340
- const v = hi % 1;
1341
- const w = 1 - v;
1342
- let mg = 0;
1343
- /* eslint-disable max-statements-per-line */
1344
-
1345
- switch (Math.floor(hi)) {
1346
- case 0:
1347
- pure[0] = 1;
1348
- pure[1] = v;
1349
- pure[2] = 0;
1350
- break;
1351
-
1352
- case 1:
1353
- pure[0] = w;
1354
- pure[1] = 1;
1355
- pure[2] = 0;
1356
- break;
1316
+ const h = hcg[0] / 360;
1317
+ const c = hcg[1] / 100;
1318
+ const g = hcg[2] / 100;
1357
1319
 
1358
- case 2:
1359
- pure[0] = 0;
1360
- pure[1] = 1;
1361
- pure[2] = v;
1362
- break;
1363
-
1364
- case 3:
1365
- pure[0] = 0;
1366
- pure[1] = w;
1367
- pure[2] = 1;
1368
- break;
1369
-
1370
- case 4:
1371
- pure[0] = v;
1372
- pure[1] = 0;
1373
- pure[2] = 1;
1374
- break;
1320
+ if (c === 0.0) {
1321
+ return [g * 255, g * 255, g * 255];
1322
+ }
1375
1323
 
1376
- default:
1377
- pure[0] = 1;
1378
- pure[1] = 0;
1379
- pure[2] = w;
1380
- }
1381
- /* eslint-enable max-statements-per-line */
1324
+ const pure = [0, 0, 0];
1325
+ const hi = (h % 1) * 6;
1326
+ const v = hi % 1;
1327
+ const w = 1 - v;
1328
+ let mg = 0;
1329
+
1330
+ /* eslint-disable max-statements-per-line */
1331
+ switch (Math.floor(hi)) {
1332
+ case 0:
1333
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
1334
+ case 1:
1335
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
1336
+ case 2:
1337
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
1338
+ case 3:
1339
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
1340
+ case 4:
1341
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
1342
+ default:
1343
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
1344
+ }
1345
+ /* eslint-enable max-statements-per-line */
1382
1346
 
1347
+ mg = (1.0 - c) * g;
1383
1348
 
1384
- mg = (1.0 - c) * g;
1385
- return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
1349
+ return [
1350
+ (c * pure[0] + mg) * 255,
1351
+ (c * pure[1] + mg) * 255,
1352
+ (c * pure[2] + mg) * 255
1353
+ ];
1386
1354
  };
1387
1355
 
1388
1356
  convert$1.hcg.hsv = function (hcg) {
1389
- const c = hcg[1] / 100;
1390
- const g = hcg[2] / 100;
1391
- const v = c + g * (1.0 - c);
1392
- let f = 0;
1357
+ const c = hcg[1] / 100;
1358
+ const g = hcg[2] / 100;
1393
1359
 
1394
- if (v > 0.0) {
1395
- f = c / v;
1396
- }
1360
+ const v = c + g * (1.0 - c);
1361
+ let f = 0;
1362
+
1363
+ if (v > 0.0) {
1364
+ f = c / v;
1365
+ }
1397
1366
 
1398
- return [hcg[0], f * 100, v * 100];
1367
+ return [hcg[0], f * 100, v * 100];
1399
1368
  };
1400
1369
 
1401
1370
  convert$1.hcg.hsl = function (hcg) {
1402
- const c = hcg[1] / 100;
1403
- const g = hcg[2] / 100;
1404
- const l = g * (1.0 - c) + 0.5 * c;
1405
- let s = 0;
1406
-
1407
- if (l > 0.0 && l < 0.5) {
1408
- s = c / (2 * l);
1409
- } else if (l >= 0.5 && l < 1.0) {
1410
- s = c / (2 * (1 - l));
1411
- }
1371
+ const c = hcg[1] / 100;
1372
+ const g = hcg[2] / 100;
1373
+
1374
+ const l = g * (1.0 - c) + 0.5 * c;
1375
+ let s = 0;
1412
1376
 
1413
- return [hcg[0], s * 100, l * 100];
1377
+ if (l > 0.0 && l < 0.5) {
1378
+ s = c / (2 * l);
1379
+ } else
1380
+ if (l >= 0.5 && l < 1.0) {
1381
+ s = c / (2 * (1 - l));
1382
+ }
1383
+
1384
+ return [hcg[0], s * 100, l * 100];
1414
1385
  };
1415
1386
 
1416
1387
  convert$1.hcg.hwb = function (hcg) {
1417
- const c = hcg[1] / 100;
1418
- const g = hcg[2] / 100;
1419
- const v = c + g * (1.0 - c);
1420
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
1388
+ const c = hcg[1] / 100;
1389
+ const g = hcg[2] / 100;
1390
+ const v = c + g * (1.0 - c);
1391
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
1421
1392
  };
1422
1393
 
1423
1394
  convert$1.hwb.hcg = function (hwb) {
1424
- const w = hwb[1] / 100;
1425
- const b = hwb[2] / 100;
1426
- const v = 1 - b;
1427
- const c = v - w;
1428
- let g = 0;
1429
-
1430
- if (c < 1) {
1431
- g = (v - c) / (1 - c);
1432
- }
1395
+ const w = hwb[1] / 100;
1396
+ const b = hwb[2] / 100;
1397
+ const v = 1 - b;
1398
+ const c = v - w;
1399
+ let g = 0;
1400
+
1401
+ if (c < 1) {
1402
+ g = (v - c) / (1 - c);
1403
+ }
1433
1404
 
1434
- return [hwb[0], c * 100, g * 100];
1405
+ return [hwb[0], c * 100, g * 100];
1435
1406
  };
1436
1407
 
1437
1408
  convert$1.apple.rgb = function (apple) {
1438
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
1409
+ return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
1439
1410
  };
1440
1411
 
1441
1412
  convert$1.rgb.apple = function (rgb) {
1442
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
1413
+ return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
1443
1414
  };
1444
1415
 
1445
1416
  convert$1.gray.rgb = function (args) {
1446
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1417
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1447
1418
  };
1448
1419
 
1449
1420
  convert$1.gray.hsl = function (args) {
1450
- return [0, 0, args[0]];
1421
+ return [0, 0, args[0]];
1451
1422
  };
1452
1423
 
1453
1424
  convert$1.gray.hsv = convert$1.gray.hsl;
1454
1425
 
1455
1426
  convert$1.gray.hwb = function (gray) {
1456
- return [0, 100, gray[0]];
1427
+ return [0, 100, gray[0]];
1457
1428
  };
1458
1429
 
1459
1430
  convert$1.gray.cmyk = function (gray) {
1460
- return [0, 0, 0, gray[0]];
1431
+ return [0, 0, 0, gray[0]];
1461
1432
  };
1462
1433
 
1463
1434
  convert$1.gray.lab = function (gray) {
1464
- return [gray[0], 0, 0];
1435
+ return [gray[0], 0, 0];
1465
1436
  };
1466
1437
 
1467
1438
  convert$1.gray.hex = function (gray) {
1468
- const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1469
- const integer = (val << 16) + (val << 8) + val;
1470
- const string = integer.toString(16).toUpperCase();
1471
- return '000000'.substring(string.length) + string;
1439
+ const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1440
+ const integer = (val << 16) + (val << 8) + val;
1441
+
1442
+ const string = integer.toString(16).toUpperCase();
1443
+ return '000000'.substring(string.length) + string;
1472
1444
  };
1473
1445
 
1474
1446
  convert$1.rgb.gray = function (rgb) {
1475
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1476
- return [val / 255 * 100];
1447
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1448
+ return [val / 255 * 100];
1477
1449
  };
1478
1450
 
1479
1451
  /*
@@ -1488,646 +1460,658 @@ convert$1.rgb.gray = function (rgb) {
1488
1460
  */
1489
1461
 
1490
1462
  function buildGraph() {
1491
- const graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1492
-
1493
- const models = Object.keys(conversions);
1494
-
1495
- for (let len = models.length, i = 0; i < len; i++) {
1496
- graph[models[i]] = {
1497
- // http://jsperf.com/1-vs-infinity
1498
- // micro-opt, but this is simple.
1499
- distance: -1,
1500
- parent: null
1501
- };
1502
- }
1503
-
1504
- return graph;
1505
- } // https://en.wikipedia.org/wiki/Breadth-first_search
1463
+ const graph = {};
1464
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1465
+ const models = Object.keys(conversions);
1466
+
1467
+ for (let len = models.length, i = 0; i < len; i++) {
1468
+ graph[models[i]] = {
1469
+ // http://jsperf.com/1-vs-infinity
1470
+ // micro-opt, but this is simple.
1471
+ distance: -1,
1472
+ parent: null
1473
+ };
1474
+ }
1506
1475
 
1476
+ return graph;
1477
+ }
1507
1478
 
1479
+ // https://en.wikipedia.org/wiki/Breadth-first_search
1508
1480
  function deriveBFS(fromModel) {
1509
- const graph = buildGraph();
1510
- const queue = [fromModel]; // Unshift -> queue -> pop
1481
+ const graph = buildGraph();
1482
+ const queue = [fromModel]; // Unshift -> queue -> pop
1511
1483
 
1512
- graph[fromModel].distance = 0;
1484
+ graph[fromModel].distance = 0;
1513
1485
 
1514
- while (queue.length) {
1515
- const current = queue.pop();
1516
- const adjacents = Object.keys(conversions[current]);
1486
+ while (queue.length) {
1487
+ const current = queue.pop();
1488
+ const adjacents = Object.keys(conversions[current]);
1517
1489
 
1518
- for (let len = adjacents.length, i = 0; i < len; i++) {
1519
- const adjacent = adjacents[i];
1520
- const node = graph[adjacent];
1490
+ for (let len = adjacents.length, i = 0; i < len; i++) {
1491
+ const adjacent = adjacents[i];
1492
+ const node = graph[adjacent];
1521
1493
 
1522
- if (node.distance === -1) {
1523
- node.distance = graph[current].distance + 1;
1524
- node.parent = current;
1525
- queue.unshift(adjacent);
1526
- }
1527
- }
1528
- }
1494
+ if (node.distance === -1) {
1495
+ node.distance = graph[current].distance + 1;
1496
+ node.parent = current;
1497
+ queue.unshift(adjacent);
1498
+ }
1499
+ }
1500
+ }
1529
1501
 
1530
- return graph;
1502
+ return graph;
1531
1503
  }
1532
1504
 
1533
1505
  function link(from, to) {
1534
- return function (args) {
1535
- return to(from(args));
1536
- };
1506
+ return function (args) {
1507
+ return to(from(args));
1508
+ };
1537
1509
  }
1538
1510
 
1539
1511
  function wrapConversion(toModel, graph) {
1540
- const path = [graph[toModel].parent, toModel];
1541
- let fn = conversions[graph[toModel].parent][toModel];
1542
- let cur = graph[toModel].parent;
1543
-
1544
- while (graph[cur].parent) {
1545
- path.unshift(graph[cur].parent);
1546
- fn = link(conversions[graph[cur].parent][cur], fn);
1547
- cur = graph[cur].parent;
1548
- }
1512
+ const path = [graph[toModel].parent, toModel];
1513
+ let fn = conversions[graph[toModel].parent][toModel];
1514
+
1515
+ let cur = graph[toModel].parent;
1516
+ while (graph[cur].parent) {
1517
+ path.unshift(graph[cur].parent);
1518
+ fn = link(conversions[graph[cur].parent][cur], fn);
1519
+ cur = graph[cur].parent;
1520
+ }
1549
1521
 
1550
- fn.conversion = path;
1551
- return fn;
1522
+ fn.conversion = path;
1523
+ return fn;
1552
1524
  }
1553
1525
 
1554
1526
  var route = function (fromModel) {
1555
- const graph = deriveBFS(fromModel);
1556
- const conversion = {};
1557
- const models = Object.keys(graph);
1527
+ const graph = deriveBFS(fromModel);
1528
+ const conversion = {};
1558
1529
 
1559
- for (let len = models.length, i = 0; i < len; i++) {
1560
- const toModel = models[i];
1561
- const node = graph[toModel];
1530
+ const models = Object.keys(graph);
1531
+ for (let len = models.length, i = 0; i < len; i++) {
1532
+ const toModel = models[i];
1533
+ const node = graph[toModel];
1562
1534
 
1563
- if (node.parent === null) {
1564
- // No possible conversion, or this node is the source model.
1565
- continue;
1566
- }
1535
+ if (node.parent === null) {
1536
+ // No possible conversion, or this node is the source model.
1537
+ continue;
1538
+ }
1567
1539
 
1568
- conversion[toModel] = wrapConversion(toModel, graph);
1569
- }
1540
+ conversion[toModel] = wrapConversion(toModel, graph);
1541
+ }
1570
1542
 
1571
- return conversion;
1543
+ return conversion;
1572
1544
  };
1573
1545
 
1574
1546
  const convert = {};
1547
+
1575
1548
  const models = Object.keys(conversions);
1576
1549
 
1577
1550
  function wrapRaw(fn) {
1578
- const wrappedFn = function (...args) {
1579
- const arg0 = args[0];
1580
-
1581
- if (arg0 === undefined || arg0 === null) {
1582
- return arg0;
1583
- }
1584
-
1585
- if (arg0.length > 1) {
1586
- args = arg0;
1587
- }
1551
+ const wrappedFn = function (...args) {
1552
+ const arg0 = args[0];
1553
+ if (arg0 === undefined || arg0 === null) {
1554
+ return arg0;
1555
+ }
1588
1556
 
1589
- return fn(args);
1590
- }; // Preserve .conversion property if there is one
1557
+ if (arg0.length > 1) {
1558
+ args = arg0;
1559
+ }
1591
1560
 
1561
+ return fn(args);
1562
+ };
1592
1563
 
1593
- if ('conversion' in fn) {
1594
- wrappedFn.conversion = fn.conversion;
1595
- }
1564
+ // Preserve .conversion property if there is one
1565
+ if ('conversion' in fn) {
1566
+ wrappedFn.conversion = fn.conversion;
1567
+ }
1596
1568
 
1597
- return wrappedFn;
1569
+ return wrappedFn;
1598
1570
  }
1599
1571
 
1600
1572
  function wrapRounded(fn) {
1601
- const wrappedFn = function (...args) {
1602
- const arg0 = args[0];
1573
+ const wrappedFn = function (...args) {
1574
+ const arg0 = args[0];
1603
1575
 
1604
- if (arg0 === undefined || arg0 === null) {
1605
- return arg0;
1606
- }
1576
+ if (arg0 === undefined || arg0 === null) {
1577
+ return arg0;
1578
+ }
1607
1579
 
1608
- if (arg0.length > 1) {
1609
- args = arg0;
1610
- }
1580
+ if (arg0.length > 1) {
1581
+ args = arg0;
1582
+ }
1611
1583
 
1612
- const result = fn(args); // We're assuming the result is an array here.
1613
- // see notice in conversions.js; don't use box types
1614
- // in conversion functions.
1584
+ const result = fn(args);
1615
1585
 
1616
- if (typeof result === 'object') {
1617
- for (let len = result.length, i = 0; i < len; i++) {
1618
- result[i] = Math.round(result[i]);
1619
- }
1620
- }
1621
-
1622
- return result;
1623
- }; // Preserve .conversion property if there is one
1586
+ // We're assuming the result is an array here.
1587
+ // see notice in conversions.js; don't use box types
1588
+ // in conversion functions.
1589
+ if (typeof result === 'object') {
1590
+ for (let len = result.length, i = 0; i < len; i++) {
1591
+ result[i] = Math.round(result[i]);
1592
+ }
1593
+ }
1624
1594
 
1595
+ return result;
1596
+ };
1625
1597
 
1626
- if ('conversion' in fn) {
1627
- wrappedFn.conversion = fn.conversion;
1628
- }
1598
+ // Preserve .conversion property if there is one
1599
+ if ('conversion' in fn) {
1600
+ wrappedFn.conversion = fn.conversion;
1601
+ }
1629
1602
 
1630
- return wrappedFn;
1603
+ return wrappedFn;
1631
1604
  }
1632
1605
 
1633
1606
  models.forEach(fromModel => {
1634
- convert[fromModel] = {};
1635
- Object.defineProperty(convert[fromModel], 'channels', {
1636
- value: conversions[fromModel].channels
1637
- });
1638
- Object.defineProperty(convert[fromModel], 'labels', {
1639
- value: conversions[fromModel].labels
1640
- });
1641
- const routes = route(fromModel);
1642
- const routeModels = Object.keys(routes);
1643
- routeModels.forEach(toModel => {
1644
- const fn = routes[toModel];
1645
- convert[fromModel][toModel] = wrapRounded(fn);
1646
- convert[fromModel][toModel].raw = wrapRaw(fn);
1647
- });
1607
+ convert[fromModel] = {};
1608
+
1609
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
1610
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
1611
+
1612
+ const routes = route(fromModel);
1613
+ const routeModels = Object.keys(routes);
1614
+
1615
+ routeModels.forEach(toModel => {
1616
+ const fn = routes[toModel];
1617
+
1618
+ convert[fromModel][toModel] = wrapRounded(fn);
1619
+ convert[fromModel][toModel].raw = wrapRaw(fn);
1620
+ });
1648
1621
  });
1622
+
1649
1623
  var colorConvert = convert;
1650
1624
 
1651
- const skippedModels = [// To be honest, I don't really feel like keyword belongs in color convert, but eh.
1652
- 'keyword', // Gray conflicts with some method names, and has its own method defined.
1653
- 'gray', // Shouldn't really be in color-convert either...
1654
- 'hex'];
1655
- const hashedModelKeys = {};
1625
+ const skippedModels = [
1626
+ // To be honest, I don't really feel like keyword belongs in color convert, but eh.
1627
+ 'keyword',
1628
+
1629
+ // Gray conflicts with some method names, and has its own method defined.
1630
+ 'gray',
1631
+
1632
+ // Shouldn't really be in color-convert either...
1633
+ 'hex',
1634
+ ];
1656
1635
 
1636
+ const hashedModelKeys = {};
1657
1637
  for (const model of Object.keys(colorConvert)) {
1658
- hashedModelKeys[[...colorConvert[model].labels].sort().join('')] = model;
1638
+ hashedModelKeys[[...colorConvert[model].labels].sort().join('')] = model;
1659
1639
  }
1660
1640
 
1661
1641
  const limiters = {};
1662
1642
 
1663
1643
  function Color(object, model) {
1664
- if (!(this instanceof Color)) {
1665
- return new Color(object, model);
1666
- }
1644
+ if (!(this instanceof Color)) {
1645
+ return new Color(object, model);
1646
+ }
1667
1647
 
1668
- if (model && model in skippedModels) {
1669
- model = null;
1670
- }
1648
+ if (model && model in skippedModels) {
1649
+ model = null;
1650
+ }
1671
1651
 
1672
- if (model && !(model in colorConvert)) {
1673
- throw new Error('Unknown model: ' + model);
1674
- }
1652
+ if (model && !(model in colorConvert)) {
1653
+ throw new Error('Unknown model: ' + model);
1654
+ }
1675
1655
 
1676
- let i;
1677
- let channels;
1678
-
1679
- if (object == null) {
1680
- // eslint-disable-line no-eq-null,eqeqeq
1681
- this.model = 'rgb';
1682
- this.color = [0, 0, 0];
1683
- this.valpha = 1;
1684
- } else if (object instanceof Color) {
1685
- this.model = object.model;
1686
- this.color = [...object.color];
1687
- this.valpha = object.valpha;
1688
- } else if (typeof object === 'string') {
1689
- const result = colorString.get(object);
1690
-
1691
- if (result === null) {
1692
- throw new Error('Unable to parse color from string: ' + object);
1693
- }
1694
-
1695
- this.model = result.model;
1696
- channels = colorConvert[this.model].channels;
1697
- this.color = result.value.slice(0, channels);
1698
- this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1699
- } else if (object.length > 0) {
1700
- this.model = model || 'rgb';
1701
- channels = colorConvert[this.model].channels;
1702
- const newArray = Array.prototype.slice.call(object, 0, channels);
1703
- this.color = zeroArray(newArray, channels);
1704
- this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
1705
- } else if (typeof object === 'number') {
1706
- // This is always RGB - can be converted later on.
1707
- this.model = 'rgb';
1708
- this.color = [object >> 16 & 0xFF, object >> 8 & 0xFF, object & 0xFF];
1709
- this.valpha = 1;
1710
- } else {
1711
- this.valpha = 1;
1712
- const keys = Object.keys(object);
1713
-
1714
- if ('alpha' in object) {
1715
- keys.splice(keys.indexOf('alpha'), 1);
1716
- this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
1717
- }
1718
-
1719
- const hashedKeys = keys.sort().join('');
1720
-
1721
- if (!(hashedKeys in hashedModelKeys)) {
1722
- throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
1723
- }
1724
-
1725
- this.model = hashedModelKeys[hashedKeys];
1726
- const {
1727
- labels
1728
- } = colorConvert[this.model];
1729
- const color = [];
1730
-
1731
- for (i = 0; i < labels.length; i++) {
1732
- color.push(object[labels[i]]);
1733
- }
1734
-
1735
- this.color = zeroArray(color);
1736
- } // Perform limitations (clamping, etc.)
1737
-
1738
-
1739
- if (limiters[this.model]) {
1740
- channels = colorConvert[this.model].channels;
1741
-
1742
- for (i = 0; i < channels; i++) {
1743
- const limit = limiters[this.model][i];
1744
-
1745
- if (limit) {
1746
- this.color[i] = limit(this.color[i]);
1747
- }
1748
- }
1749
- }
1656
+ let i;
1657
+ let channels;
1658
+
1659
+ if (object == null) { // eslint-disable-line no-eq-null,eqeqeq
1660
+ this.model = 'rgb';
1661
+ this.color = [0, 0, 0];
1662
+ this.valpha = 1;
1663
+ } else if (object instanceof Color) {
1664
+ this.model = object.model;
1665
+ this.color = [...object.color];
1666
+ this.valpha = object.valpha;
1667
+ } else if (typeof object === 'string') {
1668
+ const result = colorString.get(object);
1669
+ if (result === null) {
1670
+ throw new Error('Unable to parse color from string: ' + object);
1671
+ }
1750
1672
 
1751
- this.valpha = Math.max(0, Math.min(1, this.valpha));
1673
+ this.model = result.model;
1674
+ channels = colorConvert[this.model].channels;
1675
+ this.color = result.value.slice(0, channels);
1676
+ this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1677
+ } else if (object.length > 0) {
1678
+ this.model = model || 'rgb';
1679
+ channels = colorConvert[this.model].channels;
1680
+ const newArray = Array.prototype.slice.call(object, 0, channels);
1681
+ this.color = zeroArray(newArray, channels);
1682
+ this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
1683
+ } else if (typeof object === 'number') {
1684
+ // This is always RGB - can be converted later on.
1685
+ this.model = 'rgb';
1686
+ this.color = [
1687
+ (object >> 16) & 0xFF,
1688
+ (object >> 8) & 0xFF,
1689
+ object & 0xFF,
1690
+ ];
1691
+ this.valpha = 1;
1692
+ } else {
1693
+ this.valpha = 1;
1752
1694
 
1753
- if (Object.freeze) {
1754
- Object.freeze(this);
1755
- }
1695
+ const keys = Object.keys(object);
1696
+ if ('alpha' in object) {
1697
+ keys.splice(keys.indexOf('alpha'), 1);
1698
+ this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
1699
+ }
1700
+
1701
+ const hashedKeys = keys.sort().join('');
1702
+ if (!(hashedKeys in hashedModelKeys)) {
1703
+ throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
1704
+ }
1705
+
1706
+ this.model = hashedModelKeys[hashedKeys];
1707
+
1708
+ const {labels} = colorConvert[this.model];
1709
+ const color = [];
1710
+ for (i = 0; i < labels.length; i++) {
1711
+ color.push(object[labels[i]]);
1712
+ }
1713
+
1714
+ this.color = zeroArray(color);
1715
+ }
1716
+
1717
+ // Perform limitations (clamping, etc.)
1718
+ if (limiters[this.model]) {
1719
+ channels = colorConvert[this.model].channels;
1720
+ for (i = 0; i < channels; i++) {
1721
+ const limit = limiters[this.model][i];
1722
+ if (limit) {
1723
+ this.color[i] = limit(this.color[i]);
1724
+ }
1725
+ }
1726
+ }
1727
+
1728
+ this.valpha = Math.max(0, Math.min(1, this.valpha));
1729
+
1730
+ if (Object.freeze) {
1731
+ Object.freeze(this);
1732
+ }
1756
1733
  }
1757
1734
 
1758
1735
  Color.prototype = {
1759
- toString() {
1760
- return this.string();
1761
- },
1762
-
1763
- toJSON() {
1764
- return this[this.model]();
1765
- },
1766
-
1767
- string(places) {
1768
- let self = this.model in colorString.to ? this : this.rgb();
1769
- self = self.round(typeof places === 'number' ? places : 1);
1770
- const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1771
- return colorString.to[self.model](args);
1772
- },
1773
-
1774
- percentString(places) {
1775
- const self = this.rgb().round(typeof places === 'number' ? places : 1);
1776
- const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1777
- return colorString.to.rgb.percent(args);
1778
- },
1779
-
1780
- array() {
1781
- return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
1782
- },
1783
-
1784
- object() {
1785
- const result = {};
1786
- const {
1787
- channels
1788
- } = colorConvert[this.model];
1789
- const {
1790
- labels
1791
- } = colorConvert[this.model];
1792
-
1793
- for (let i = 0; i < channels; i++) {
1794
- result[labels[i]] = this.color[i];
1795
- }
1796
-
1797
- if (this.valpha !== 1) {
1798
- result.alpha = this.valpha;
1799
- }
1800
-
1801
- return result;
1802
- },
1803
-
1804
- unitArray() {
1805
- const rgb = this.rgb().color;
1806
- rgb[0] /= 255;
1807
- rgb[1] /= 255;
1808
- rgb[2] /= 255;
1809
-
1810
- if (this.valpha !== 1) {
1811
- rgb.push(this.valpha);
1812
- }
1813
-
1814
- return rgb;
1815
- },
1816
-
1817
- unitObject() {
1818
- const rgb = this.rgb().object();
1819
- rgb.r /= 255;
1820
- rgb.g /= 255;
1821
- rgb.b /= 255;
1822
-
1823
- if (this.valpha !== 1) {
1824
- rgb.alpha = this.valpha;
1825
- }
1826
-
1827
- return rgb;
1828
- },
1829
-
1830
- round(places) {
1831
- places = Math.max(places || 0, 0);
1832
- return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
1833
- },
1834
-
1835
- alpha(value) {
1836
- if (value !== undefined) {
1837
- return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
1838
- }
1839
-
1840
- return this.valpha;
1841
- },
1842
-
1843
- // Rgb
1844
- red: getset('rgb', 0, maxfn(255)),
1845
- green: getset('rgb', 1, maxfn(255)),
1846
- blue: getset('rgb', 2, maxfn(255)),
1847
- hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => (value % 360 + 360) % 360),
1848
- saturationl: getset('hsl', 1, maxfn(100)),
1849
- lightness: getset('hsl', 2, maxfn(100)),
1850
- saturationv: getset('hsv', 1, maxfn(100)),
1851
- value: getset('hsv', 2, maxfn(100)),
1852
- chroma: getset('hcg', 1, maxfn(100)),
1853
- gray: getset('hcg', 2, maxfn(100)),
1854
- white: getset('hwb', 1, maxfn(100)),
1855
- wblack: getset('hwb', 2, maxfn(100)),
1856
- cyan: getset('cmyk', 0, maxfn(100)),
1857
- magenta: getset('cmyk', 1, maxfn(100)),
1858
- yellow: getset('cmyk', 2, maxfn(100)),
1859
- black: getset('cmyk', 3, maxfn(100)),
1860
- x: getset('xyz', 0, maxfn(95.047)),
1861
- y: getset('xyz', 1, maxfn(100)),
1862
- z: getset('xyz', 2, maxfn(108.833)),
1863
- l: getset('lab', 0, maxfn(100)),
1864
- a: getset('lab', 1),
1865
- b: getset('lab', 2),
1866
-
1867
- keyword(value) {
1868
- if (value !== undefined) {
1869
- return new Color(value);
1870
- }
1871
-
1872
- return colorConvert[this.model].keyword(this.color);
1873
- },
1874
-
1875
- hex(value) {
1876
- if (value !== undefined) {
1877
- return new Color(value);
1878
- }
1879
-
1880
- return colorString.to.hex(this.rgb().round().color);
1881
- },
1882
-
1883
- hexa(value) {
1884
- if (value !== undefined) {
1885
- return new Color(value);
1886
- }
1887
-
1888
- const rgbArray = this.rgb().round().color;
1889
- let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
1890
-
1891
- if (alphaHex.length === 1) {
1892
- alphaHex = '0' + alphaHex;
1893
- }
1894
-
1895
- return colorString.to.hex(rgbArray) + alphaHex;
1896
- },
1897
-
1898
- rgbNumber() {
1899
- const rgb = this.rgb().color;
1900
- return (rgb[0] & 0xFF) << 16 | (rgb[1] & 0xFF) << 8 | rgb[2] & 0xFF;
1901
- },
1902
-
1903
- luminosity() {
1904
- // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1905
- const rgb = this.rgb().color;
1906
- const lum = [];
1907
-
1908
- for (const [i, element] of rgb.entries()) {
1909
- const chan = element / 255;
1910
- lum[i] = chan <= 0.04045 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
1911
- }
1912
-
1913
- return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1914
- },
1915
-
1916
- contrast(color2) {
1917
- // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1918
- const lum1 = this.luminosity();
1919
- const lum2 = color2.luminosity();
1920
-
1921
- if (lum1 > lum2) {
1922
- return (lum1 + 0.05) / (lum2 + 0.05);
1923
- }
1924
-
1925
- return (lum2 + 0.05) / (lum1 + 0.05);
1926
- },
1927
-
1928
- level(color2) {
1929
- // https://www.w3.org/TR/WCAG/#contrast-enhanced
1930
- const contrastRatio = this.contrast(color2);
1931
-
1932
- if (contrastRatio >= 7) {
1933
- return 'AAA';
1934
- }
1935
-
1936
- return contrastRatio >= 4.5 ? 'AA' : '';
1937
- },
1938
-
1939
- isDark() {
1940
- // YIQ equation from http://24ways.org/2010/calculating-color-contrast
1941
- const rgb = this.rgb().color;
1942
- const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
1943
- return yiq < 128;
1944
- },
1945
-
1946
- isLight() {
1947
- return !this.isDark();
1948
- },
1949
-
1950
- negate() {
1951
- const rgb = this.rgb();
1952
-
1953
- for (let i = 0; i < 3; i++) {
1954
- rgb.color[i] = 255 - rgb.color[i];
1955
- }
1956
-
1957
- return rgb;
1958
- },
1959
-
1960
- lighten(ratio) {
1961
- const hsl = this.hsl();
1962
- hsl.color[2] += hsl.color[2] * ratio;
1963
- return hsl;
1964
- },
1965
-
1966
- darken(ratio) {
1967
- const hsl = this.hsl();
1968
- hsl.color[2] -= hsl.color[2] * ratio;
1969
- return hsl;
1970
- },
1971
-
1972
- saturate(ratio) {
1973
- const hsl = this.hsl();
1974
- hsl.color[1] += hsl.color[1] * ratio;
1975
- return hsl;
1976
- },
1977
-
1978
- desaturate(ratio) {
1979
- const hsl = this.hsl();
1980
- hsl.color[1] -= hsl.color[1] * ratio;
1981
- return hsl;
1982
- },
1983
-
1984
- whiten(ratio) {
1985
- const hwb = this.hwb();
1986
- hwb.color[1] += hwb.color[1] * ratio;
1987
- return hwb;
1988
- },
1989
-
1990
- blacken(ratio) {
1991
- const hwb = this.hwb();
1992
- hwb.color[2] += hwb.color[2] * ratio;
1993
- return hwb;
1994
- },
1995
-
1996
- grayscale() {
1997
- // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
1998
- const rgb = this.rgb().color;
1999
- const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
2000
- return Color.rgb(value, value, value);
2001
- },
2002
-
2003
- fade(ratio) {
2004
- return this.alpha(this.valpha - this.valpha * ratio);
2005
- },
2006
-
2007
- opaquer(ratio) {
2008
- return this.alpha(this.valpha + this.valpha * ratio);
2009
- },
2010
-
2011
- rotate(degrees) {
2012
- const hsl = this.hsl();
2013
- let hue = hsl.color[0];
2014
- hue = (hue + degrees) % 360;
2015
- hue = hue < 0 ? 360 + hue : hue;
2016
- hsl.color[0] = hue;
2017
- return hsl;
2018
- },
2019
-
2020
- mix(mixinColor, weight) {
2021
- // Ported from sass implementation in C
2022
- // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
2023
- if (!mixinColor || !mixinColor.rgb) {
2024
- throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
2025
- }
2026
-
2027
- const color1 = mixinColor.rgb();
2028
- const color2 = this.rgb();
2029
- const p = weight === undefined ? 0.5 : weight;
2030
- const w = 2 * p - 1;
2031
- const a = color1.alpha() - color2.alpha();
2032
- const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
2033
- const w2 = 1 - w1;
2034
- return Color.rgb(w1 * color1.red() + w2 * color2.red(), w1 * color1.green() + w2 * color2.green(), w1 * color1.blue() + w2 * color2.blue(), color1.alpha() * p + color2.alpha() * (1 - p));
2035
- }
1736
+ toString() {
1737
+ return this.string();
1738
+ },
1739
+
1740
+ toJSON() {
1741
+ return this[this.model]();
1742
+ },
1743
+
1744
+ string(places) {
1745
+ let self = this.model in colorString.to ? this : this.rgb();
1746
+ self = self.round(typeof places === 'number' ? places : 1);
1747
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1748
+ return colorString.to[self.model](args);
1749
+ },
1750
+
1751
+ percentString(places) {
1752
+ const self = this.rgb().round(typeof places === 'number' ? places : 1);
1753
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1754
+ return colorString.to.rgb.percent(args);
1755
+ },
1756
+
1757
+ array() {
1758
+ return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
1759
+ },
1760
+
1761
+ object() {
1762
+ const result = {};
1763
+ const {channels} = colorConvert[this.model];
1764
+ const {labels} = colorConvert[this.model];
1765
+
1766
+ for (let i = 0; i < channels; i++) {
1767
+ result[labels[i]] = this.color[i];
1768
+ }
2036
1769
 
2037
- }; // Model conversion methods and static constructors
1770
+ if (this.valpha !== 1) {
1771
+ result.alpha = this.valpha;
1772
+ }
2038
1773
 
2039
- for (const model of Object.keys(colorConvert)) {
2040
- if (skippedModels.includes(model)) {
2041
- continue;
2042
- }
1774
+ return result;
1775
+ },
1776
+
1777
+ unitArray() {
1778
+ const rgb = this.rgb().color;
1779
+ rgb[0] /= 255;
1780
+ rgb[1] /= 255;
1781
+ rgb[2] /= 255;
1782
+
1783
+ if (this.valpha !== 1) {
1784
+ rgb.push(this.valpha);
1785
+ }
1786
+
1787
+ return rgb;
1788
+ },
1789
+
1790
+ unitObject() {
1791
+ const rgb = this.rgb().object();
1792
+ rgb.r /= 255;
1793
+ rgb.g /= 255;
1794
+ rgb.b /= 255;
1795
+
1796
+ if (this.valpha !== 1) {
1797
+ rgb.alpha = this.valpha;
1798
+ }
1799
+
1800
+ return rgb;
1801
+ },
1802
+
1803
+ round(places) {
1804
+ places = Math.max(places || 0, 0);
1805
+ return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
1806
+ },
1807
+
1808
+ alpha(value) {
1809
+ if (value !== undefined) {
1810
+ return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
1811
+ }
1812
+
1813
+ return this.valpha;
1814
+ },
2043
1815
 
2044
- const {
2045
- channels
2046
- } = colorConvert[model]; // Conversion methods
1816
+ // Rgb
1817
+ red: getset('rgb', 0, maxfn(255)),
1818
+ green: getset('rgb', 1, maxfn(255)),
1819
+ blue: getset('rgb', 2, maxfn(255)),
2047
1820
 
2048
- Color.prototype[model] = function (...args) {
2049
- if (this.model === model) {
2050
- return new Color(this);
2051
- }
1821
+ hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),
2052
1822
 
2053
- if (args.length > 0) {
2054
- return new Color(args, model);
2055
- }
1823
+ saturationl: getset('hsl', 1, maxfn(100)),
1824
+ lightness: getset('hsl', 2, maxfn(100)),
2056
1825
 
2057
- return new Color([...assertArray(colorConvert[this.model][model].raw(this.color)), this.valpha], model);
2058
- }; // 'static' construction methods
1826
+ saturationv: getset('hsv', 1, maxfn(100)),
1827
+ value: getset('hsv', 2, maxfn(100)),
2059
1828
 
1829
+ chroma: getset('hcg', 1, maxfn(100)),
1830
+ gray: getset('hcg', 2, maxfn(100)),
2060
1831
 
2061
- Color[model] = function (...args) {
2062
- let color = args[0];
1832
+ white: getset('hwb', 1, maxfn(100)),
1833
+ wblack: getset('hwb', 2, maxfn(100)),
2063
1834
 
2064
- if (typeof color === 'number') {
2065
- color = zeroArray(args, channels);
2066
- }
1835
+ cyan: getset('cmyk', 0, maxfn(100)),
1836
+ magenta: getset('cmyk', 1, maxfn(100)),
1837
+ yellow: getset('cmyk', 2, maxfn(100)),
1838
+ black: getset('cmyk', 3, maxfn(100)),
1839
+
1840
+ x: getset('xyz', 0, maxfn(95.047)),
1841
+ y: getset('xyz', 1, maxfn(100)),
1842
+ z: getset('xyz', 2, maxfn(108.833)),
1843
+
1844
+ l: getset('lab', 0, maxfn(100)),
1845
+ a: getset('lab', 1),
1846
+ b: getset('lab', 2),
1847
+
1848
+ keyword(value) {
1849
+ if (value !== undefined) {
1850
+ return new Color(value);
1851
+ }
1852
+
1853
+ return colorConvert[this.model].keyword(this.color);
1854
+ },
1855
+
1856
+ hex(value) {
1857
+ if (value !== undefined) {
1858
+ return new Color(value);
1859
+ }
2067
1860
 
2068
- return new Color(color, model);
2069
- };
1861
+ return colorString.to.hex(this.rgb().round().color);
1862
+ },
1863
+
1864
+ hexa(value) {
1865
+ if (value !== undefined) {
1866
+ return new Color(value);
1867
+ }
1868
+
1869
+ const rgbArray = this.rgb().round().color;
1870
+
1871
+ let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
1872
+ if (alphaHex.length === 1) {
1873
+ alphaHex = '0' + alphaHex;
1874
+ }
1875
+
1876
+ return colorString.to.hex(rgbArray) + alphaHex;
1877
+ },
1878
+
1879
+ rgbNumber() {
1880
+ const rgb = this.rgb().color;
1881
+ return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
1882
+ },
1883
+
1884
+ luminosity() {
1885
+ // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1886
+ const rgb = this.rgb().color;
1887
+
1888
+ const lum = [];
1889
+ for (const [i, element] of rgb.entries()) {
1890
+ const chan = element / 255;
1891
+ lum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
1892
+ }
1893
+
1894
+ return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1895
+ },
1896
+
1897
+ contrast(color2) {
1898
+ // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1899
+ const lum1 = this.luminosity();
1900
+ const lum2 = color2.luminosity();
1901
+
1902
+ if (lum1 > lum2) {
1903
+ return (lum1 + 0.05) / (lum2 + 0.05);
1904
+ }
1905
+
1906
+ return (lum2 + 0.05) / (lum1 + 0.05);
1907
+ },
1908
+
1909
+ level(color2) {
1910
+ // https://www.w3.org/TR/WCAG/#contrast-enhanced
1911
+ const contrastRatio = this.contrast(color2);
1912
+ if (contrastRatio >= 7) {
1913
+ return 'AAA';
1914
+ }
1915
+
1916
+ return (contrastRatio >= 4.5) ? 'AA' : '';
1917
+ },
1918
+
1919
+ isDark() {
1920
+ // YIQ equation from http://24ways.org/2010/calculating-color-contrast
1921
+ const rgb = this.rgb().color;
1922
+ const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
1923
+ return yiq < 128;
1924
+ },
1925
+
1926
+ isLight() {
1927
+ return !this.isDark();
1928
+ },
1929
+
1930
+ negate() {
1931
+ const rgb = this.rgb();
1932
+ for (let i = 0; i < 3; i++) {
1933
+ rgb.color[i] = 255 - rgb.color[i];
1934
+ }
1935
+
1936
+ return rgb;
1937
+ },
1938
+
1939
+ lighten(ratio) {
1940
+ const hsl = this.hsl();
1941
+ hsl.color[2] += hsl.color[2] * ratio;
1942
+ return hsl;
1943
+ },
1944
+
1945
+ darken(ratio) {
1946
+ const hsl = this.hsl();
1947
+ hsl.color[2] -= hsl.color[2] * ratio;
1948
+ return hsl;
1949
+ },
1950
+
1951
+ saturate(ratio) {
1952
+ const hsl = this.hsl();
1953
+ hsl.color[1] += hsl.color[1] * ratio;
1954
+ return hsl;
1955
+ },
1956
+
1957
+ desaturate(ratio) {
1958
+ const hsl = this.hsl();
1959
+ hsl.color[1] -= hsl.color[1] * ratio;
1960
+ return hsl;
1961
+ },
1962
+
1963
+ whiten(ratio) {
1964
+ const hwb = this.hwb();
1965
+ hwb.color[1] += hwb.color[1] * ratio;
1966
+ return hwb;
1967
+ },
1968
+
1969
+ blacken(ratio) {
1970
+ const hwb = this.hwb();
1971
+ hwb.color[2] += hwb.color[2] * ratio;
1972
+ return hwb;
1973
+ },
1974
+
1975
+ grayscale() {
1976
+ // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
1977
+ const rgb = this.rgb().color;
1978
+ const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
1979
+ return Color.rgb(value, value, value);
1980
+ },
1981
+
1982
+ fade(ratio) {
1983
+ return this.alpha(this.valpha - (this.valpha * ratio));
1984
+ },
1985
+
1986
+ opaquer(ratio) {
1987
+ return this.alpha(this.valpha + (this.valpha * ratio));
1988
+ },
1989
+
1990
+ rotate(degrees) {
1991
+ const hsl = this.hsl();
1992
+ let hue = hsl.color[0];
1993
+ hue = (hue + degrees) % 360;
1994
+ hue = hue < 0 ? 360 + hue : hue;
1995
+ hsl.color[0] = hue;
1996
+ return hsl;
1997
+ },
1998
+
1999
+ mix(mixinColor, weight) {
2000
+ // Ported from sass implementation in C
2001
+ // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
2002
+ if (!mixinColor || !mixinColor.rgb) {
2003
+ throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
2004
+ }
2005
+
2006
+ const color1 = mixinColor.rgb();
2007
+ const color2 = this.rgb();
2008
+ const p = weight === undefined ? 0.5 : weight;
2009
+
2010
+ const w = 2 * p - 1;
2011
+ const a = color1.alpha() - color2.alpha();
2012
+
2013
+ const w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;
2014
+ const w2 = 1 - w1;
2015
+
2016
+ return Color.rgb(
2017
+ w1 * color1.red() + w2 * color2.red(),
2018
+ w1 * color1.green() + w2 * color2.green(),
2019
+ w1 * color1.blue() + w2 * color2.blue(),
2020
+ color1.alpha() * p + color2.alpha() * (1 - p));
2021
+ },
2022
+ };
2023
+
2024
+ // Model conversion methods and static constructors
2025
+ for (const model of Object.keys(colorConvert)) {
2026
+ if (skippedModels.includes(model)) {
2027
+ continue;
2028
+ }
2029
+
2030
+ const {channels} = colorConvert[model];
2031
+
2032
+ // Conversion methods
2033
+ Color.prototype[model] = function (...args) {
2034
+ if (this.model === model) {
2035
+ return new Color(this);
2036
+ }
2037
+
2038
+ if (args.length > 0) {
2039
+ return new Color(args, model);
2040
+ }
2041
+
2042
+ return new Color([...assertArray(colorConvert[this.model][model].raw(this.color)), this.valpha], model);
2043
+ };
2044
+
2045
+ // 'static' construction methods
2046
+ Color[model] = function (...args) {
2047
+ let color = args[0];
2048
+ if (typeof color === 'number') {
2049
+ color = zeroArray(args, channels);
2050
+ }
2051
+
2052
+ return new Color(color, model);
2053
+ };
2070
2054
  }
2071
2055
 
2072
2056
  function roundTo(number, places) {
2073
- return Number(number.toFixed(places));
2057
+ return Number(number.toFixed(places));
2074
2058
  }
2075
2059
 
2076
2060
  function roundToPlace(places) {
2077
- return function (number) {
2078
- return roundTo(number, places);
2079
- };
2061
+ return function (number) {
2062
+ return roundTo(number, places);
2063
+ };
2080
2064
  }
2081
2065
 
2082
2066
  function getset(model, channel, modifier) {
2083
- model = Array.isArray(model) ? model : [model];
2067
+ model = Array.isArray(model) ? model : [model];
2084
2068
 
2085
- for (const m of model) {
2086
- (limiters[m] || (limiters[m] = []))[channel] = modifier;
2087
- }
2069
+ for (const m of model) {
2070
+ (limiters[m] || (limiters[m] = []))[channel] = modifier;
2071
+ }
2088
2072
 
2089
- model = model[0];
2090
- return function (value) {
2091
- let result;
2073
+ model = model[0];
2092
2074
 
2093
- if (value !== undefined) {
2094
- if (modifier) {
2095
- value = modifier(value);
2096
- }
2075
+ return function (value) {
2076
+ let result;
2097
2077
 
2098
- result = this[model]();
2099
- result.color[channel] = value;
2100
- return result;
2101
- }
2078
+ if (value !== undefined) {
2079
+ if (modifier) {
2080
+ value = modifier(value);
2081
+ }
2102
2082
 
2103
- result = this[model]().color[channel];
2083
+ result = this[model]();
2084
+ result.color[channel] = value;
2085
+ return result;
2086
+ }
2104
2087
 
2105
- if (modifier) {
2106
- result = modifier(result);
2107
- }
2088
+ result = this[model]().color[channel];
2089
+ if (modifier) {
2090
+ result = modifier(result);
2091
+ }
2108
2092
 
2109
- return result;
2110
- };
2093
+ return result;
2094
+ };
2111
2095
  }
2112
2096
 
2113
2097
  function maxfn(max) {
2114
- return function (v) {
2115
- return Math.max(0, Math.min(max, v));
2116
- };
2098
+ return function (v) {
2099
+ return Math.max(0, Math.min(max, v));
2100
+ };
2117
2101
  }
2118
2102
 
2119
2103
  function assertArray(value) {
2120
- return Array.isArray(value) ? value : [value];
2104
+ return Array.isArray(value) ? value : [value];
2121
2105
  }
2122
2106
 
2123
2107
  function zeroArray(array, length) {
2124
- for (let i = 0; i < length; i++) {
2125
- if (typeof array[i] !== 'number') {
2126
- array[i] = 0;
2127
- }
2128
- }
2108
+ for (let i = 0; i < length; i++) {
2109
+ if (typeof array[i] !== 'number') {
2110
+ array[i] = 0;
2111
+ }
2112
+ }
2129
2113
 
2130
- return array;
2114
+ return array;
2131
2115
  }
2132
2116
 
2133
2117
  var color = Color;