@luzmo/analytics-components-kit 1.0.1-alpha.47 → 1.0.1-alpha.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/box-plot-options.config-SrrbDEYW.cjs +20 -0
- package/components/{box-plot-options.config-vlz5qeNq.js → box-plot-options.config-xu_i6ms7.js} +119 -44
- package/components/{bullet-chart-options.config-Bsw7N7Wl.js → bullet-chart-options.config-CDPpX1yc.js} +11 -0
- package/components/{button-base-DbkDzb71-CY6MJGqE.cjs → button-base-DbkDzb71-D0Ni0xn1.cjs} +1 -1
- package/components/{button-base-DbkDzb71-R8oqSqlY.js → button-base-DbkDzb71-Dh2Out91.js} +1 -1
- package/components/{calculate-data-item-icon-DKjZwr-x.js → calculate-data-item-icon-BiIL_s4Z.js} +1 -1
- package/components/choropleth-map-options.config-B_W9-rhe.js +381 -0
- package/components/choropleth-map-options.config-ZW8yoZH2.cjs +20 -0
- package/components/{choropleth-map-options.de-B_Agdr4T.cjs → choropleth-map-options.de-C4ko9lE4.cjs} +1 -1
- package/components/{choropleth-map-options.de-BSt-L5Vh.js → choropleth-map-options.de-CIls11eI.js} +1 -1
- package/components/{choropleth-map-options.en-Cy7WcWLG.js → choropleth-map-options.en-C7cPpmnS.js} +1 -1
- package/components/{choropleth-map-options.en-DJHAy6ek.cjs → choropleth-map-options.en-DVWBmXFe.cjs} +1 -1
- package/components/{choropleth-map-options.es-BnR-9vJv.js → choropleth-map-options.es-gQPy8Q0q.js} +1 -1
- package/components/{choropleth-map-options.es-Dr07odJo.cjs → choropleth-map-options.es-v5dYm1W3.cjs} +1 -1
- package/components/{choropleth-map-options.fr-CR5NMRR3.cjs → choropleth-map-options.fr-Bpk_J4Gw.cjs} +1 -1
- package/components/{choropleth-map-options.fr-BlwLS1Wy.js → choropleth-map-options.fr-YsTTCv_p.js} +1 -1
- package/components/{choropleth-map-options.nl-D70fr4Hl.js → choropleth-map-options.nl-CnEI0pYJ.js} +1 -1
- package/components/{choropleth-map-options.nl-BITK3ddz.cjs → choropleth-map-options.nl-CyDZDpyE.cjs} +1 -1
- package/components/{circular-gauge-options.config-Kd_WK_w-.js → circular-gauge-options.config-DAIjz4Rl.js} +59 -13
- package/components/circular-gauge-options.config-msZ4mfpN.cjs +20 -0
- package/components/{circular-gauge-options.de-BO3S8GCr.js → circular-gauge-options.de-BMzGTpZD.js} +3 -0
- package/components/{circular-gauge-options.de-BZfrQqs3.cjs → circular-gauge-options.de-CzEREduR.cjs} +1 -1
- package/components/{circular-gauge-options.en-CB-jZtE6.cjs → circular-gauge-options.en--hMYjiKb.cjs} +1 -1
- package/components/{circular-gauge-options.en-Cyhhijwg.js → circular-gauge-options.en-C6U5peDD.js} +3 -0
- package/components/{circular-gauge-options.es-DJ7ru4Wf.js → circular-gauge-options.es-Kajxp0wO.js} +5 -2
- package/components/{circular-gauge-options.es-DuQPHjcG.cjs → circular-gauge-options.es-bS5N1QyR.cjs} +1 -1
- package/components/{circular-gauge-options.fr-CFMa8H8K.cjs → circular-gauge-options.fr-VgkkhIDb.cjs} +1 -1
- package/components/{circular-gauge-options.fr-BVWliP7i.js → circular-gauge-options.fr-l5cqWrSS.js} +3 -0
- package/components/{circular-gauge-options.nl-BB_jgj5k.cjs → circular-gauge-options.nl-B-E_GXJl.cjs} +1 -1
- package/components/{circular-gauge-options.nl-DGpV7Riu.js → circular-gauge-options.nl-CAx8oTMs.js} +3 -0
- package/components/color-B6LaL8qz.cjs +20 -0
- package/components/color-DuJ4-73S.js +2867 -0
- package/components/color-palettes-BqH2Fv19.js +1852 -0
- package/components/color-palettes-DhNHcib8.cjs +20 -0
- package/components/color-range-utils-Bvo9sm5A.js +68 -0
- package/components/color-range-utils-C5yXW7ZC.cjs +20 -0
- package/components/{conditional-number-options.config-BzzAnCOB.js → conditional-number-options.config-BCEpSK9J.js} +68 -12
- package/components/conditional-number-options.config-DgzUo0xi.cjs +20 -0
- package/components/{conditional-number-options.de-BJcjBZY1.js → conditional-number-options.de-DbpKd1bd.js} +2 -2
- package/components/{conditional-number-options.de-CFnufi0r.cjs → conditional-number-options.de-R9Mtj45x.cjs} +1 -1
- package/components/{conditional-number-options.en-Wd-0YtdE.cjs → conditional-number-options.en-C-nOJ85m.cjs} +1 -1
- package/components/{conditional-number-options.en-WSrIzRGJ.js → conditional-number-options.en-DZH6utHH.js} +2 -2
- package/components/{conditional-number-options.es-BTDTe5SF.cjs → conditional-number-options.es-C41csR3J.cjs} +1 -1
- package/components/{conditional-number-options.es-BKqT0zog.js → conditional-number-options.es-_oKhivId.js} +2 -2
- package/components/{conditional-number-options.fr-D2r7Azy8.js → conditional-number-options.fr-BSSywulP.js} +2 -2
- package/components/{conditional-number-options.fr-CZ-9jzPm.cjs → conditional-number-options.fr-DgaXesnu.cjs} +1 -1
- package/components/{conditional-number-options.nl-pkRI1tLZ.js → conditional-number-options.nl-BuKNqxqm.js} +2 -2
- package/components/{conditional-number-options.nl-CfRYL6o1.cjs → conditional-number-options.nl-CJ5teRtT.cjs} +1 -1
- package/components/{date-filter-options.en-DqY3gH_W.cjs → date-filter-options.en-B7MjV7xe.cjs} +1 -1
- package/components/{date-filter-options.en-DgbZmD5M.js → date-filter-options.en-C0AmRz6f.js} +2 -1
- package/components/{date-filter-options.es-CQeWi9cD.cjs → date-filter-options.es-C__wCKac.cjs} +1 -1
- package/components/{date-filter-options.es-BI-h1lD-.js → date-filter-options.es-bN790adr.js} +4 -3
- package/components/{date-filter-options.fr-D22GM6_c.cjs → date-filter-options.fr-CFqwPRzc.cjs} +1 -1
- package/components/{date-filter-options.fr-DXLKLmhl.js → date-filter-options.fr-CNKTJNWh.js} +2 -1
- package/components/{date-filter-options.nl-CqZmwOux.cjs → date-filter-options.nl-CHOlmw93.cjs} +1 -1
- package/components/{date-filter-options.nl-DXgD8Ga_.js → date-filter-options.nl-ajUXG8Z4.js} +2 -1
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +1 -1
- package/components/display-settings-binning/index.cjs +1 -1
- package/components/display-settings-binning/index.js +4 -4
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +6 -6
- package/components/display-settings-grand-totals/index.cjs +1 -1
- package/components/display-settings-grand-totals/index.js +3 -3
- package/components/display-settings-numeric/index.cjs +1 -1
- package/components/display-settings-numeric/index.js +6 -6
- package/components/display-settings-period-over-period/index.cjs +6 -6
- package/components/display-settings-period-over-period/index.js +4 -4
- package/components/draggable-data-item-level/index.cjs +1 -1
- package/components/draggable-data-item-level/index.js +3 -3
- package/components/droppable-slot/index.cjs +1 -1
- package/components/droppable-slot/index.js +2 -2
- package/components/edit-item/index.cjs +2 -2
- package/components/edit-item/index.js +57 -57
- package/components/edit-option/helpers/control-templates/color-palette-picker-template.d.ts +2 -0
- package/components/edit-option/helpers/control-templates/color-range-template.d.ts +2 -0
- package/components/edit-option/helpers/get-enum-values.d.ts +1 -0
- package/components/edit-option/index.cjs +1 -1
- package/components/edit-option/index.js +1 -1
- package/components/edit-option-action-button-group/index.cjs +1 -1
- package/components/edit-option-action-button-group/index.js +5 -5
- package/components/edit-option-base/edit-option-base.d.ts +1 -0
- package/components/{edit-option-base-CbpBi6I7.js → edit-option-base-D25zHZVl.js} +12 -9
- package/components/{edit-option-base-Db3JjWMk.cjs → edit-option-base-h5ndfVK4.cjs} +3 -3
- package/components/edit-option-color-palette-picker/edit-option-color-palette-picker.d.ts +42 -0
- package/components/edit-option-color-palette-picker/index.cjs +79 -0
- package/components/edit-option-color-palette-picker/index.d.ts +7 -0
- package/components/edit-option-color-palette-picker/index.js +405 -0
- package/components/edit-option-color-picker/edit-option-color-picker.d.ts +5 -0
- package/components/edit-option-color-picker/index.cjs +2 -424
- package/components/edit-option-color-picker/index.js +49 -5653
- package/components/edit-option-color-range/edit-option-color-range.d.ts +99 -0
- package/components/edit-option-color-range/index.cjs +85 -0
- package/components/edit-option-color-range/index.d.ts +7 -0
- package/components/edit-option-color-range/index.js +261 -0
- package/components/edit-option-multi-language-field/index.cjs +1 -1
- package/components/edit-option-multi-language-field/index.js +2 -2
- package/components/edit-option-number-field/edit-option-number-field.d.ts +2 -0
- package/components/edit-option-number-field/index.cjs +7 -3
- package/components/edit-option-number-field/index.js +28 -17
- package/components/edit-option-picker/index.cjs +1 -1
- package/components/edit-option-picker/index.js +3 -3
- package/components/edit-option-position-picker/index.cjs +1 -1
- package/components/edit-option-position-picker/index.js +2 -2
- package/components/edit-option-positions-number-field/index.cjs +1 -1
- package/components/edit-option-positions-number-field/index.js +3 -3
- package/components/edit-option-radio-button-group/index.cjs +1 -1
- package/components/edit-option-radio-button-group/index.js +3 -3
- package/components/edit-option-slider/index.cjs +1 -1
- package/components/edit-option-slider/index.js +1 -1
- package/components/edit-option-switch/index.cjs +1 -1
- package/components/edit-option-switch/index.js +1 -1
- package/components/edit-option-text-field/index.cjs +1 -1
- package/components/edit-option-text-field/index.js +2 -2
- package/components/extrapolate-color-0j_AeYkz.cjs +20 -0
- package/components/extrapolate-color-CC9CURf6.js +33 -0
- package/components/filter-data-item-picker/index.cjs +1 -1
- package/components/filter-data-item-picker/index.js +4 -4
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +1 -1
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +1 -1
- package/components/filter-value-picker/index.cjs +1 -1
- package/components/filter-value-picker/index.js +1 -1
- package/components/filter-value-picker-datetime/index.cjs +1 -1
- package/components/filter-value-picker-datetime/index.js +9 -9
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +2 -2
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +2 -2
- package/components/grid/index.cjs +45 -45
- package/components/grid/index.js +2217 -5061
- package/components/heat-map-options.config-BQ-Afrbi.cjs +20 -0
- package/components/{heat-map-options.config-BAuSJV3_.js → heat-map-options.config-DQya-lag.js} +92 -13
- package/components/{heat-map-options.de-Cz5Pwwcu.cjs → heat-map-options.de-CCzVMy-R.cjs} +1 -1
- package/components/{heat-map-options.de-6onYsjdI.js → heat-map-options.de-UJbdYtlh.js} +4 -5
- package/components/{heat-map-options.en-DHX1GKcM.cjs → heat-map-options.en-Bg7i7QKn.cjs} +1 -1
- package/components/{heat-map-options.en-mwgrQFkO.js → heat-map-options.en-C0K0NGEE.js} +5 -5
- package/components/{heat-map-options.es-A-j6i3Tz.cjs → heat-map-options.es-BYyHRdIH.cjs} +1 -1
- package/components/{heat-map-options.es-Dd0KsseA.js → heat-map-options.es-DCUCh58R.js} +5 -5
- package/components/{heat-map-options.fr-C3LwETEg.cjs → heat-map-options.fr-CLB-XMRA.cjs} +1 -1
- package/components/{heat-map-options.fr-BkrrUt04.js → heat-map-options.fr-a-_Kw5S_.js} +5 -5
- package/components/{heat-map-options.nl-CXn1y4jH.cjs → heat-map-options.nl-BHrmi96k.cjs} +1 -1
- package/components/{heat-map-options.nl-DME6ILT5.js → heat-map-options.nl-BRGoOun2.js} +5 -5
- package/components/heat-table-options.config-B12JEYnp.cjs +20 -0
- package/components/{heat-table-options.config-DSu_18VG.js → heat-table-options.config-CUsDdgUr.js} +137 -21
- package/components/{heat-table-options.de-BABkUn2Y.js → heat-table-options.de-D6R0zXX0.js} +1 -1
- package/components/{heat-table-options.de-aYfCrdCP.cjs → heat-table-options.de-cnjPxQep.cjs} +1 -1
- package/components/{heat-table-options.en-CIdnDv3K.cjs → heat-table-options.en-Bjqpkm75.cjs} +1 -1
- package/components/{heat-table-options.en-BUBmMDZW.js → heat-table-options.en-Co6IDHlF.js} +1 -1
- package/components/{heat-table-options.es-Dl9D9rD_.js → heat-table-options.es-B3Kb8J1N.js} +1 -1
- package/components/{heat-table-options.es-DaK6qGQC.cjs → heat-table-options.es-IaNf_Ge4.cjs} +1 -1
- package/components/{heat-table-options.fr-BouHFs1P.cjs → heat-table-options.fr-BdZnJYlb.cjs} +1 -1
- package/components/{heat-table-options.fr-DOShw8a1.js → heat-table-options.fr-C51PmgHa.js} +1 -1
- package/components/{heat-table-options.nl-8CXDqKzS.cjs → heat-table-options.nl-DGS7vzoT.cjs} +1 -1
- package/components/{heat-table-options.nl-D6Fn7sgt.js → heat-table-options.nl-DXOd_uE6.js} +1 -1
- package/components/hexbin-map-options.config-DZERRhM8.cjs +20 -0
- package/components/{hexbin-map-options.config-DaaC88d8.js → hexbin-map-options.config-F-7uCqxb.js} +55 -20
- package/components/{hexbin-map-options.de-BuLxwJd2.js → hexbin-map-options.de-D50U2vgf.js} +1 -1
- package/components/{hexbin-map-options.de-DPYaSNHm.cjs → hexbin-map-options.de-DUp41p9I.cjs} +1 -1
- package/components/{hexbin-map-options.en-CEGMU7TX.cjs → hexbin-map-options.en-B10UanAQ.cjs} +1 -1
- package/components/{hexbin-map-options.en-CXV4sbbg.js → hexbin-map-options.en-iDuuqVpi.js} +1 -1
- package/components/{hexbin-map-options.es-urnYaXEk.cjs → hexbin-map-options.es-97IUVMSg.cjs} +1 -1
- package/components/{hexbin-map-options.es-2f7amcb6.js → hexbin-map-options.es-RRMQV0DY.js} +1 -1
- package/components/{hexbin-map-options.fr-DxRtJ3_F.cjs → hexbin-map-options.fr-Bh9Swyi3.cjs} +1 -1
- package/components/{hexbin-map-options.fr-J3g_JcSM.js → hexbin-map-options.fr-CQ7JbE9T.js} +1 -1
- package/components/{hexbin-map-options.nl-BnvrfMKQ.js → hexbin-map-options.nl-BpTRJ36m.js} +1 -1
- package/components/{hexbin-map-options.nl-GZtiTQw6.cjs → hexbin-map-options.nl-BzyMf0JQ.cjs} +1 -1
- package/components/{index-Tx5oQjbt.cjs → index--3gSNupB.cjs} +1 -1
- package/components/{index-CDpuEf8W.js → index-9LxnqLJa.js} +2 -2
- package/components/{index-MVmoiSxL.cjs → index-B7AFYrfv.cjs} +1 -1
- package/components/{index-CHFwXYcm.cjs → index-BKx2WhDB.cjs} +7 -7
- package/components/{index-cHKqEi5-.cjs → index-BSgp4MWQ.cjs} +1 -1
- package/components/{index-BHJH1eGn.js → index-BW3AUnEX.js} +1 -1
- package/components/index-BY1yDIAI.js +5672 -0
- package/components/index-Be-pSgzQ.js +174 -0
- package/components/{index-Bdy8Bz-n.js → index-BobhBKA2.js} +8 -7
- package/components/{index-CBOAQ3-E.cjs → index-Bpdwb9Js.cjs} +3 -3
- package/components/{index-BNCgbOV2.js → index-BqSQoHjg.js} +2 -2
- package/components/{index-EXO-Hsj2.cjs → index-BukPAqqU.cjs} +1 -1
- package/components/{index-Desl7GJ0.js → index-C6NpWavw.js} +3 -3
- package/components/{index-BC1LV3vH.js → index-COU9XhBt.js} +1 -1
- package/components/{index-ChDwMQlU.js → index-Cf_a7VrO.js} +12 -11
- package/components/{index-CnpJUw_z.cjs → index-CnP-Q5Bw.cjs} +1 -1
- package/components/index-DCdx3dxQ.cjs +42 -0
- package/components/index-DMhm0FM8.cjs +443 -0
- package/components/index-DRLFjkH0.cjs +249 -0
- package/components/{index-DE3d0E0P.js → index-DYmi-X87.js} +2 -2
- package/components/{index-CbuHBIDB.js → index-DeIay7ZE.js} +2 -2
- package/components/{index-Cw_HnduG.js → index-PGX2p9Ns.js} +4 -4
- package/components/{index-BqMMcuLX.cjs → index-VHrmgynd.cjs} +1 -1
- package/components/{index-CNA9joKT.cjs → index-cbfU96gS.cjs} +26 -26
- package/components/{index-DSQyBS9Z.cjs → index-fwJBhawL.cjs} +1 -1
- package/components/{index-DM0JWaVq.js → index-ydBgjAru.js} +560 -466
- package/components/index.cjs +1 -1
- package/components/index.js +62 -58
- package/components/{luzmo-icons-DnAqAQCX.js → luzmo-icons-4Tmb3sKr.js} +5 -5
- package/components/{luzmo-icons-DbwDQtuO-DSQ-uVxy.cjs → luzmo-icons-4nDFv1Lq-D6-m-VWM.cjs} +2 -2
- package/components/{luzmo-icons-DbwDQtuO-QG0fLECn.js → luzmo-icons-4nDFv1Lq-DffGNBpO.js} +7 -7
- package/components/mutation-controller-DH7YOCyj-B6sXpbgh.cjs +40 -0
- package/components/mutation-controller-DH7YOCyj-E7gpCmwh.js +71 -0
- package/components/{observe-slot-presence-CmVi0zTc-B4M1Mze7.cjs → observe-slot-presence-CmVi0zTc-NPSGFmv-.cjs} +2 -2
- package/components/{observe-slot-presence-CmVi0zTc-DCFuXW7v.js → observe-slot-presence-CmVi0zTc-hhUl4oRa.js} +5 -5
- package/components/observe-slot-text-BPfIQQtz-D4LmMIo0.cjs +66 -0
- package/components/observe-slot-text-BPfIQQtz-DLOwgi-A.js +172 -0
- package/components/route-map-options.config-CN86T7c0.js +346 -0
- package/components/route-map-options.config-D7NJePTu.cjs +20 -0
- package/components/{route-map-options.de-DrhHqbdy.js → route-map-options.de-DXYmUtv8.js} +20 -0
- package/components/{route-map-options.de-ey7CT_tQ.cjs → route-map-options.de-w5wuIvwf.cjs} +1 -1
- package/components/{route-map-options.en-DAgywIcY.js → route-map-options.en-CYMhTqyE.js} +20 -0
- package/components/{route-map-options.en-CjyQT-Ue.cjs → route-map-options.en-Co0Fbjkz.cjs} +1 -1
- package/components/{route-map-options.es-BR7NuBw0.js → route-map-options.es-BEBPlDvt.js} +20 -0
- package/components/{route-map-options.es-aEyX7m3t.cjs → route-map-options.es-Cjasm-ZQ.cjs} +1 -1
- package/components/{route-map-options.fr-42waILBL.cjs → route-map-options.fr-C1SCfKLH.cjs} +1 -1
- package/components/{route-map-options.fr-C7TkfcdY.js → route-map-options.fr-DEHQekgM.js} +20 -0
- package/components/{route-map-options.nl-X4lAer8J.cjs → route-map-options.nl-CYmB51pE.cjs} +1 -1
- package/components/{route-map-options.nl-Btd3mxx0.js → route-map-options.nl-CwUgb9Zg.js} +20 -0
- package/components/slot-contents-picker/index.cjs +1 -1
- package/components/slot-contents-picker/index.js +5 -5
- package/components/slot-menu/index.cjs +1 -1
- package/components/slot-menu/index.js +2 -2
- package/components/slot-menu-list/index.js +1 -1
- package/components/speedometer-chart-options.config-BX9LTQBH.cjs +20 -0
- package/components/speedometer-chart-options.config-SL581yOa.js +265 -0
- package/components/spike-map-options.config-C5KewecZ.js +436 -0
- package/components/spike-map-options.config-DoBFXPmN.cjs +20 -0
- package/components/{spike-map-options.de-BxTSDs6l.js → spike-map-options.de-COZovZ7s.js} +26 -0
- package/components/spike-map-options.de-_47BiyJQ.cjs +20 -0
- package/components/spike-map-options.en-B9InMjtg.cjs +20 -0
- package/components/{spike-map-options.en-C0DCu7ul.js → spike-map-options.en-Dx9h9SIj.js} +26 -0
- package/components/{spike-map-options.es-bTfVypDV.js → spike-map-options.es-CHMMXuMS.js} +26 -0
- package/components/spike-map-options.es-e-sVsx0P.cjs +20 -0
- package/components/{spike-map-options.fr-BKzDjsKP.js → spike-map-options.fr-BcRnMqG8.js} +26 -0
- package/components/spike-map-options.fr-DPpYI3Yd.cjs +20 -0
- package/components/spike-map-options.nl-DOJHgdzZ.cjs +20 -0
- package/components/{spike-map-options.nl-BGPuQRih.js → spike-map-options.nl-DSGG2M38.js} +26 -0
- package/components/{text-field-BIADXoLC-B9oE05VF.js → text-field-ol9Ed5lQ-DbpeM4EP.js} +1 -1
- package/components/{text-field-BIADXoLC-B8w9TVmS.cjs → text-field-ol9Ed5lQ-cRqtIf_0.cjs} +1 -1
- package/custom-elements.json +369 -2
- package/index.d.ts +2 -0
- package/item-definitions/box-plot/box-plot-options.config.d.ts +51 -0
- package/item-definitions/choropleth-map/choropleth-map-options.config.d.ts +125 -0
- package/item-definitions/choropleth-map/i18n/choropleth-map-options.de.d.ts +1 -1
- package/item-definitions/choropleth-map/i18n/choropleth-map-options.en.d.ts +1 -1
- package/item-definitions/choropleth-map/i18n/choropleth-map-options.es.d.ts +1 -1
- package/item-definitions/choropleth-map/i18n/choropleth-map-options.fr.d.ts +1 -1
- package/item-definitions/choropleth-map/i18n/choropleth-map-options.nl.d.ts +1 -1
- package/item-definitions/circular-gauge/circular-gauge-options.config.d.ts +94 -0
- package/item-definitions/circular-gauge/i18n/circular-gauge-options.de.d.ts +3 -0
- package/item-definitions/circular-gauge/i18n/circular-gauge-options.en.d.ts +3 -0
- package/item-definitions/circular-gauge/i18n/circular-gauge-options.es.d.ts +3 -0
- package/item-definitions/circular-gauge/i18n/circular-gauge-options.fr.d.ts +3 -0
- package/item-definitions/circular-gauge/i18n/circular-gauge-options.nl.d.ts +3 -0
- package/item-definitions/conditional-number/conditional-number-options.config.d.ts +106 -0
- package/item-definitions/conditional-number/i18n/conditional-number-options.de.d.ts +2 -2
- package/item-definitions/conditional-number/i18n/conditional-number-options.en.d.ts +2 -2
- package/item-definitions/conditional-number/i18n/conditional-number-options.es.d.ts +2 -2
- package/item-definitions/conditional-number/i18n/conditional-number-options.fr.d.ts +2 -2
- package/item-definitions/conditional-number/i18n/conditional-number-options.nl.d.ts +2 -2
- package/item-definitions/date-filter/i18n/date-filter-options.en.d.ts +1 -0
- package/item-definitions/date-filter/i18n/date-filter-options.es.d.ts +1 -0
- package/item-definitions/date-filter/i18n/date-filter-options.fr.d.ts +1 -0
- package/item-definitions/date-filter/i18n/date-filter-options.nl.d.ts +1 -0
- package/item-definitions/heat-map/heat-map-options.config.d.ts +89 -0
- package/item-definitions/heat-map/i18n/heat-map-options.de.d.ts +4 -5
- package/item-definitions/heat-map/i18n/heat-map-options.en.d.ts +5 -5
- package/item-definitions/heat-map/i18n/heat-map-options.es.d.ts +5 -5
- package/item-definitions/heat-map/i18n/heat-map-options.fr.d.ts +5 -5
- package/item-definitions/heat-map/i18n/heat-map-options.nl.d.ts +5 -5
- package/item-definitions/heat-table/heat-table-options.config.d.ts +90 -4
- package/item-definitions/heat-table/i18n/heat-table-options.de.d.ts +1 -1
- package/item-definitions/heat-table/i18n/heat-table-options.en.d.ts +1 -1
- package/item-definitions/heat-table/i18n/heat-table-options.es.d.ts +1 -1
- package/item-definitions/heat-table/i18n/heat-table-options.fr.d.ts +1 -1
- package/item-definitions/heat-table/i18n/heat-table-options.nl.d.ts +1 -1
- package/item-definitions/hexbin-map/hexbin-map-options.config.d.ts +55 -2
- package/item-definitions/hexbin-map/i18n/hexbin-map-options.de.d.ts +1 -1
- package/item-definitions/hexbin-map/i18n/hexbin-map-options.en.d.ts +1 -1
- package/item-definitions/hexbin-map/i18n/hexbin-map-options.es.d.ts +1 -1
- package/item-definitions/hexbin-map/i18n/hexbin-map-options.fr.d.ts +1 -1
- package/item-definitions/hexbin-map/i18n/hexbin-map-options.nl.d.ts +1 -1
- package/item-definitions/route-map/i18n/route-map-options.de.d.ts +20 -0
- package/item-definitions/route-map/i18n/route-map-options.en.d.ts +20 -0
- package/item-definitions/route-map/i18n/route-map-options.es.d.ts +20 -0
- package/item-definitions/route-map/i18n/route-map-options.fr.d.ts +20 -0
- package/item-definitions/route-map/i18n/route-map-options.nl.d.ts +20 -0
- package/item-definitions/route-map/route-map-options.config.d.ts +157 -0
- package/item-definitions/shared/color-range-utils.d.ts +22 -0
- package/item-definitions/speedometer-chart/speedometer-chart-options.config.d.ts +126 -0
- package/item-definitions/spike-map/i18n/spike-map-options.de.d.ts +26 -0
- package/item-definitions/spike-map/i18n/spike-map-options.en.d.ts +26 -0
- package/item-definitions/spike-map/i18n/spike-map-options.es.d.ts +26 -0
- package/item-definitions/spike-map/i18n/spike-map-options.fr.d.ts +26 -0
- package/item-definitions/spike-map/i18n/spike-map-options.nl.d.ts +26 -0
- package/item-definitions/spike-map/spike-map-options.config.d.ts +123 -0
- package/package.json +11 -1
- package/utils/color/color-palettes.d.ts +17 -0
- package/utils/color/extrapolate-color.d.ts +1 -0
- package/components/box-plot-options.config-DJz_kt-M.cjs +0 -20
- package/components/choropleth-map-options.config-CeKXtnYB.js +0 -249
- package/components/choropleth-map-options.config-CxUOg3pw.cjs +0 -20
- package/components/circular-gauge-options.config-Cz2TGR6X.cjs +0 -20
- package/components/conditional-number-options.config-BZfgdUGh.cjs +0 -20
- package/components/heat-map-options.config-DsUXxjN0.cjs +0 -20
- package/components/heat-table-options.config-DqPL2hIY.cjs +0 -20
- package/components/hexbin-map-options.config-B_KAcDYq.cjs +0 -20
- package/components/index-BNFpjvqX.cjs +0 -195
- package/components/index-C2PPSv8E.cjs +0 -42
- package/components/index-rQxtPaJl.js +0 -174
- package/components/observe-slot-text-BPfIQQtz-DHOh38Ve.cjs +0 -86
- package/components/observe-slot-text-BPfIQQtz-v6B-1BYh.js +0 -221
- package/components/route-map-options.config-CcQXPmjN.cjs +0 -20
- package/components/route-map-options.config-u0hQqmDh.js +0 -136
- package/components/speedometer-chart-options.config-CVsSjLmh.cjs +0 -20
- package/components/speedometer-chart-options.config-Dt2feQYV.js +0 -199
- package/components/spike-map-options.config-PpPPrsR2.cjs +0 -20
- package/components/spike-map-options.config-pdbV_vwg.js +0 -218
- package/components/spike-map-options.de-BW8YhDI8.cjs +0 -20
- package/components/spike-map-options.en-fNS4A50-.cjs +0 -20
- package/components/spike-map-options.es-I-obYF7j.cjs +0 -20
- package/components/spike-map-options.fr-DWA0ZZBQ.cjs +0 -20
- package/components/spike-map-options.nl-D5Wu6E5D.cjs +0 -20
@@ -0,0 +1,2867 @@
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
2
|
+
*
|
3
|
+
* Copyright © 2025 Luzmo
|
4
|
+
* All rights reserved.
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
7
|
+
* This license allows users with a current active Luzmo account
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
11
|
+
*
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
* SOFTWARE.
|
19
|
+
* */
|
20
|
+
var tr = Object.defineProperty;
|
21
|
+
var rr = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
22
|
+
var ve = (t, e, r) => rr(t, typeof e != "symbol" ? e + "" : e, r);
|
23
|
+
function L(t, e) {
|
24
|
+
let r = t.length;
|
25
|
+
Array.isArray(t[0]) || (t = [t]), Array.isArray(e[0]) || (e = e.map((i) => [i]));
|
26
|
+
let n = e[0].length, a = e[0].map((i, o) => e.map((l) => l[o])), s = t.map((i) => a.map((o) => {
|
27
|
+
let l = 0;
|
28
|
+
if (!Array.isArray(i)) {
|
29
|
+
for (let c of o)
|
30
|
+
l += i * c;
|
31
|
+
return l;
|
32
|
+
}
|
33
|
+
for (let c = 0; c < i.length; c++)
|
34
|
+
l += i[c] * (o[c] || 0);
|
35
|
+
return l;
|
36
|
+
}));
|
37
|
+
return r === 1 && (s = s[0]), n === 1 ? s.map((i) => i[0]) : s;
|
38
|
+
}
|
39
|
+
function ue(t) {
|
40
|
+
return D(t) === "string";
|
41
|
+
}
|
42
|
+
function D(t) {
|
43
|
+
return (Object.prototype.toString.call(t).match(/^\[object\s+(.*?)\]$/)[1] || "").toLowerCase();
|
44
|
+
}
|
45
|
+
function Re(t, { precision: e, unit: r }) {
|
46
|
+
return X(t) ? "none" : d0(t, e) + (r ?? "");
|
47
|
+
}
|
48
|
+
function X(t) {
|
49
|
+
return Number.isNaN(t) || t instanceof Number && (t == null ? void 0 : t.none);
|
50
|
+
}
|
51
|
+
function R(t) {
|
52
|
+
return X(t) ? 0 : t;
|
53
|
+
}
|
54
|
+
function d0(t, e) {
|
55
|
+
if (t === 0)
|
56
|
+
return 0;
|
57
|
+
let r = ~~t, n = 0;
|
58
|
+
r && e && (n = ~~Math.log10(Math.abs(r)) + 1);
|
59
|
+
const a = 10 ** (e - n);
|
60
|
+
return Math.floor(t * a + 0.5) / a;
|
61
|
+
}
|
62
|
+
const nr = {
|
63
|
+
deg: 1,
|
64
|
+
grad: 0.9,
|
65
|
+
rad: 180 / Math.PI,
|
66
|
+
turn: 360
|
67
|
+
};
|
68
|
+
function m0(t) {
|
69
|
+
if (!t)
|
70
|
+
return;
|
71
|
+
t = t.trim();
|
72
|
+
const e = /^([a-z]+)\((.+?)\)$/i, r = /^-?[\d.]+$/, n = /%|deg|g?rad|turn$/, a = /\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;
|
73
|
+
let s = t.match(e);
|
74
|
+
if (s) {
|
75
|
+
let i = [];
|
76
|
+
return s[2].replace(a, (o, l) => {
|
77
|
+
let c = l.match(n), u = l;
|
78
|
+
if (c) {
|
79
|
+
let f = c[0], h = u.slice(0, -f.length);
|
80
|
+
f === "%" ? (u = new Number(h / 100), u.type = "<percentage>") : (u = new Number(h * nr[f]), u.type = "<angle>", u.unit = f);
|
81
|
+
} else r.test(u) ? (u = new Number(u), u.type = "<number>") : u === "none" && (u = new Number(NaN), u.none = !0);
|
82
|
+
o.startsWith("/") && (u = u instanceof Number ? u : new Number(u), u.alpha = !0), typeof u == "object" && u instanceof Number && (u.raw = l), i.push(u);
|
83
|
+
}), {
|
84
|
+
name: s[1].toLowerCase(),
|
85
|
+
rawName: s[1],
|
86
|
+
rawArgs: s[2],
|
87
|
+
// An argument could be (as of css-color-4):
|
88
|
+
// a number, percentage, degrees (hue), ident (in color())
|
89
|
+
args: i
|
90
|
+
};
|
91
|
+
}
|
92
|
+
}
|
93
|
+
function g0(t) {
|
94
|
+
return t[t.length - 1];
|
95
|
+
}
|
96
|
+
function oe(t, e, r) {
|
97
|
+
return isNaN(t) ? e : isNaN(e) ? t : t + (e - t) * r;
|
98
|
+
}
|
99
|
+
function p0(t, e, r) {
|
100
|
+
return (r - t) / (e - t);
|
101
|
+
}
|
102
|
+
function Ve(t, e, r) {
|
103
|
+
return oe(e[0], e[1], p0(t[0], t[1], r));
|
104
|
+
}
|
105
|
+
function b0(t) {
|
106
|
+
return t.map((e) => e.split("|").map((r) => {
|
107
|
+
r = r.trim();
|
108
|
+
let n = r.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);
|
109
|
+
if (n) {
|
110
|
+
let a = new String(n[1]);
|
111
|
+
return a.range = [+n[2], +n[3]], a;
|
112
|
+
}
|
113
|
+
return r;
|
114
|
+
}));
|
115
|
+
}
|
116
|
+
function M0(t, e, r) {
|
117
|
+
return Math.max(Math.min(r, e), t);
|
118
|
+
}
|
119
|
+
function Ie(t, e) {
|
120
|
+
return Math.sign(t) === Math.sign(e) ? t : -t;
|
121
|
+
}
|
122
|
+
function k(t, e) {
|
123
|
+
return Ie(Math.abs(t) ** e, t);
|
124
|
+
}
|
125
|
+
function et(t, e) {
|
126
|
+
return e === 0 ? 0 : t / e;
|
127
|
+
}
|
128
|
+
function w0(t, e, r = 0, n = t.length) {
|
129
|
+
for (; r < n; ) {
|
130
|
+
const a = r + n >> 1;
|
131
|
+
t[a] < e ? r = a + 1 : n = a;
|
132
|
+
}
|
133
|
+
return r;
|
134
|
+
}
|
135
|
+
var ar = /* @__PURE__ */ Object.freeze({
|
136
|
+
__proto__: null,
|
137
|
+
bisectLeft: w0,
|
138
|
+
clamp: M0,
|
139
|
+
copySign: Ie,
|
140
|
+
interpolate: oe,
|
141
|
+
interpolateInv: p0,
|
142
|
+
isNone: X,
|
143
|
+
isString: ue,
|
144
|
+
last: g0,
|
145
|
+
mapRange: Ve,
|
146
|
+
multiplyMatrices: L,
|
147
|
+
parseCoordGrammar: b0,
|
148
|
+
parseFunction: m0,
|
149
|
+
serializeNumber: Re,
|
150
|
+
skipNone: R,
|
151
|
+
spow: k,
|
152
|
+
toPrecision: d0,
|
153
|
+
type: D,
|
154
|
+
zdiv: et
|
155
|
+
});
|
156
|
+
class sr {
|
157
|
+
add(e, r, n) {
|
158
|
+
if (typeof arguments[0] != "string") {
|
159
|
+
for (var e in arguments[0])
|
160
|
+
this.add(e, arguments[0][e], arguments[1]);
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
(Array.isArray(e) ? e : [e]).forEach(function(a) {
|
164
|
+
this[a] = this[a] || [], r && this[a][n ? "unshift" : "push"](r);
|
165
|
+
}, this);
|
166
|
+
}
|
167
|
+
run(e, r) {
|
168
|
+
this[e] = this[e] || [], this[e].forEach(function(n) {
|
169
|
+
n.call(r && r.context ? r.context : r, r);
|
170
|
+
});
|
171
|
+
}
|
172
|
+
}
|
173
|
+
const j = new sr();
|
174
|
+
var u0, f0, h0, v = {
|
175
|
+
gamut_mapping: "css",
|
176
|
+
precision: 5,
|
177
|
+
deltaE: "76",
|
178
|
+
// Default deltaE method
|
179
|
+
verbose: ((h0 = (f0 = (u0 = globalThis == null ? void 0 : globalThis.process) == null ? void 0 : u0.env) == null ? void 0 : f0.NODE_ENV) == null ? void 0 : h0.toLowerCase()) !== "test",
|
180
|
+
warn: function(e) {
|
181
|
+
var r, n;
|
182
|
+
this.verbose && ((n = (r = globalThis == null ? void 0 : globalThis.console) == null ? void 0 : r.warn) == null || n.call(r, e));
|
183
|
+
}
|
184
|
+
};
|
185
|
+
const B = {
|
186
|
+
// for compatibility, the four-digit chromaticity-derived ones everyone else uses
|
187
|
+
D50: [0.3457 / 0.3585, 1, (1 - 0.3457 - 0.3585) / 0.3585],
|
188
|
+
D65: [0.3127 / 0.329, 1, (1 - 0.3127 - 0.329) / 0.329]
|
189
|
+
};
|
190
|
+
function Ze(t) {
|
191
|
+
return Array.isArray(t) ? t : B[t];
|
192
|
+
}
|
193
|
+
function xe(t, e, r, n = {}) {
|
194
|
+
if (t = Ze(t), e = Ze(e), !t || !e)
|
195
|
+
throw new TypeError(`Missing white point to convert ${t ? "" : "from"}${!t && !e ? "/" : ""}${e ? "" : "to"}`);
|
196
|
+
if (t === e)
|
197
|
+
return r;
|
198
|
+
let a = { W1: t, W2: e, XYZ: r, options: n };
|
199
|
+
if (j.run("chromatic-adaptation-start", a), a.M || (a.W1 === B.D65 && a.W2 === B.D50 ? a.M = [
|
200
|
+
[1.0479297925449969, 0.022946870601609652, -0.05019226628920524],
|
201
|
+
[0.02962780877005599, 0.9904344267538799, -0.017073799063418826],
|
202
|
+
[-0.009243040646204504, 0.015055191490298152, 0.7518742814281371]
|
203
|
+
] : a.W1 === B.D50 && a.W2 === B.D65 && (a.M = [
|
204
|
+
[0.955473421488075, -0.02309845494876471, 0.06325924320057072],
|
205
|
+
[-0.0283697093338637, 1.0099953980813041, 0.021041441191917323],
|
206
|
+
[0.012314014864481998, -0.020507649298898964, 1.330365926242124]
|
207
|
+
])), j.run("chromatic-adaptation-end", a), a.M)
|
208
|
+
return L(a.M, a.XYZ);
|
209
|
+
throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.");
|
210
|
+
}
|
211
|
+
const ir = /* @__PURE__ */ new Set(["<number>", "<percentage>", "<angle>"]);
|
212
|
+
function dt(t, e, r, n) {
|
213
|
+
return Object.entries(t.coords).map(([s, i], o) => {
|
214
|
+
let l = e.coordGrammar[o], c = n[o], u = c == null ? void 0 : c.type, f;
|
215
|
+
if (c.none ? f = l.find((d) => ir.has(d)) : f = l.find((d) => d == u), !f) {
|
216
|
+
let d = i.name || s;
|
217
|
+
throw new TypeError(`${u ?? c.raw} not allowed for ${d} in ${r}()`);
|
218
|
+
}
|
219
|
+
let h = f.range;
|
220
|
+
u === "<percentage>" && (h || (h = [0, 1]));
|
221
|
+
let p = i.range || i.refRange;
|
222
|
+
return h && p && (n[o] = Ve(h, p, n[o])), f;
|
223
|
+
});
|
224
|
+
}
|
225
|
+
function y0(t, { meta: e } = {}) {
|
226
|
+
var n, a, s, i;
|
227
|
+
let r = { str: (n = String(t)) == null ? void 0 : n.trim() };
|
228
|
+
if (j.run("parse-start", r), r.color)
|
229
|
+
return r.color;
|
230
|
+
if (r.parsed = m0(r.str), r.parsed) {
|
231
|
+
let o = r.parsed.name;
|
232
|
+
if (o === "color") {
|
233
|
+
let l = r.parsed.args.shift(), c = l.startsWith("--") ? l.substring(2) : `--${l}`, u = [l, c], f = r.parsed.rawArgs.indexOf("/") > 0 ? r.parsed.args.pop() : 1;
|
234
|
+
for (let d of m.all) {
|
235
|
+
let g = d.getFormat("color");
|
236
|
+
if (g && (u.includes(g.id) || (a = g.ids) != null && a.filter((M) => u.includes(M)).length)) {
|
237
|
+
const M = Object.keys(d.coords).map((S, y) => r.parsed.args[y] || 0);
|
238
|
+
let _;
|
239
|
+
return g.coordGrammar && (_ = dt(d, g, "color", M)), e && Object.assign(e, { formatId: "color", types: _ }), g.id.startsWith("--") && !l.startsWith("--") && v.warn(`${d.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${g.id}) instead of color(${l}).`), l.startsWith("--") && !g.id.startsWith("--") && v.warn(`${d.name} is a standard space and supported in the CSS spec. Use color(${g.id}) instead of prefixed color(${l}).`), { spaceId: d.id, coords: M, alpha: f };
|
240
|
+
}
|
241
|
+
}
|
242
|
+
let h = "", p = l in m.registry ? l : c;
|
243
|
+
if (p in m.registry) {
|
244
|
+
let d = (i = (s = m.registry[p].formats) == null ? void 0 : s.color) == null ? void 0 : i.id;
|
245
|
+
d && (h = `Did you mean color(${d})?`);
|
246
|
+
}
|
247
|
+
throw new TypeError(`Cannot parse color(${l}). ` + (h || "Missing a plugin?"));
|
248
|
+
} else
|
249
|
+
for (let l of m.all) {
|
250
|
+
let c = l.getFormat(o);
|
251
|
+
if (c && c.type === "function") {
|
252
|
+
let u = 1;
|
253
|
+
(c.lastAlpha || g0(r.parsed.args).alpha) && (u = r.parsed.args.pop());
|
254
|
+
let f = r.parsed.args, h;
|
255
|
+
return c.coordGrammar && (h = dt(l, c, o, f)), e && Object.assign(e, { formatId: c.name, types: h }), {
|
256
|
+
spaceId: l.id,
|
257
|
+
coords: f,
|
258
|
+
alpha: u
|
259
|
+
};
|
260
|
+
}
|
261
|
+
}
|
262
|
+
} else
|
263
|
+
for (let o of m.all)
|
264
|
+
for (let l in o.formats) {
|
265
|
+
let c = o.formats[l];
|
266
|
+
if (c.type !== "custom" || c.test && !c.test(r.str))
|
267
|
+
continue;
|
268
|
+
let u = c.parse(r.str);
|
269
|
+
if (u)
|
270
|
+
return u.alpha ?? (u.alpha = 1), e && (e.formatId = l), u;
|
271
|
+
}
|
272
|
+
throw new TypeError(`Could not parse ${t} as a color. Missing a plugin?`);
|
273
|
+
}
|
274
|
+
function b(t) {
|
275
|
+
if (Array.isArray(t))
|
276
|
+
return t.map(b);
|
277
|
+
if (!t)
|
278
|
+
throw new TypeError("Empty color reference");
|
279
|
+
ue(t) && (t = y0(t));
|
280
|
+
let e = t.space || t.spaceId;
|
281
|
+
return e instanceof m || (t.space = m.get(e)), t.alpha === void 0 && (t.alpha = 1), t;
|
282
|
+
}
|
283
|
+
const or = 75e-6, I = class I {
|
284
|
+
constructor(e) {
|
285
|
+
var a;
|
286
|
+
this.id = e.id, this.name = e.name, this.base = e.base ? I.get(e.base) : null, this.aliases = e.aliases, this.base && (this.fromBase = e.fromBase, this.toBase = e.toBase);
|
287
|
+
let r = e.coords ?? this.base.coords;
|
288
|
+
for (let s in r)
|
289
|
+
"name" in r[s] || (r[s].name = s);
|
290
|
+
this.coords = r;
|
291
|
+
let n = e.white ?? this.base.white ?? "D65";
|
292
|
+
this.white = Ze(n), this.formats = e.formats ?? {};
|
293
|
+
for (let s in this.formats) {
|
294
|
+
let i = this.formats[s];
|
295
|
+
i.type || (i.type = "function"), i.name || (i.name = s);
|
296
|
+
}
|
297
|
+
(a = this.formats.color) != null && a.id || (this.formats.color = {
|
298
|
+
...this.formats.color ?? {},
|
299
|
+
id: e.cssId || this.id
|
300
|
+
}), e.gamutSpace ? this.gamutSpace = e.gamutSpace === "self" ? this : I.get(e.gamutSpace) : this.isPolar ? this.gamutSpace = this.base : this.gamutSpace = this, this.gamutSpace.isUnbounded && (this.inGamut = (s, i) => !0), this.referred = e.referred, Object.defineProperty(this, "path", {
|
301
|
+
value: lr(this).reverse(),
|
302
|
+
writable: !1,
|
303
|
+
enumerable: !0,
|
304
|
+
configurable: !0
|
305
|
+
}), j.run("colorspace-init-end", this);
|
306
|
+
}
|
307
|
+
inGamut(e, { epsilon: r = or } = {}) {
|
308
|
+
if (!this.equals(this.gamutSpace))
|
309
|
+
return e = this.to(this.gamutSpace, e), this.gamutSpace.inGamut(e, { epsilon: r });
|
310
|
+
let n = Object.values(this.coords);
|
311
|
+
return e.every((a, s) => {
|
312
|
+
let i = n[s];
|
313
|
+
if (i.type !== "angle" && i.range) {
|
314
|
+
if (Number.isNaN(a))
|
315
|
+
return !0;
|
316
|
+
let [o, l] = i.range;
|
317
|
+
return (o === void 0 || a >= o - r) && (l === void 0 || a <= l + r);
|
318
|
+
}
|
319
|
+
return !0;
|
320
|
+
});
|
321
|
+
}
|
322
|
+
get isUnbounded() {
|
323
|
+
return Object.values(this.coords).every((e) => !("range" in e));
|
324
|
+
}
|
325
|
+
get cssId() {
|
326
|
+
var e, r;
|
327
|
+
return ((r = (e = this.formats) == null ? void 0 : e.color) == null ? void 0 : r.id) || this.id;
|
328
|
+
}
|
329
|
+
get isPolar() {
|
330
|
+
for (let e in this.coords)
|
331
|
+
if (this.coords[e].type === "angle")
|
332
|
+
return !0;
|
333
|
+
return !1;
|
334
|
+
}
|
335
|
+
getFormat(e) {
|
336
|
+
if (typeof e == "object")
|
337
|
+
return e = mt(e, this), e;
|
338
|
+
let r;
|
339
|
+
return e === "default" ? r = Object.values(this.formats)[0] : r = this.formats[e], r ? (r = mt(r, this), r) : null;
|
340
|
+
}
|
341
|
+
/**
|
342
|
+
* Check if this color space is the same as another color space reference.
|
343
|
+
* Allows proxying color space objects and comparing color spaces with ids.
|
344
|
+
* @param {string | ColorSpace} space ColorSpace object or id to compare to
|
345
|
+
* @returns {boolean}
|
346
|
+
*/
|
347
|
+
equals(e) {
|
348
|
+
return e ? this === e || this.id === e || this.id === e.id : !1;
|
349
|
+
}
|
350
|
+
to(e, r) {
|
351
|
+
if (arguments.length === 1) {
|
352
|
+
const o = b(e);
|
353
|
+
[e, r] = [o.space, o.coords];
|
354
|
+
}
|
355
|
+
if (e = I.get(e), this.equals(e))
|
356
|
+
return r;
|
357
|
+
r = r.map((o) => Number.isNaN(o) ? 0 : o);
|
358
|
+
let n = this.path, a = e.path, s, i;
|
359
|
+
for (let o = 0; o < n.length && n[o].equals(a[o]); o++)
|
360
|
+
s = n[o], i = o;
|
361
|
+
if (!s)
|
362
|
+
throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);
|
363
|
+
for (let o = n.length - 1; o > i; o--)
|
364
|
+
r = n[o].toBase(r);
|
365
|
+
for (let o = i + 1; o < a.length; o++)
|
366
|
+
r = a[o].fromBase(r);
|
367
|
+
return r;
|
368
|
+
}
|
369
|
+
from(e, r) {
|
370
|
+
if (arguments.length === 1) {
|
371
|
+
const n = b(e);
|
372
|
+
[e, r] = [n.space, n.coords];
|
373
|
+
}
|
374
|
+
return e = I.get(e), e.to(this, r);
|
375
|
+
}
|
376
|
+
toString() {
|
377
|
+
return `${this.name} (${this.id})`;
|
378
|
+
}
|
379
|
+
getMinCoords() {
|
380
|
+
let e = [];
|
381
|
+
for (let r in this.coords) {
|
382
|
+
let n = this.coords[r], a = n.range || n.refRange;
|
383
|
+
e.push((a == null ? void 0 : a.min) ?? 0);
|
384
|
+
}
|
385
|
+
return e;
|
386
|
+
}
|
387
|
+
// Returns array of unique color spaces
|
388
|
+
static get all() {
|
389
|
+
return [...new Set(Object.values(I.registry))];
|
390
|
+
}
|
391
|
+
static register(e, r) {
|
392
|
+
if (arguments.length === 1 && (r = arguments[0], e = r.id), r = this.get(r), this.registry[e] && this.registry[e] !== r)
|
393
|
+
throw new Error(`Duplicate color space registration: '${e}'`);
|
394
|
+
if (this.registry[e] = r, arguments.length === 1 && r.aliases)
|
395
|
+
for (let n of r.aliases)
|
396
|
+
this.register(n, r);
|
397
|
+
return r;
|
398
|
+
}
|
399
|
+
/**
|
400
|
+
* Lookup ColorSpace object by name
|
401
|
+
* @param {ColorSpace | string} name
|
402
|
+
*/
|
403
|
+
static get(e, ...r) {
|
404
|
+
if (!e || e instanceof I)
|
405
|
+
return e;
|
406
|
+
if (D(e) === "string") {
|
407
|
+
let a = I.registry[e.toLowerCase()];
|
408
|
+
if (!a)
|
409
|
+
throw new TypeError(`No color space found with id = "${e}"`);
|
410
|
+
return a;
|
411
|
+
}
|
412
|
+
if (r.length)
|
413
|
+
return I.get(...r);
|
414
|
+
throw new TypeError(`${e} is not a valid color space`);
|
415
|
+
}
|
416
|
+
/**
|
417
|
+
* Get metadata about a coordinate of a color space
|
418
|
+
*
|
419
|
+
* @static
|
420
|
+
* @param {Array | string} ref
|
421
|
+
* @param {ColorSpace | string} [workingSpace]
|
422
|
+
* @return {Object}
|
423
|
+
*/
|
424
|
+
static resolveCoord(e, r) {
|
425
|
+
var l;
|
426
|
+
let n = D(e), a, s;
|
427
|
+
if (n === "string" ? e.includes(".") ? [a, s] = e.split(".") : [a, s] = [, e] : Array.isArray(e) ? [a, s] = e : (a = e.space, s = e.coordId), a = I.get(a), a || (a = r), !a)
|
428
|
+
throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);
|
429
|
+
if (n = D(s), n === "number" || n === "string" && s >= 0) {
|
430
|
+
let c = Object.entries(a.coords)[s];
|
431
|
+
if (c)
|
432
|
+
return { space: a, id: c[0], index: s, ...c[1] };
|
433
|
+
}
|
434
|
+
a = I.get(a);
|
435
|
+
let i = s.toLowerCase(), o = 0;
|
436
|
+
for (let c in a.coords) {
|
437
|
+
let u = a.coords[c];
|
438
|
+
if (c.toLowerCase() === i || ((l = u.name) == null ? void 0 : l.toLowerCase()) === i)
|
439
|
+
return { space: a, id: c, index: o, ...u };
|
440
|
+
o++;
|
441
|
+
}
|
442
|
+
throw new TypeError(`No "${s}" coordinate found in ${a.name}. Its coordinates are: ${Object.keys(a.coords).join(", ")}`);
|
443
|
+
}
|
444
|
+
};
|
445
|
+
ve(I, "registry", {}), ve(I, "DEFAULT_FORMAT", {
|
446
|
+
type: "functions",
|
447
|
+
name: "color"
|
448
|
+
});
|
449
|
+
let m = I;
|
450
|
+
function lr(t) {
|
451
|
+
let e = [t];
|
452
|
+
for (let r = t; r = r.base; )
|
453
|
+
e.push(r);
|
454
|
+
return e;
|
455
|
+
}
|
456
|
+
function mt(t, { coords: e } = {}) {
|
457
|
+
if (t.coords && !t.coordGrammar) {
|
458
|
+
t.type || (t.type = "function"), t.name || (t.name = "color"), t.coordGrammar = b0(t.coords);
|
459
|
+
let r = Object.entries(e).map(([n, a], s) => {
|
460
|
+
let i = t.coordGrammar[s][0], o = a.range || a.refRange, l = i.range, c = "";
|
461
|
+
return i == "<percentage>" ? (l = [0, 100], c = "%") : i == "<angle>" && (c = "deg"), { fromRange: o, toRange: l, suffix: c };
|
462
|
+
});
|
463
|
+
t.serializeCoords = (n, a) => n.map((s, i) => {
|
464
|
+
let { fromRange: o, toRange: l, suffix: c } = r[i];
|
465
|
+
return o && l && (s = Ve(o, l, s)), s = Re(s, { precision: a, unit: c }), s;
|
466
|
+
});
|
467
|
+
}
|
468
|
+
return t;
|
469
|
+
}
|
470
|
+
var N = new m({
|
471
|
+
id: "xyz-d65",
|
472
|
+
name: "XYZ D65",
|
473
|
+
coords: {
|
474
|
+
x: { name: "X" },
|
475
|
+
y: { name: "Y" },
|
476
|
+
z: { name: "Z" }
|
477
|
+
},
|
478
|
+
white: "D65",
|
479
|
+
formats: {
|
480
|
+
color: {
|
481
|
+
ids: ["xyz-d65", "xyz"]
|
482
|
+
}
|
483
|
+
},
|
484
|
+
aliases: ["xyz"]
|
485
|
+
});
|
486
|
+
class z extends m {
|
487
|
+
/**
|
488
|
+
* Creates a new RGB ColorSpace.
|
489
|
+
* If coords are not specified, they will use the default RGB coords.
|
490
|
+
* Instead of `fromBase()` and `toBase()` functions,
|
491
|
+
* you can specify to/from XYZ matrices and have `toBase()` and `fromBase()` automatically generated.
|
492
|
+
* @param {*} options - Same options as {@link ColorSpace} plus:
|
493
|
+
* @param {number[][]} options.toXYZ_M - Matrix to convert to XYZ
|
494
|
+
* @param {number[][]} options.fromXYZ_M - Matrix to convert from XYZ
|
495
|
+
*/
|
496
|
+
constructor(e) {
|
497
|
+
e.coords || (e.coords = {
|
498
|
+
r: {
|
499
|
+
range: [0, 1],
|
500
|
+
name: "Red"
|
501
|
+
},
|
502
|
+
g: {
|
503
|
+
range: [0, 1],
|
504
|
+
name: "Green"
|
505
|
+
},
|
506
|
+
b: {
|
507
|
+
range: [0, 1],
|
508
|
+
name: "Blue"
|
509
|
+
}
|
510
|
+
}), e.base || (e.base = N), e.toXYZ_M && e.fromXYZ_M && (e.toBase ?? (e.toBase = (r) => {
|
511
|
+
let n = L(e.toXYZ_M, r);
|
512
|
+
return this.white !== this.base.white && (n = xe(this.white, this.base.white, n)), n;
|
513
|
+
}), e.fromBase ?? (e.fromBase = (r) => (r = xe(this.base.white, this.white, r), L(e.fromXYZ_M, r)))), e.referred ?? (e.referred = "display"), super(e);
|
514
|
+
}
|
515
|
+
}
|
516
|
+
function fe(t, e) {
|
517
|
+
return t = b(t), !e || t.space.equals(e) ? t.coords.slice() : (e = m.get(e), e.from(t));
|
518
|
+
}
|
519
|
+
function P(t, e) {
|
520
|
+
t = b(t);
|
521
|
+
let { space: r, index: n } = m.resolveCoord(e, t.space);
|
522
|
+
return fe(t, r)[n];
|
523
|
+
}
|
524
|
+
function tt(t, e, r) {
|
525
|
+
return t = b(t), e = m.get(e), t.coords = e.to(t.space, r), t;
|
526
|
+
}
|
527
|
+
tt.returns = "color";
|
528
|
+
function O(t, e, r) {
|
529
|
+
if (t = b(t), arguments.length === 2 && D(arguments[1]) === "object") {
|
530
|
+
let n = arguments[1];
|
531
|
+
for (let a in n)
|
532
|
+
O(t, a, n[a]);
|
533
|
+
} else {
|
534
|
+
typeof r == "function" && (r = r(P(t, e)));
|
535
|
+
let { space: n, index: a } = m.resolveCoord(e, t.space), s = fe(t, n);
|
536
|
+
s[a] = r, tt(t, n, s);
|
537
|
+
}
|
538
|
+
return t;
|
539
|
+
}
|
540
|
+
O.returns = "color";
|
541
|
+
var rt = new m({
|
542
|
+
id: "xyz-d50",
|
543
|
+
name: "XYZ D50",
|
544
|
+
white: "D50",
|
545
|
+
base: N,
|
546
|
+
fromBase: (t) => xe(N.white, "D50", t),
|
547
|
+
toBase: (t) => xe("D50", N.white, t)
|
548
|
+
});
|
549
|
+
const cr = 216 / 24389, gt = 24 / 116, pe = 24389 / 27;
|
550
|
+
let Ae = B.D50;
|
551
|
+
var E = new m({
|
552
|
+
id: "lab",
|
553
|
+
name: "Lab",
|
554
|
+
coords: {
|
555
|
+
l: {
|
556
|
+
refRange: [0, 100],
|
557
|
+
name: "Lightness"
|
558
|
+
},
|
559
|
+
a: {
|
560
|
+
refRange: [-125, 125]
|
561
|
+
},
|
562
|
+
b: {
|
563
|
+
refRange: [-125, 125]
|
564
|
+
}
|
565
|
+
},
|
566
|
+
// Assuming XYZ is relative to D50, convert to CIE Lab
|
567
|
+
// from CIE standard, which now defines these as a rational fraction
|
568
|
+
white: Ae,
|
569
|
+
base: rt,
|
570
|
+
// Convert D50-adapted XYX to Lab
|
571
|
+
// CIE 15.3:2004 section 8.2.1.1
|
572
|
+
fromBase(t) {
|
573
|
+
let r = t.map((n, a) => n / Ae[a]).map((n) => n > cr ? Math.cbrt(n) : (pe * n + 16) / 116);
|
574
|
+
return [
|
575
|
+
116 * r[1] - 16,
|
576
|
+
// L
|
577
|
+
500 * (r[0] - r[1]),
|
578
|
+
// a
|
579
|
+
200 * (r[1] - r[2])
|
580
|
+
// b
|
581
|
+
];
|
582
|
+
},
|
583
|
+
// Convert Lab to D50-adapted XYZ
|
584
|
+
// Same result as CIE 15.3:2004 Appendix D although the derivation is different
|
585
|
+
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
|
586
|
+
toBase(t) {
|
587
|
+
let e = [];
|
588
|
+
return e[1] = (t[0] + 16) / 116, e[0] = t[1] / 500 + e[1], e[2] = e[1] - t[2] / 200, [
|
589
|
+
e[0] > gt ? Math.pow(e[0], 3) : (116 * e[0] - 16) / pe,
|
590
|
+
t[0] > 8 ? Math.pow((t[0] + 16) / 116, 3) : t[0] / pe,
|
591
|
+
e[2] > gt ? Math.pow(e[2], 3) : (116 * e[2] - 16) / pe
|
592
|
+
].map((n, a) => n * Ae[a]);
|
593
|
+
},
|
594
|
+
formats: {
|
595
|
+
lab: {
|
596
|
+
coords: ["<number> | <percentage>", "<number> | <percentage>[-1,1]", "<number> | <percentage>[-1,1]"]
|
597
|
+
}
|
598
|
+
}
|
599
|
+
});
|
600
|
+
function H(t) {
|
601
|
+
return (t % 360 + 360) % 360;
|
602
|
+
}
|
603
|
+
function ur(t, e) {
|
604
|
+
if (t === "raw")
|
605
|
+
return e;
|
606
|
+
let [r, n] = e.map(H), a = n - r;
|
607
|
+
return t === "increasing" ? a < 0 && (n += 360) : t === "decreasing" ? a > 0 && (r += 360) : t === "longer" ? -180 < a && a < 180 && (a > 0 ? r += 360 : n += 360) : t === "shorter" && (a > 180 ? r += 360 : a < -180 && (n += 360)), [r, n];
|
608
|
+
}
|
609
|
+
var le = new m({
|
610
|
+
id: "lch",
|
611
|
+
name: "LCH",
|
612
|
+
coords: {
|
613
|
+
l: {
|
614
|
+
refRange: [0, 100],
|
615
|
+
name: "Lightness"
|
616
|
+
},
|
617
|
+
c: {
|
618
|
+
refRange: [0, 150],
|
619
|
+
name: "Chroma"
|
620
|
+
},
|
621
|
+
h: {
|
622
|
+
refRange: [0, 360],
|
623
|
+
type: "angle",
|
624
|
+
name: "Hue"
|
625
|
+
}
|
626
|
+
},
|
627
|
+
base: E,
|
628
|
+
fromBase(t) {
|
629
|
+
let [e, r, n] = t, a;
|
630
|
+
const s = 0.02;
|
631
|
+
return Math.abs(r) < s && Math.abs(n) < s ? a = NaN : a = Math.atan2(n, r) * 180 / Math.PI, [
|
632
|
+
e,
|
633
|
+
// L is still L
|
634
|
+
Math.sqrt(r ** 2 + n ** 2),
|
635
|
+
// Chroma
|
636
|
+
H(a)
|
637
|
+
// Hue, in degrees [0 to 360)
|
638
|
+
];
|
639
|
+
},
|
640
|
+
toBase(t) {
|
641
|
+
let [e, r, n] = t;
|
642
|
+
return r < 0 && (r = 0), isNaN(n) && (n = 0), [
|
643
|
+
e,
|
644
|
+
// L is still L
|
645
|
+
r * Math.cos(n * Math.PI / 180),
|
646
|
+
// a
|
647
|
+
r * Math.sin(n * Math.PI / 180)
|
648
|
+
// b
|
649
|
+
];
|
650
|
+
},
|
651
|
+
formats: {
|
652
|
+
lch: {
|
653
|
+
coords: ["<number> | <percentage>", "<number> | <percentage>", "<number> | <angle>"]
|
654
|
+
}
|
655
|
+
}
|
656
|
+
});
|
657
|
+
const pt = 25 ** 7, Ne = Math.PI, bt = 180 / Ne, F = Ne / 180;
|
658
|
+
function Mt(t) {
|
659
|
+
const e = t * t;
|
660
|
+
return e * e * e * t;
|
661
|
+
}
|
662
|
+
function C0(t, e, { kL: r = 1, kC: n = 1, kH: a = 1 } = {}) {
|
663
|
+
[t, e] = b([t, e]);
|
664
|
+
let [s, i, o] = E.from(t), l = le.from(E, [s, i, o])[1], [c, u, f] = E.from(e), h = le.from(E, [c, u, f])[1];
|
665
|
+
l < 0 && (l = 0), h < 0 && (h = 0);
|
666
|
+
let p = (l + h) / 2, d = Mt(p), g = 0.5 * (1 - Math.sqrt(d / (d + pt))), M = (1 + g) * i, _ = (1 + g) * u, S = Math.sqrt(M ** 2 + o ** 2), y = Math.sqrt(_ ** 2 + f ** 2), $ = M === 0 && o === 0 ? 0 : Math.atan2(o, M), Y = _ === 0 && f === 0 ? 0 : Math.atan2(f, _);
|
667
|
+
$ < 0 && ($ += 2 * Ne), Y < 0 && (Y += 2 * Ne), $ *= bt, Y *= bt;
|
668
|
+
let de = c - s, me = y - S, A = Y - $, re = $ + Y, ot = Math.abs(A), ne;
|
669
|
+
S * y === 0 ? ne = 0 : ot <= 180 ? ne = A : A > 180 ? ne = A - 360 : A < -180 ? ne = A + 360 : v.warn("the unthinkable has happened");
|
670
|
+
let lt = 2 * Math.sqrt(y * S) * Math.sin(ne * F / 2), Q0 = (s + c) / 2, Ee = (S + y) / 2, ct = Mt(Ee), T;
|
671
|
+
S * y === 0 ? T = re : ot <= 180 ? T = re / 2 : re < 360 ? T = (re + 360) / 2 : T = (re - 360) / 2;
|
672
|
+
let ut = (Q0 - 50) ** 2, U0 = 1 + 0.015 * ut / Math.sqrt(20 + ut), ft = 1 + 0.045 * Ee, ae = 1;
|
673
|
+
ae -= 0.17 * Math.cos((T - 30) * F), ae += 0.24 * Math.cos(2 * T * F), ae += 0.32 * Math.cos((3 * T + 6) * F), ae -= 0.2 * Math.cos((4 * T - 63) * F);
|
674
|
+
let ht = 1 + 0.015 * Ee * ae, K0 = 30 * Math.exp(-1 * ((T - 275) / 25) ** 2), V0 = 2 * Math.sqrt(ct / (ct + pt)), er = -1 * Math.sin(2 * K0 * F) * V0, ge = (de / (r * U0)) ** 2;
|
675
|
+
return ge += (me / (n * ft)) ** 2, ge += (lt / (a * ht)) ** 2, ge += er * (me / (n * ft)) * (lt / (a * ht)), Math.sqrt(ge);
|
676
|
+
}
|
677
|
+
const fr = [
|
678
|
+
[0.819022437996703, 0.3619062600528904, -0.1288737815209879],
|
679
|
+
[0.0329836539323885, 0.9292868615863434, 0.0361446663506424],
|
680
|
+
[0.0481771893596242, 0.2642395317527308, 0.6335478284694309]
|
681
|
+
], hr = [
|
682
|
+
[1.2268798758459243, -0.5578149944602171, 0.2813910456659647],
|
683
|
+
[-0.0405757452148008, 1.112286803280317, -0.0717110580655164],
|
684
|
+
[-0.0763729366746601, -0.4214933324022432, 1.5869240198367816]
|
685
|
+
], dr = [
|
686
|
+
[0.210454268309314, 0.7936177747023054, -0.0040720430116193],
|
687
|
+
[1.9779985324311684, -2.42859224204858, 0.450593709617411],
|
688
|
+
[0.0259040424655478, 0.7827717124575296, -0.8086757549230774]
|
689
|
+
], mr = [
|
690
|
+
[1, 0.3963377773761749, 0.2158037573099136],
|
691
|
+
[1, -0.1055613458156586, -0.0638541728258133],
|
692
|
+
[1, -0.0894841775298119, -1.2914855480194092]
|
693
|
+
];
|
694
|
+
var K = new m({
|
695
|
+
id: "oklab",
|
696
|
+
name: "Oklab",
|
697
|
+
coords: {
|
698
|
+
l: {
|
699
|
+
refRange: [0, 1],
|
700
|
+
name: "Lightness"
|
701
|
+
},
|
702
|
+
a: {
|
703
|
+
refRange: [-0.4, 0.4]
|
704
|
+
},
|
705
|
+
b: {
|
706
|
+
refRange: [-0.4, 0.4]
|
707
|
+
}
|
708
|
+
},
|
709
|
+
// Note that XYZ is relative to D65
|
710
|
+
white: "D65",
|
711
|
+
base: N,
|
712
|
+
fromBase(t) {
|
713
|
+
let r = L(fr, t).map((n) => Math.cbrt(n));
|
714
|
+
return L(dr, r);
|
715
|
+
},
|
716
|
+
toBase(t) {
|
717
|
+
let r = L(mr, t).map((n) => n ** 3);
|
718
|
+
return L(hr, r);
|
719
|
+
},
|
720
|
+
formats: {
|
721
|
+
oklab: {
|
722
|
+
coords: ["<percentage> | <number>", "<number> | <percentage>[-1,1]", "<number> | <percentage>[-1,1]"]
|
723
|
+
}
|
724
|
+
}
|
725
|
+
});
|
726
|
+
function Ge(t, e) {
|
727
|
+
[t, e] = b([t, e]);
|
728
|
+
let [r, n, a] = K.from(t), [s, i, o] = K.from(e), l = r - s, c = n - i, u = a - o;
|
729
|
+
return Math.sqrt(l ** 2 + c ** 2 + u ** 2);
|
730
|
+
}
|
731
|
+
const gr = 75e-6;
|
732
|
+
function J(t, e, { epsilon: r = gr } = {}) {
|
733
|
+
t = b(t), e || (e = t.space), e = m.get(e);
|
734
|
+
let n = t.coords;
|
735
|
+
return e !== t.space && (n = e.from(t)), e.inGamut(n, { epsilon: r });
|
736
|
+
}
|
737
|
+
function V(t) {
|
738
|
+
return {
|
739
|
+
space: t.space,
|
740
|
+
coords: t.coords.slice(),
|
741
|
+
alpha: t.alpha
|
742
|
+
};
|
743
|
+
}
|
744
|
+
function L0(t, e, r = "lab") {
|
745
|
+
r = m.get(r);
|
746
|
+
let n = r.from(t), a = r.from(e);
|
747
|
+
return Math.sqrt(n.reduce((s, i, o) => {
|
748
|
+
let l = a[o];
|
749
|
+
return isNaN(i) || isNaN(l) ? s : s + (l - i) ** 2;
|
750
|
+
}, 0));
|
751
|
+
}
|
752
|
+
function pr(t, e) {
|
753
|
+
return L0(t, e, "lab");
|
754
|
+
}
|
755
|
+
const br = Math.PI, wt = br / 180;
|
756
|
+
function Mr(t, e, { l: r = 2, c: n = 1 } = {}) {
|
757
|
+
[t, e] = b([t, e]);
|
758
|
+
let [a, s, i] = E.from(t), [, o, l] = le.from(E, [a, s, i]), [c, u, f] = E.from(e), h = le.from(E, [c, u, f])[1];
|
759
|
+
o < 0 && (o = 0), h < 0 && (h = 0);
|
760
|
+
let p = a - c, d = o - h, g = s - u, M = i - f, _ = g ** 2 + M ** 2 - d ** 2, S = 0.511;
|
761
|
+
a >= 16 && (S = 0.040975 * a / (1 + 0.01765 * a));
|
762
|
+
let y = 0.0638 * o / (1 + 0.0131 * o) + 0.638, $;
|
763
|
+
Number.isNaN(l) && (l = 0), l >= 164 && l <= 345 ? $ = 0.56 + Math.abs(0.2 * Math.cos((l + 168) * wt)) : $ = 0.36 + Math.abs(0.4 * Math.cos((l + 35) * wt));
|
764
|
+
let Y = Math.pow(o, 4), de = Math.sqrt(Y / (Y + 1900)), me = y * (de * $ + 1 - de), A = (p / (r * S)) ** 2;
|
765
|
+
return A += (d / (n * y)) ** 2, A += _ / me ** 2, Math.sqrt(A);
|
766
|
+
}
|
767
|
+
const yt = 203;
|
768
|
+
var nt = new m({
|
769
|
+
// Absolute CIE XYZ, with a D65 whitepoint,
|
770
|
+
// as used in most HDR colorspaces as a starting point.
|
771
|
+
// SDR spaces are converted per BT.2048
|
772
|
+
// so that diffuse, media white is 203 cd/m²
|
773
|
+
id: "xyz-abs-d65",
|
774
|
+
cssId: "--xyz-abs-d65",
|
775
|
+
name: "Absolute XYZ D65",
|
776
|
+
coords: {
|
777
|
+
x: {
|
778
|
+
refRange: [0, 9504.7],
|
779
|
+
name: "Xa"
|
780
|
+
},
|
781
|
+
y: {
|
782
|
+
refRange: [0, 1e4],
|
783
|
+
name: "Ya"
|
784
|
+
},
|
785
|
+
z: {
|
786
|
+
refRange: [0, 10888.3],
|
787
|
+
name: "Za"
|
788
|
+
}
|
789
|
+
},
|
790
|
+
base: N,
|
791
|
+
fromBase(t) {
|
792
|
+
return t.map((e) => Math.max(e * yt, 0));
|
793
|
+
},
|
794
|
+
toBase(t) {
|
795
|
+
return t.map((e) => Math.max(e / yt, 0));
|
796
|
+
}
|
797
|
+
});
|
798
|
+
const be = 1.15, Me = 0.66, Ct = 2610 / 2 ** 14, wr = 2 ** 14 / 2610, Lt = 3424 / 2 ** 12, St = 2413 / 2 ** 7, _t = 2392 / 2 ** 7, yr = 1.7 * 2523 / 2 ** 5, Rt = 2 ** 5 / (1.7 * 2523), we = -0.56, ke = 16295499532821565e-27, Cr = [
|
799
|
+
[0.41478972, 0.579999, 0.014648],
|
800
|
+
[-0.20151, 1.120649, 0.0531008],
|
801
|
+
[-0.0166008, 0.2648, 0.6684799]
|
802
|
+
], Lr = [
|
803
|
+
[1.9242264357876067, -1.0047923125953657, 0.037651404030618],
|
804
|
+
[0.35031676209499907, 0.7264811939316552, -0.06538442294808501],
|
805
|
+
[-0.09098281098284752, -0.3127282905230739, 1.5227665613052603]
|
806
|
+
], Sr = [
|
807
|
+
[0.5, 0.5, 0],
|
808
|
+
[3.524, -4.066708, 0.542708],
|
809
|
+
[0.199076, 1.096799, -1.295875]
|
810
|
+
], _r = [
|
811
|
+
[1, 0.1386050432715393, 0.05804731615611886],
|
812
|
+
[0.9999999999999999, -0.1386050432715393, -0.05804731615611886],
|
813
|
+
[0.9999999999999998, -0.09601924202631895, -0.8118918960560388]
|
814
|
+
];
|
815
|
+
var S0 = new m({
|
816
|
+
id: "jzazbz",
|
817
|
+
name: "Jzazbz",
|
818
|
+
coords: {
|
819
|
+
jz: {
|
820
|
+
refRange: [0, 1],
|
821
|
+
name: "Jz"
|
822
|
+
},
|
823
|
+
az: {
|
824
|
+
refRange: [-0.5, 0.5]
|
825
|
+
},
|
826
|
+
bz: {
|
827
|
+
refRange: [-0.5, 0.5]
|
828
|
+
}
|
829
|
+
},
|
830
|
+
base: nt,
|
831
|
+
fromBase(t) {
|
832
|
+
let [e, r, n] = t, a = be * e - (be - 1) * n, s = Me * r - (Me - 1) * e, o = L(Cr, [a, s, n]).map(function(h) {
|
833
|
+
let p = Lt + St * (h / 1e4) ** Ct, d = 1 + _t * (h / 1e4) ** Ct;
|
834
|
+
return (p / d) ** yr;
|
835
|
+
}), [l, c, u] = L(Sr, o);
|
836
|
+
return [(1 + we) * l / (1 + we * l) - ke, c, u];
|
837
|
+
},
|
838
|
+
toBase(t) {
|
839
|
+
let [e, r, n] = t, a = (e + ke) / (1 + we - we * (e + ke)), i = L(_r, [a, r, n]).map(function(h) {
|
840
|
+
let p = Lt - h ** Rt, d = _t * h ** Rt - St;
|
841
|
+
return 1e4 * (p / d) ** wr;
|
842
|
+
}), [o, l, c] = L(Lr, i), u = (o + (be - 1) * c) / be, f = (l + (Me - 1) * u) / Me;
|
843
|
+
return [u, f, c];
|
844
|
+
},
|
845
|
+
formats: {
|
846
|
+
// https://drafts.csswg.org/css-color-hdr/#Jzazbz
|
847
|
+
color: {
|
848
|
+
coords: ["<number> | <percentage>", "<number> | <percentage>[-1,1]", "<number> | <percentage>[-1,1]"]
|
849
|
+
}
|
850
|
+
}
|
851
|
+
}), Je = new m({
|
852
|
+
id: "jzczhz",
|
853
|
+
name: "JzCzHz",
|
854
|
+
coords: {
|
855
|
+
jz: {
|
856
|
+
refRange: [0, 1],
|
857
|
+
name: "Jz"
|
858
|
+
},
|
859
|
+
cz: {
|
860
|
+
refRange: [0, 1],
|
861
|
+
name: "Chroma"
|
862
|
+
},
|
863
|
+
hz: {
|
864
|
+
refRange: [0, 360],
|
865
|
+
type: "angle",
|
866
|
+
name: "Hue"
|
867
|
+
}
|
868
|
+
},
|
869
|
+
base: S0,
|
870
|
+
fromBase(t) {
|
871
|
+
let [e, r, n] = t, a;
|
872
|
+
const s = 2e-4;
|
873
|
+
return Math.abs(r) < s && Math.abs(n) < s ? a = NaN : a = Math.atan2(n, r) * 180 / Math.PI, [
|
874
|
+
e,
|
875
|
+
// Jz is still Jz
|
876
|
+
Math.sqrt(r ** 2 + n ** 2),
|
877
|
+
// Chroma
|
878
|
+
H(a)
|
879
|
+
// Hue, in degrees [0 to 360)
|
880
|
+
];
|
881
|
+
},
|
882
|
+
toBase(t) {
|
883
|
+
return [
|
884
|
+
t[0],
|
885
|
+
// Jz is still Jz
|
886
|
+
t[1] * Math.cos(t[2] * Math.PI / 180),
|
887
|
+
// az
|
888
|
+
t[1] * Math.sin(t[2] * Math.PI / 180)
|
889
|
+
// bz
|
890
|
+
];
|
891
|
+
}
|
892
|
+
});
|
893
|
+
function Rr(t, e) {
|
894
|
+
[t, e] = b([t, e]);
|
895
|
+
let [r, n, a] = Je.from(t), [s, i, o] = Je.from(e), l = r - s, c = n - i;
|
896
|
+
Number.isNaN(a) && Number.isNaN(o) ? (a = 0, o = 0) : Number.isNaN(a) ? a = o : Number.isNaN(o) && (o = a);
|
897
|
+
let u = a - o, f = 2 * Math.sqrt(n * i) * Math.sin(u / 2 * (Math.PI / 180));
|
898
|
+
return Math.sqrt(l ** 2 + c ** 2 + f ** 2);
|
899
|
+
}
|
900
|
+
const _0 = 3424 / 4096, R0 = 2413 / 128, x0 = 2392 / 128, xt = 2610 / 16384, xr = 2523 / 32, Nr = 16384 / 2610, Nt = 32 / 2523, Br = [
|
901
|
+
[0.3592832590121217, 0.6976051147779502, -0.035891593232029],
|
902
|
+
[-0.1920808463704993, 1.100476797037432, 0.0753748658519118],
|
903
|
+
[0.0070797844607479, 0.0748396662186362, 0.8433265453898765]
|
904
|
+
], Ir = [
|
905
|
+
[2048 / 4096, 2048 / 4096, 0],
|
906
|
+
[6610 / 4096, -13613 / 4096, 7003 / 4096],
|
907
|
+
[17933 / 4096, -17390 / 4096, -543 / 4096]
|
908
|
+
], zr = [
|
909
|
+
[0.9999999999999998, 0.0086090370379328, 0.111029625003026],
|
910
|
+
[0.9999999999999998, -0.0086090370379328, -0.1110296250030259],
|
911
|
+
[0.9999999999999998, 0.5600313357106791, -0.3206271749873188]
|
912
|
+
], $r = [
|
913
|
+
[2.0701522183894223, -1.3263473389671563, 0.2066510476294053],
|
914
|
+
[0.3647385209748072, 0.6805660249472273, -0.0453045459220347],
|
915
|
+
[-0.0497472075358123, -0.0492609666966131, 1.1880659249923042]
|
916
|
+
];
|
917
|
+
var Fe = new m({
|
918
|
+
id: "ictcp",
|
919
|
+
name: "ICTCP",
|
920
|
+
// From BT.2100-2 page 7:
|
921
|
+
// During production, signal values are expected to exceed the
|
922
|
+
// range E′ = [0.0 : 1.0]. This provides processing headroom and avoids
|
923
|
+
// signal degradation during cascaded processing. Such values of E′,
|
924
|
+
// below 0.0 or exceeding 1.0, should not be clipped during production
|
925
|
+
// and exchange.
|
926
|
+
// Values below 0.0 should not be clipped in reference displays (even
|
927
|
+
// though they represent “negative” light) to allow the black level of
|
928
|
+
// the signal (LB) to be properly set using test signals known as “PLUGE”
|
929
|
+
coords: {
|
930
|
+
i: {
|
931
|
+
refRange: [0, 1],
|
932
|
+
// Constant luminance,
|
933
|
+
name: "I"
|
934
|
+
},
|
935
|
+
ct: {
|
936
|
+
refRange: [-0.5, 0.5],
|
937
|
+
// Full BT.2020 gamut in range [-0.5, 0.5]
|
938
|
+
name: "CT"
|
939
|
+
},
|
940
|
+
cp: {
|
941
|
+
refRange: [-0.5, 0.5],
|
942
|
+
name: "CP"
|
943
|
+
}
|
944
|
+
},
|
945
|
+
base: nt,
|
946
|
+
fromBase(t) {
|
947
|
+
let e = L(Br, t);
|
948
|
+
return Pr(e);
|
949
|
+
},
|
950
|
+
toBase(t) {
|
951
|
+
let e = Er(t);
|
952
|
+
return L($r, e);
|
953
|
+
}
|
954
|
+
});
|
955
|
+
function Pr(t) {
|
956
|
+
let e = t.map(function(r) {
|
957
|
+
let n = _0 + R0 * (r / 1e4) ** xt, a = 1 + x0 * (r / 1e4) ** xt;
|
958
|
+
return (n / a) ** xr;
|
959
|
+
});
|
960
|
+
return L(Ir, e);
|
961
|
+
}
|
962
|
+
function Er(t) {
|
963
|
+
return L(zr, t).map(function(n) {
|
964
|
+
let a = Math.max(n ** Nt - _0, 0), s = R0 - x0 * n ** Nt;
|
965
|
+
return 1e4 * (a / s) ** Nr;
|
966
|
+
});
|
967
|
+
}
|
968
|
+
function vr(t, e) {
|
969
|
+
[t, e] = b([t, e]);
|
970
|
+
let [r, n, a] = Fe.from(t), [s, i, o] = Fe.from(e);
|
971
|
+
return 720 * Math.sqrt((r - s) ** 2 + 0.25 * (n - i) ** 2 + (a - o) ** 2);
|
972
|
+
}
|
973
|
+
const Ar = B.D65, N0 = 0.42, Bt = 1 / N0, He = 2 * Math.PI, B0 = [
|
974
|
+
[0.401288, 0.650173, -0.051461],
|
975
|
+
[-0.250268, 1.204414, 0.045854],
|
976
|
+
[-2079e-6, 0.048952, 0.953127]
|
977
|
+
], kr = [
|
978
|
+
[1.8620678550872327, -1.0112546305316843, 0.14918677544445175],
|
979
|
+
[0.38752654323613717, 0.6214474419314753, -0.008973985167612518],
|
980
|
+
[-0.015841498849333856, -0.03412293802851557, 1.0499644368778496]
|
981
|
+
], Hr = [
|
982
|
+
[460, 451, 288],
|
983
|
+
[460, -891, -261],
|
984
|
+
[460, -220, -6300]
|
985
|
+
], Tr = {
|
986
|
+
dark: [0.8, 0.525, 0.8],
|
987
|
+
dim: [0.9, 0.59, 0.9],
|
988
|
+
average: [1, 0.69, 1]
|
989
|
+
}, G = {
|
990
|
+
// Red, Yellow, Green, Blue, Red
|
991
|
+
h: [20.14, 90, 164.25, 237.53, 380.14],
|
992
|
+
e: [0.8, 0.7, 1, 1.2, 0.8],
|
993
|
+
H: [0, 100, 200, 300, 400]
|
994
|
+
}, Or = 180 / Math.PI, It = Math.PI / 180;
|
995
|
+
function I0(t, e) {
|
996
|
+
return t.map((n) => {
|
997
|
+
const a = k(e * Math.abs(n) * 0.01, N0);
|
998
|
+
return 400 * Ie(a, n) / (a + 27.13);
|
999
|
+
});
|
1000
|
+
}
|
1001
|
+
function Yr(t, e) {
|
1002
|
+
const r = 100 / e * 27.13 ** Bt;
|
1003
|
+
return t.map((n) => {
|
1004
|
+
const a = Math.abs(n);
|
1005
|
+
return Ie(r * k(a / (400 - a), Bt), n);
|
1006
|
+
});
|
1007
|
+
}
|
1008
|
+
function Dr(t) {
|
1009
|
+
let e = H(t);
|
1010
|
+
e <= G.h[0] && (e += 360);
|
1011
|
+
const r = w0(G.h, e) - 1, [n, a] = G.h.slice(r, r + 2), [s, i] = G.e.slice(r, r + 2), o = G.H[r], l = (e - n) / s;
|
1012
|
+
return o + 100 * l / (l + (a - e) / i);
|
1013
|
+
}
|
1014
|
+
function Xr(t) {
|
1015
|
+
let e = (t % 400 + 400) % 400;
|
1016
|
+
const r = Math.floor(0.01 * e);
|
1017
|
+
e = e % 100;
|
1018
|
+
const [n, a] = G.h.slice(r, r + 2), [s, i] = G.e.slice(r, r + 2);
|
1019
|
+
return H(
|
1020
|
+
(e * (i * n - s * a) - 100 * n * i) / (e * (i - s) - 100 * i)
|
1021
|
+
);
|
1022
|
+
}
|
1023
|
+
function z0(t, e, r, n, a) {
|
1024
|
+
const s = {};
|
1025
|
+
s.discounting = a, s.refWhite = t, s.surround = n;
|
1026
|
+
const i = t.map((g) => g * 100);
|
1027
|
+
s.la = e, s.yb = r;
|
1028
|
+
const o = i[1], l = L(B0, i);
|
1029
|
+
n = Tr[s.surround];
|
1030
|
+
const c = n[0];
|
1031
|
+
s.c = n[1], s.nc = n[2];
|
1032
|
+
const f = (1 / (5 * s.la + 1)) ** 4;
|
1033
|
+
s.fl = f * s.la + 0.1 * (1 - f) * (1 - f) * Math.cbrt(5 * s.la), s.flRoot = s.fl ** 0.25, s.n = s.yb / o, s.z = 1.48 + Math.sqrt(s.n), s.nbb = 0.725 * s.n ** -0.2, s.ncb = s.nbb;
|
1034
|
+
const h = Math.max(
|
1035
|
+
Math.min(c * (1 - 1 / 3.6 * Math.exp((-s.la - 42) / 92)), 1),
|
1036
|
+
0
|
1037
|
+
);
|
1038
|
+
s.dRgb = l.map((g) => oe(1, o / g, h)), s.dRgbInv = s.dRgb.map((g) => 1 / g);
|
1039
|
+
const p = l.map((g, M) => g * s.dRgb[M]), d = I0(p, s.fl);
|
1040
|
+
return s.aW = s.nbb * (2 * d[0] + d[1] + 0.05 * d[2]), s;
|
1041
|
+
}
|
1042
|
+
const zt = z0(
|
1043
|
+
Ar,
|
1044
|
+
64 / Math.PI * 0.2,
|
1045
|
+
20,
|
1046
|
+
"average",
|
1047
|
+
!1
|
1048
|
+
);
|
1049
|
+
function We(t, e) {
|
1050
|
+
if (!(t.J !== void 0 ^ t.Q !== void 0))
|
1051
|
+
throw new Error("Conversion requires one and only one: 'J' or 'Q'");
|
1052
|
+
if (!(t.C !== void 0 ^ t.M !== void 0 ^ t.s !== void 0))
|
1053
|
+
throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");
|
1054
|
+
if (!(t.h !== void 0 ^ t.H !== void 0))
|
1055
|
+
throw new Error("Conversion requires one and only one: 'h' or 'H'");
|
1056
|
+
if (t.J === 0 || t.Q === 0)
|
1057
|
+
return [0, 0, 0];
|
1058
|
+
let r = 0;
|
1059
|
+
t.h !== void 0 ? r = H(t.h) * It : r = Xr(t.H) * It;
|
1060
|
+
const n = Math.cos(r), a = Math.sin(r);
|
1061
|
+
let s = 0;
|
1062
|
+
t.J !== void 0 ? s = k(t.J, 1 / 2) * 0.1 : t.Q !== void 0 && (s = 0.25 * e.c * t.Q / ((e.aW + 4) * e.flRoot));
|
1063
|
+
let i = 0;
|
1064
|
+
t.C !== void 0 ? i = t.C / s : t.M !== void 0 ? i = t.M / e.flRoot / s : t.s !== void 0 && (i = 4e-4 * t.s ** 2 * (e.aW + 4) / e.c);
|
1065
|
+
const o = k(
|
1066
|
+
i * Math.pow(1.64 - Math.pow(0.29, e.n), -0.73),
|
1067
|
+
10 / 9
|
1068
|
+
), l = 0.25 * (Math.cos(r + 2) + 3.8), c = e.aW * k(s, 2 / e.c / e.z), u = 5e4 / 13 * e.nc * e.ncb * l, f = c / e.nbb, h = 23 * (f + 0.305) * et(o, 23 * u + o * (11 * n + 108 * a)), p = h * n, d = h * a, g = Yr(
|
1069
|
+
L(Hr, [f, p, d]).map((M) => M * 1 / 1403),
|
1070
|
+
e.fl
|
1071
|
+
);
|
1072
|
+
return L(
|
1073
|
+
kr,
|
1074
|
+
g.map((M, _) => M * e.dRgbInv[_])
|
1075
|
+
).map((M) => M / 100);
|
1076
|
+
}
|
1077
|
+
function $0(t, e) {
|
1078
|
+
const r = t.map((y) => y * 100), n = I0(
|
1079
|
+
L(B0, r).map((y, $) => y * e.dRgb[$]),
|
1080
|
+
e.fl
|
1081
|
+
), a = n[0] + (-12 * n[1] + n[2]) / 11, s = (n[0] + n[1] - 2 * n[2]) / 9, i = (Math.atan2(s, a) % He + He) % He, o = 0.25 * (Math.cos(i + 2) + 3.8), l = 5e4 / 13 * e.nc * e.ncb * et(
|
1082
|
+
o * Math.sqrt(a ** 2 + s ** 2),
|
1083
|
+
n[0] + n[1] + 1.05 * n[2] + 0.305
|
1084
|
+
), c = k(l, 0.9) * Math.pow(1.64 - Math.pow(0.29, e.n), 0.73), u = e.nbb * (2 * n[0] + n[1] + 0.05 * n[2]), f = k(u / e.aW, 0.5 * e.c * e.z), h = 100 * k(f, 2), p = 4 / e.c * f * (e.aW + 4) * e.flRoot, d = c * f, g = d * e.flRoot, M = H(i * Or), _ = Dr(M), S = 50 * k(e.c * c / (e.aW + 4), 1 / 2);
|
1085
|
+
return { J: h, C: d, h: M, s: S, Q: p, M: g, H: _ };
|
1086
|
+
}
|
1087
|
+
var jr = new m({
|
1088
|
+
id: "cam16-jmh",
|
1089
|
+
cssId: "--cam16-jmh",
|
1090
|
+
name: "CAM16-JMh",
|
1091
|
+
coords: {
|
1092
|
+
j: {
|
1093
|
+
refRange: [0, 100],
|
1094
|
+
name: "J"
|
1095
|
+
},
|
1096
|
+
m: {
|
1097
|
+
refRange: [0, 105],
|
1098
|
+
name: "Colorfulness"
|
1099
|
+
},
|
1100
|
+
h: {
|
1101
|
+
refRange: [0, 360],
|
1102
|
+
type: "angle",
|
1103
|
+
name: "Hue"
|
1104
|
+
}
|
1105
|
+
},
|
1106
|
+
base: N,
|
1107
|
+
fromBase(t) {
|
1108
|
+
const e = $0(t, zt);
|
1109
|
+
return [e.J, e.M, e.h];
|
1110
|
+
},
|
1111
|
+
toBase(t) {
|
1112
|
+
return We(
|
1113
|
+
{ J: t[0], M: t[1], h: t[2] },
|
1114
|
+
zt
|
1115
|
+
);
|
1116
|
+
}
|
1117
|
+
});
|
1118
|
+
const qr = B.D65, Zr = 216 / 24389, P0 = 24389 / 27;
|
1119
|
+
function Gr(t) {
|
1120
|
+
return 116 * (t > Zr ? Math.cbrt(t) : (P0 * t + 16) / 116) - 16;
|
1121
|
+
}
|
1122
|
+
function Qe(t) {
|
1123
|
+
return t > 8 ? Math.pow((t + 16) / 116, 3) : t / P0;
|
1124
|
+
}
|
1125
|
+
function Jr(t, e) {
|
1126
|
+
let [r, n, a] = t, s = [], i = 0;
|
1127
|
+
if (a === 0)
|
1128
|
+
return [0, 0, 0];
|
1129
|
+
let o = Qe(a);
|
1130
|
+
a > 0 ? i = 0.00379058511492914 * a ** 2 + 0.608983189401032 * a + 0.9155088574762233 : i = 9514440756550361e-21 * a ** 2 + 0.08693057439788597 * a - 21.928975842194614;
|
1131
|
+
const l = 2e-12, c = 15;
|
1132
|
+
let u = 0, f = 1 / 0;
|
1133
|
+
for (; u <= c; ) {
|
1134
|
+
s = We({ J: i, C: n, h: r }, e);
|
1135
|
+
const h = Math.abs(s[1] - o);
|
1136
|
+
if (h < f) {
|
1137
|
+
if (h <= l)
|
1138
|
+
return s;
|
1139
|
+
f = h;
|
1140
|
+
}
|
1141
|
+
i = i - (s[1] - o) * i / (2 * s[1]), u += 1;
|
1142
|
+
}
|
1143
|
+
return We({ J: i, C: n, h: r }, e);
|
1144
|
+
}
|
1145
|
+
function Fr(t, e) {
|
1146
|
+
const r = Gr(t[1]);
|
1147
|
+
if (r === 0)
|
1148
|
+
return [0, 0, 0];
|
1149
|
+
const n = $0(t, at);
|
1150
|
+
return [H(n.h), n.C, r];
|
1151
|
+
}
|
1152
|
+
const at = z0(
|
1153
|
+
qr,
|
1154
|
+
200 / Math.PI * Qe(50),
|
1155
|
+
Qe(50) * 100,
|
1156
|
+
"average",
|
1157
|
+
!1
|
1158
|
+
);
|
1159
|
+
var ce = new m({
|
1160
|
+
id: "hct",
|
1161
|
+
name: "HCT",
|
1162
|
+
coords: {
|
1163
|
+
h: {
|
1164
|
+
refRange: [0, 360],
|
1165
|
+
type: "angle",
|
1166
|
+
name: "Hue"
|
1167
|
+
},
|
1168
|
+
c: {
|
1169
|
+
refRange: [0, 145],
|
1170
|
+
name: "Colorfulness"
|
1171
|
+
},
|
1172
|
+
t: {
|
1173
|
+
refRange: [0, 100],
|
1174
|
+
name: "Tone"
|
1175
|
+
}
|
1176
|
+
},
|
1177
|
+
base: N,
|
1178
|
+
fromBase(t) {
|
1179
|
+
return Fr(t);
|
1180
|
+
},
|
1181
|
+
toBase(t) {
|
1182
|
+
return Jr(t, at);
|
1183
|
+
},
|
1184
|
+
formats: {
|
1185
|
+
color: {
|
1186
|
+
id: "--hct",
|
1187
|
+
coords: ["<number> | <angle>", "<percentage> | <number>", "<percentage> | <number>"]
|
1188
|
+
}
|
1189
|
+
}
|
1190
|
+
});
|
1191
|
+
const Wr = Math.PI / 180, $t = [1, 7e-3, 0.0228];
|
1192
|
+
function Pt(t) {
|
1193
|
+
t[1] < 0 && (t = ce.fromBase(ce.toBase(t)));
|
1194
|
+
const e = Math.log(Math.max(1 + $t[2] * t[1] * at.flRoot, 1)) / $t[2], r = t[0] * Wr, n = e * Math.cos(r), a = e * Math.sin(r);
|
1195
|
+
return [t[2], n, a];
|
1196
|
+
}
|
1197
|
+
function Qr(t, e) {
|
1198
|
+
[t, e] = b([t, e]);
|
1199
|
+
let [r, n, a] = Pt(ce.from(t)), [s, i, o] = Pt(ce.from(e));
|
1200
|
+
return Math.sqrt((r - s) ** 2 + (n - i) ** 2 + (a - o) ** 2);
|
1201
|
+
}
|
1202
|
+
var ee = {
|
1203
|
+
deltaE76: pr,
|
1204
|
+
deltaECMC: Mr,
|
1205
|
+
deltaE2000: C0,
|
1206
|
+
deltaEJz: Rr,
|
1207
|
+
deltaEITP: vr,
|
1208
|
+
deltaEOK: Ge,
|
1209
|
+
deltaEHCT: Qr
|
1210
|
+
};
|
1211
|
+
function Ur(t) {
|
1212
|
+
const e = t ? Math.floor(Math.log10(Math.abs(t))) : 0;
|
1213
|
+
return Math.max(parseFloat(`1e${e - 2}`), 1e-6);
|
1214
|
+
}
|
1215
|
+
const Et = {
|
1216
|
+
hct: {
|
1217
|
+
method: "hct.c",
|
1218
|
+
jnd: 2,
|
1219
|
+
deltaEMethod: "hct",
|
1220
|
+
blackWhiteClamp: {}
|
1221
|
+
},
|
1222
|
+
"hct-tonal": {
|
1223
|
+
method: "hct.c",
|
1224
|
+
jnd: 0,
|
1225
|
+
deltaEMethod: "hct",
|
1226
|
+
blackWhiteClamp: { channel: "hct.t", min: 0, max: 100 }
|
1227
|
+
}
|
1228
|
+
};
|
1229
|
+
function q(t, {
|
1230
|
+
method: e = v.gamut_mapping,
|
1231
|
+
space: r = void 0,
|
1232
|
+
deltaEMethod: n = "",
|
1233
|
+
jnd: a = 2,
|
1234
|
+
blackWhiteClamp: s = {}
|
1235
|
+
} = {}) {
|
1236
|
+
if (t = b(t), ue(arguments[1]) ? r = arguments[1] : r || (r = t.space), r = m.get(r), J(t, r, { epsilon: 0 }))
|
1237
|
+
return t;
|
1238
|
+
let i;
|
1239
|
+
if (e === "css")
|
1240
|
+
i = Kr(t, { space: r });
|
1241
|
+
else {
|
1242
|
+
if (e !== "clip" && !J(t, r)) {
|
1243
|
+
Object.prototype.hasOwnProperty.call(Et, e) && ({ method: e, jnd: a, deltaEMethod: n, blackWhiteClamp: s } = Et[e]);
|
1244
|
+
let o = C0;
|
1245
|
+
if (n !== "") {
|
1246
|
+
for (let c in ee)
|
1247
|
+
if ("deltae" + n.toLowerCase() === c.toLowerCase()) {
|
1248
|
+
o = ee[c];
|
1249
|
+
break;
|
1250
|
+
}
|
1251
|
+
}
|
1252
|
+
let l = q(C(t, r), { method: "clip", space: r });
|
1253
|
+
if (o(t, l) > a) {
|
1254
|
+
if (Object.keys(s).length === 3) {
|
1255
|
+
let S = m.resolveCoord(s.channel), y = P(C(t, S.space), S.id);
|
1256
|
+
if (X(y) && (y = 0), y >= s.max)
|
1257
|
+
return C({ space: "xyz-d65", coords: B.D65 }, t.space);
|
1258
|
+
if (y <= s.min)
|
1259
|
+
return C({ space: "xyz-d65", coords: [0, 0, 0] }, t.space);
|
1260
|
+
}
|
1261
|
+
let c = m.resolveCoord(e), u = c.space, f = c.id, h = C(t, u);
|
1262
|
+
h.coords.forEach((S, y) => {
|
1263
|
+
X(S) && (h.coords[y] = 0);
|
1264
|
+
});
|
1265
|
+
let d = (c.range || c.refRange)[0], g = Ur(a), M = d, _ = P(h, f);
|
1266
|
+
for (; _ - M > g; ) {
|
1267
|
+
let S = V(h);
|
1268
|
+
S = q(S, { space: r, method: "clip" }), o(h, S) - a < g ? M = P(h, f) : _ = P(h, f), O(h, f, (M + _) / 2);
|
1269
|
+
}
|
1270
|
+
i = C(h, r);
|
1271
|
+
} else
|
1272
|
+
i = l;
|
1273
|
+
} else
|
1274
|
+
i = C(t, r);
|
1275
|
+
if (e === "clip" || !J(i, r, { epsilon: 0 })) {
|
1276
|
+
let o = Object.values(r.coords).map((l) => l.range || []);
|
1277
|
+
i.coords = i.coords.map((l, c) => {
|
1278
|
+
let [u, f] = o[c];
|
1279
|
+
return u !== void 0 && (l = Math.max(u, l)), f !== void 0 && (l = Math.min(l, f)), l;
|
1280
|
+
});
|
1281
|
+
}
|
1282
|
+
}
|
1283
|
+
return r !== t.space && (i = C(i, t.space)), t.coords = i.coords, t;
|
1284
|
+
}
|
1285
|
+
q.returns = "color";
|
1286
|
+
const vt = {
|
1287
|
+
WHITE: { space: K, coords: [1, 0, 0] },
|
1288
|
+
BLACK: { space: K, coords: [0, 0, 0] }
|
1289
|
+
};
|
1290
|
+
function Kr(t, { space: e } = {}) {
|
1291
|
+
t = b(t), e || (e = t.space), e = m.get(e);
|
1292
|
+
const a = m.get("oklch");
|
1293
|
+
if (e.isUnbounded)
|
1294
|
+
return C(t, e);
|
1295
|
+
const s = C(t, a);
|
1296
|
+
let i = s.coords[0];
|
1297
|
+
if (i >= 1) {
|
1298
|
+
const d = C(vt.WHITE, e);
|
1299
|
+
return d.alpha = t.alpha, C(d, e);
|
1300
|
+
}
|
1301
|
+
if (i <= 0) {
|
1302
|
+
const d = C(vt.BLACK, e);
|
1303
|
+
return d.alpha = t.alpha, C(d, e);
|
1304
|
+
}
|
1305
|
+
if (J(s, e, { epsilon: 0 }))
|
1306
|
+
return C(s, e);
|
1307
|
+
function o(d) {
|
1308
|
+
const g = C(d, e), M = Object.values(e.coords);
|
1309
|
+
return g.coords = g.coords.map((_, S) => {
|
1310
|
+
if ("range" in M[S]) {
|
1311
|
+
const [y, $] = M[S].range;
|
1312
|
+
return M0(y, _, $);
|
1313
|
+
}
|
1314
|
+
return _;
|
1315
|
+
}), g;
|
1316
|
+
}
|
1317
|
+
let l = 0, c = s.coords[1], u = !0, f = V(s), h = o(f), p = Ge(h, f);
|
1318
|
+
if (p < 0.02)
|
1319
|
+
return h;
|
1320
|
+
for (; c - l > 1e-4; ) {
|
1321
|
+
const d = (l + c) / 2;
|
1322
|
+
if (f.coords[1] = d, u && J(f, e, { epsilon: 0 }))
|
1323
|
+
l = d;
|
1324
|
+
else if (h = o(f), p = Ge(h, f), p < 0.02) {
|
1325
|
+
if (0.02 - p < 1e-4)
|
1326
|
+
break;
|
1327
|
+
u = !1, l = d;
|
1328
|
+
} else
|
1329
|
+
c = d;
|
1330
|
+
}
|
1331
|
+
return h;
|
1332
|
+
}
|
1333
|
+
function C(t, e, { inGamut: r } = {}) {
|
1334
|
+
t = b(t), e = m.get(e);
|
1335
|
+
let n = e.from(t), a = { space: e, coords: n, alpha: t.alpha };
|
1336
|
+
return r && (a = q(a, r === !0 ? void 0 : r)), a;
|
1337
|
+
}
|
1338
|
+
C.returns = "color";
|
1339
|
+
function ie(t, {
|
1340
|
+
precision: e = v.precision,
|
1341
|
+
format: r = "default",
|
1342
|
+
inGamut: n = !0,
|
1343
|
+
...a
|
1344
|
+
} = {}) {
|
1345
|
+
var l;
|
1346
|
+
let s;
|
1347
|
+
t = b(t);
|
1348
|
+
let i = r;
|
1349
|
+
r = t.space.getFormat(r) ?? t.space.getFormat("default") ?? m.DEFAULT_FORMAT;
|
1350
|
+
let o = t.coords.slice();
|
1351
|
+
if (n || (n = r.toGamut), n && !J(t) && (o = q(V(t), n === !0 ? void 0 : n).coords), r.type === "custom")
|
1352
|
+
if (a.precision = e, r.serialize)
|
1353
|
+
s = r.serialize(o, t.alpha, a);
|
1354
|
+
else
|
1355
|
+
throw new TypeError(`format ${i} can only be used to parse colors, not for serialization`);
|
1356
|
+
else {
|
1357
|
+
let c = r.name || "color";
|
1358
|
+
r.serializeCoords ? o = r.serializeCoords(o, e) : e !== null && (o = o.map((p) => Re(p, { precision: e })));
|
1359
|
+
let u = [...o];
|
1360
|
+
if (c === "color") {
|
1361
|
+
let p = r.id || ((l = r.ids) == null ? void 0 : l[0]) || t.space.id;
|
1362
|
+
u.unshift(p);
|
1363
|
+
}
|
1364
|
+
let f = t.alpha;
|
1365
|
+
e !== null && (f = Re(f, { precision: e }));
|
1366
|
+
let h = t.alpha >= 1 || r.noAlpha ? "" : `${r.commas ? "," : " /"} ${f}`;
|
1367
|
+
s = `${c}(${u.join(r.commas ? ", " : " ")}${h})`;
|
1368
|
+
}
|
1369
|
+
return s;
|
1370
|
+
}
|
1371
|
+
const Vr = [
|
1372
|
+
[0.6369580483012914, 0.14461690358620832, 0.1688809751641721],
|
1373
|
+
[0.2627002120112671, 0.6779980715188708, 0.05930171646986196],
|
1374
|
+
[0, 0.028072693049087428, 1.060985057710791]
|
1375
|
+
], en = [
|
1376
|
+
[1.716651187971268, -0.355670783776392, -0.25336628137366],
|
1377
|
+
[-0.666684351832489, 1.616481236634939, 0.0157685458139111],
|
1378
|
+
[0.017639857445311, -0.042770613257809, 0.942103121235474]
|
1379
|
+
];
|
1380
|
+
var ze = new z({
|
1381
|
+
id: "rec2020-linear",
|
1382
|
+
cssId: "--rec2020-linear",
|
1383
|
+
name: "Linear REC.2020",
|
1384
|
+
white: "D65",
|
1385
|
+
toXYZ_M: Vr,
|
1386
|
+
fromXYZ_M: en
|
1387
|
+
});
|
1388
|
+
const ye = 1.09929682680944, At = 0.018053968510807;
|
1389
|
+
var E0 = new z({
|
1390
|
+
id: "rec2020",
|
1391
|
+
name: "REC.2020",
|
1392
|
+
base: ze,
|
1393
|
+
// Non-linear transfer function from Rec. ITU-R BT.2020-2 table 4
|
1394
|
+
toBase(t) {
|
1395
|
+
return t.map(function(e) {
|
1396
|
+
return e < At * 4.5 ? e / 4.5 : Math.pow((e + ye - 1) / ye, 1 / 0.45);
|
1397
|
+
});
|
1398
|
+
},
|
1399
|
+
fromBase(t) {
|
1400
|
+
return t.map(function(e) {
|
1401
|
+
return e >= At ? ye * Math.pow(e, 0.45) - (ye - 1) : 4.5 * e;
|
1402
|
+
});
|
1403
|
+
}
|
1404
|
+
});
|
1405
|
+
const tn = [
|
1406
|
+
[0.4865709486482162, 0.26566769316909306, 0.1982172852343625],
|
1407
|
+
[0.2289745640697488, 0.6917385218365064, 0.079286914093745],
|
1408
|
+
[0, 0.04511338185890264, 1.043944368900976]
|
1409
|
+
], rn = [
|
1410
|
+
[2.493496911941425, -0.9313836179191239, -0.40271078445071684],
|
1411
|
+
[-0.8294889695615747, 1.7626640603183463, 0.023624685841943577],
|
1412
|
+
[0.03584583024378447, -0.07617238926804182, 0.9568845240076872]
|
1413
|
+
];
|
1414
|
+
var v0 = new z({
|
1415
|
+
id: "p3-linear",
|
1416
|
+
cssId: "--display-p3-linear",
|
1417
|
+
name: "Linear P3",
|
1418
|
+
white: "D65",
|
1419
|
+
toXYZ_M: tn,
|
1420
|
+
fromXYZ_M: rn
|
1421
|
+
});
|
1422
|
+
const nn = [
|
1423
|
+
[0.41239079926595934, 0.357584339383878, 0.1804807884018343],
|
1424
|
+
[0.21263900587151027, 0.715168678767756, 0.07219231536073371],
|
1425
|
+
[0.01933081871559182, 0.11919477979462598, 0.9505321522496607]
|
1426
|
+
], x = [
|
1427
|
+
[3.2409699419045226, -1.537383177570094, -0.4986107602930034],
|
1428
|
+
[-0.9692436362808796, 1.8759675015077202, 0.04155505740717559],
|
1429
|
+
[0.05563007969699366, -0.20397695888897652, 1.0569715142428786]
|
1430
|
+
];
|
1431
|
+
var A0 = new z({
|
1432
|
+
id: "srgb-linear",
|
1433
|
+
name: "Linear sRGB",
|
1434
|
+
white: "D65",
|
1435
|
+
toXYZ_M: nn,
|
1436
|
+
fromXYZ_M: x
|
1437
|
+
}), kt = {
|
1438
|
+
aliceblue: [240 / 255, 248 / 255, 1],
|
1439
|
+
antiquewhite: [250 / 255, 235 / 255, 215 / 255],
|
1440
|
+
aqua: [0, 1, 1],
|
1441
|
+
aquamarine: [127 / 255, 1, 212 / 255],
|
1442
|
+
azure: [240 / 255, 1, 1],
|
1443
|
+
beige: [245 / 255, 245 / 255, 220 / 255],
|
1444
|
+
bisque: [1, 228 / 255, 196 / 255],
|
1445
|
+
black: [0, 0, 0],
|
1446
|
+
blanchedalmond: [1, 235 / 255, 205 / 255],
|
1447
|
+
blue: [0, 0, 1],
|
1448
|
+
blueviolet: [138 / 255, 43 / 255, 226 / 255],
|
1449
|
+
brown: [165 / 255, 42 / 255, 42 / 255],
|
1450
|
+
burlywood: [222 / 255, 184 / 255, 135 / 255],
|
1451
|
+
cadetblue: [95 / 255, 158 / 255, 160 / 255],
|
1452
|
+
chartreuse: [127 / 255, 1, 0],
|
1453
|
+
chocolate: [210 / 255, 105 / 255, 30 / 255],
|
1454
|
+
coral: [1, 127 / 255, 80 / 255],
|
1455
|
+
cornflowerblue: [100 / 255, 149 / 255, 237 / 255],
|
1456
|
+
cornsilk: [1, 248 / 255, 220 / 255],
|
1457
|
+
crimson: [220 / 255, 20 / 255, 60 / 255],
|
1458
|
+
cyan: [0, 1, 1],
|
1459
|
+
darkblue: [0, 0, 139 / 255],
|
1460
|
+
darkcyan: [0, 139 / 255, 139 / 255],
|
1461
|
+
darkgoldenrod: [184 / 255, 134 / 255, 11 / 255],
|
1462
|
+
darkgray: [169 / 255, 169 / 255, 169 / 255],
|
1463
|
+
darkgreen: [0, 100 / 255, 0],
|
1464
|
+
darkgrey: [169 / 255, 169 / 255, 169 / 255],
|
1465
|
+
darkkhaki: [189 / 255, 183 / 255, 107 / 255],
|
1466
|
+
darkmagenta: [139 / 255, 0, 139 / 255],
|
1467
|
+
darkolivegreen: [85 / 255, 107 / 255, 47 / 255],
|
1468
|
+
darkorange: [1, 140 / 255, 0],
|
1469
|
+
darkorchid: [153 / 255, 50 / 255, 204 / 255],
|
1470
|
+
darkred: [139 / 255, 0, 0],
|
1471
|
+
darksalmon: [233 / 255, 150 / 255, 122 / 255],
|
1472
|
+
darkseagreen: [143 / 255, 188 / 255, 143 / 255],
|
1473
|
+
darkslateblue: [72 / 255, 61 / 255, 139 / 255],
|
1474
|
+
darkslategray: [47 / 255, 79 / 255, 79 / 255],
|
1475
|
+
darkslategrey: [47 / 255, 79 / 255, 79 / 255],
|
1476
|
+
darkturquoise: [0, 206 / 255, 209 / 255],
|
1477
|
+
darkviolet: [148 / 255, 0, 211 / 255],
|
1478
|
+
deeppink: [1, 20 / 255, 147 / 255],
|
1479
|
+
deepskyblue: [0, 191 / 255, 1],
|
1480
|
+
dimgray: [105 / 255, 105 / 255, 105 / 255],
|
1481
|
+
dimgrey: [105 / 255, 105 / 255, 105 / 255],
|
1482
|
+
dodgerblue: [30 / 255, 144 / 255, 1],
|
1483
|
+
firebrick: [178 / 255, 34 / 255, 34 / 255],
|
1484
|
+
floralwhite: [1, 250 / 255, 240 / 255],
|
1485
|
+
forestgreen: [34 / 255, 139 / 255, 34 / 255],
|
1486
|
+
fuchsia: [1, 0, 1],
|
1487
|
+
gainsboro: [220 / 255, 220 / 255, 220 / 255],
|
1488
|
+
ghostwhite: [248 / 255, 248 / 255, 1],
|
1489
|
+
gold: [1, 215 / 255, 0],
|
1490
|
+
goldenrod: [218 / 255, 165 / 255, 32 / 255],
|
1491
|
+
gray: [128 / 255, 128 / 255, 128 / 255],
|
1492
|
+
green: [0, 128 / 255, 0],
|
1493
|
+
greenyellow: [173 / 255, 1, 47 / 255],
|
1494
|
+
grey: [128 / 255, 128 / 255, 128 / 255],
|
1495
|
+
honeydew: [240 / 255, 1, 240 / 255],
|
1496
|
+
hotpink: [1, 105 / 255, 180 / 255],
|
1497
|
+
indianred: [205 / 255, 92 / 255, 92 / 255],
|
1498
|
+
indigo: [75 / 255, 0, 130 / 255],
|
1499
|
+
ivory: [1, 1, 240 / 255],
|
1500
|
+
khaki: [240 / 255, 230 / 255, 140 / 255],
|
1501
|
+
lavender: [230 / 255, 230 / 255, 250 / 255],
|
1502
|
+
lavenderblush: [1, 240 / 255, 245 / 255],
|
1503
|
+
lawngreen: [124 / 255, 252 / 255, 0],
|
1504
|
+
lemonchiffon: [1, 250 / 255, 205 / 255],
|
1505
|
+
lightblue: [173 / 255, 216 / 255, 230 / 255],
|
1506
|
+
lightcoral: [240 / 255, 128 / 255, 128 / 255],
|
1507
|
+
lightcyan: [224 / 255, 1, 1],
|
1508
|
+
lightgoldenrodyellow: [250 / 255, 250 / 255, 210 / 255],
|
1509
|
+
lightgray: [211 / 255, 211 / 255, 211 / 255],
|
1510
|
+
lightgreen: [144 / 255, 238 / 255, 144 / 255],
|
1511
|
+
lightgrey: [211 / 255, 211 / 255, 211 / 255],
|
1512
|
+
lightpink: [1, 182 / 255, 193 / 255],
|
1513
|
+
lightsalmon: [1, 160 / 255, 122 / 255],
|
1514
|
+
lightseagreen: [32 / 255, 178 / 255, 170 / 255],
|
1515
|
+
lightskyblue: [135 / 255, 206 / 255, 250 / 255],
|
1516
|
+
lightslategray: [119 / 255, 136 / 255, 153 / 255],
|
1517
|
+
lightslategrey: [119 / 255, 136 / 255, 153 / 255],
|
1518
|
+
lightsteelblue: [176 / 255, 196 / 255, 222 / 255],
|
1519
|
+
lightyellow: [1, 1, 224 / 255],
|
1520
|
+
lime: [0, 1, 0],
|
1521
|
+
limegreen: [50 / 255, 205 / 255, 50 / 255],
|
1522
|
+
linen: [250 / 255, 240 / 255, 230 / 255],
|
1523
|
+
magenta: [1, 0, 1],
|
1524
|
+
maroon: [128 / 255, 0, 0],
|
1525
|
+
mediumaquamarine: [102 / 255, 205 / 255, 170 / 255],
|
1526
|
+
mediumblue: [0, 0, 205 / 255],
|
1527
|
+
mediumorchid: [186 / 255, 85 / 255, 211 / 255],
|
1528
|
+
mediumpurple: [147 / 255, 112 / 255, 219 / 255],
|
1529
|
+
mediumseagreen: [60 / 255, 179 / 255, 113 / 255],
|
1530
|
+
mediumslateblue: [123 / 255, 104 / 255, 238 / 255],
|
1531
|
+
mediumspringgreen: [0, 250 / 255, 154 / 255],
|
1532
|
+
mediumturquoise: [72 / 255, 209 / 255, 204 / 255],
|
1533
|
+
mediumvioletred: [199 / 255, 21 / 255, 133 / 255],
|
1534
|
+
midnightblue: [25 / 255, 25 / 255, 112 / 255],
|
1535
|
+
mintcream: [245 / 255, 1, 250 / 255],
|
1536
|
+
mistyrose: [1, 228 / 255, 225 / 255],
|
1537
|
+
moccasin: [1, 228 / 255, 181 / 255],
|
1538
|
+
navajowhite: [1, 222 / 255, 173 / 255],
|
1539
|
+
navy: [0, 0, 128 / 255],
|
1540
|
+
oldlace: [253 / 255, 245 / 255, 230 / 255],
|
1541
|
+
olive: [128 / 255, 128 / 255, 0],
|
1542
|
+
olivedrab: [107 / 255, 142 / 255, 35 / 255],
|
1543
|
+
orange: [1, 165 / 255, 0],
|
1544
|
+
orangered: [1, 69 / 255, 0],
|
1545
|
+
orchid: [218 / 255, 112 / 255, 214 / 255],
|
1546
|
+
palegoldenrod: [238 / 255, 232 / 255, 170 / 255],
|
1547
|
+
palegreen: [152 / 255, 251 / 255, 152 / 255],
|
1548
|
+
paleturquoise: [175 / 255, 238 / 255, 238 / 255],
|
1549
|
+
palevioletred: [219 / 255, 112 / 255, 147 / 255],
|
1550
|
+
papayawhip: [1, 239 / 255, 213 / 255],
|
1551
|
+
peachpuff: [1, 218 / 255, 185 / 255],
|
1552
|
+
peru: [205 / 255, 133 / 255, 63 / 255],
|
1553
|
+
pink: [1, 192 / 255, 203 / 255],
|
1554
|
+
plum: [221 / 255, 160 / 255, 221 / 255],
|
1555
|
+
powderblue: [176 / 255, 224 / 255, 230 / 255],
|
1556
|
+
purple: [128 / 255, 0, 128 / 255],
|
1557
|
+
rebeccapurple: [102 / 255, 51 / 255, 153 / 255],
|
1558
|
+
red: [1, 0, 0],
|
1559
|
+
rosybrown: [188 / 255, 143 / 255, 143 / 255],
|
1560
|
+
royalblue: [65 / 255, 105 / 255, 225 / 255],
|
1561
|
+
saddlebrown: [139 / 255, 69 / 255, 19 / 255],
|
1562
|
+
salmon: [250 / 255, 128 / 255, 114 / 255],
|
1563
|
+
sandybrown: [244 / 255, 164 / 255, 96 / 255],
|
1564
|
+
seagreen: [46 / 255, 139 / 255, 87 / 255],
|
1565
|
+
seashell: [1, 245 / 255, 238 / 255],
|
1566
|
+
sienna: [160 / 255, 82 / 255, 45 / 255],
|
1567
|
+
silver: [192 / 255, 192 / 255, 192 / 255],
|
1568
|
+
skyblue: [135 / 255, 206 / 255, 235 / 255],
|
1569
|
+
slateblue: [106 / 255, 90 / 255, 205 / 255],
|
1570
|
+
slategray: [112 / 255, 128 / 255, 144 / 255],
|
1571
|
+
slategrey: [112 / 255, 128 / 255, 144 / 255],
|
1572
|
+
snow: [1, 250 / 255, 250 / 255],
|
1573
|
+
springgreen: [0, 1, 127 / 255],
|
1574
|
+
steelblue: [70 / 255, 130 / 255, 180 / 255],
|
1575
|
+
tan: [210 / 255, 180 / 255, 140 / 255],
|
1576
|
+
teal: [0, 128 / 255, 128 / 255],
|
1577
|
+
thistle: [216 / 255, 191 / 255, 216 / 255],
|
1578
|
+
tomato: [1, 99 / 255, 71 / 255],
|
1579
|
+
turquoise: [64 / 255, 224 / 255, 208 / 255],
|
1580
|
+
violet: [238 / 255, 130 / 255, 238 / 255],
|
1581
|
+
wheat: [245 / 255, 222 / 255, 179 / 255],
|
1582
|
+
white: [1, 1, 1],
|
1583
|
+
whitesmoke: [245 / 255, 245 / 255, 245 / 255],
|
1584
|
+
yellow: [1, 1, 0],
|
1585
|
+
yellowgreen: [154 / 255, 205 / 255, 50 / 255]
|
1586
|
+
};
|
1587
|
+
let Ht = Array(3).fill("<percentage> | <number>[0, 255]"), Tt = Array(3).fill("<number>[0, 255]");
|
1588
|
+
var te = new z({
|
1589
|
+
id: "srgb",
|
1590
|
+
name: "sRGB",
|
1591
|
+
base: A0,
|
1592
|
+
fromBase: (t) => t.map((e) => {
|
1593
|
+
let r = e < 0 ? -1 : 1, n = e * r;
|
1594
|
+
return n > 31308e-7 ? r * (1.055 * n ** (1 / 2.4) - 0.055) : 12.92 * e;
|
1595
|
+
}),
|
1596
|
+
toBase: (t) => t.map((e) => {
|
1597
|
+
let r = e < 0 ? -1 : 1, n = e * r;
|
1598
|
+
return n <= 0.04045 ? e / 12.92 : r * ((n + 0.055) / 1.055) ** 2.4;
|
1599
|
+
}),
|
1600
|
+
formats: {
|
1601
|
+
rgb: {
|
1602
|
+
coords: Ht
|
1603
|
+
},
|
1604
|
+
rgb_number: {
|
1605
|
+
name: "rgb",
|
1606
|
+
commas: !0,
|
1607
|
+
coords: Tt,
|
1608
|
+
noAlpha: !0
|
1609
|
+
},
|
1610
|
+
color: {
|
1611
|
+
/* use defaults */
|
1612
|
+
},
|
1613
|
+
rgba: {
|
1614
|
+
coords: Ht,
|
1615
|
+
commas: !0,
|
1616
|
+
lastAlpha: !0
|
1617
|
+
},
|
1618
|
+
rgba_number: {
|
1619
|
+
name: "rgba",
|
1620
|
+
commas: !0,
|
1621
|
+
coords: Tt
|
1622
|
+
},
|
1623
|
+
hex: {
|
1624
|
+
type: "custom",
|
1625
|
+
toGamut: !0,
|
1626
|
+
test: (t) => /^#([a-f0-9]{3,4}){1,2}$/i.test(t),
|
1627
|
+
parse(t) {
|
1628
|
+
t.length <= 5 && (t = t.replace(/[a-f0-9]/gi, "$&$&"));
|
1629
|
+
let e = [];
|
1630
|
+
return t.replace(/[a-f0-9]{2}/gi, (r) => {
|
1631
|
+
e.push(parseInt(r, 16) / 255);
|
1632
|
+
}), {
|
1633
|
+
spaceId: "srgb",
|
1634
|
+
coords: e.slice(0, 3),
|
1635
|
+
alpha: e.slice(3)[0]
|
1636
|
+
};
|
1637
|
+
},
|
1638
|
+
serialize: (t, e, {
|
1639
|
+
collapse: r = !0
|
1640
|
+
// collapse to 3-4 digit hex when possible?
|
1641
|
+
} = {}) => {
|
1642
|
+
e < 1 && t.push(e), t = t.map((s) => Math.round(s * 255));
|
1643
|
+
let n = r && t.every((s) => s % 17 === 0);
|
1644
|
+
return "#" + t.map((s) => n ? (s / 17).toString(16) : s.toString(16).padStart(2, "0")).join("");
|
1645
|
+
}
|
1646
|
+
},
|
1647
|
+
keyword: {
|
1648
|
+
type: "custom",
|
1649
|
+
test: (t) => /^[a-z]+$/i.test(t),
|
1650
|
+
parse(t) {
|
1651
|
+
t = t.toLowerCase();
|
1652
|
+
let e = { spaceId: "srgb", coords: null, alpha: 1 };
|
1653
|
+
if (t === "transparent" ? (e.coords = kt.black, e.alpha = 0) : e.coords = kt[t], e.coords)
|
1654
|
+
return e;
|
1655
|
+
}
|
1656
|
+
}
|
1657
|
+
}
|
1658
|
+
}), k0 = new z({
|
1659
|
+
id: "p3",
|
1660
|
+
cssId: "display-p3",
|
1661
|
+
name: "P3",
|
1662
|
+
base: v0,
|
1663
|
+
// Gamma encoding/decoding is the same as sRGB
|
1664
|
+
fromBase: te.fromBase,
|
1665
|
+
toBase: te.toBase
|
1666
|
+
});
|
1667
|
+
v.display_space = te;
|
1668
|
+
let an;
|
1669
|
+
if (typeof CSS < "u" && CSS.supports)
|
1670
|
+
for (let t of [E, E0, k0]) {
|
1671
|
+
let e = t.getMinCoords(), n = ie({ space: t, coords: e, alpha: 1 });
|
1672
|
+
if (CSS.supports("color", n)) {
|
1673
|
+
v.display_space = t;
|
1674
|
+
break;
|
1675
|
+
}
|
1676
|
+
}
|
1677
|
+
function sn(t, { space: e = v.display_space, ...r } = {}) {
|
1678
|
+
let n = ie(t, r);
|
1679
|
+
if (typeof CSS > "u" || CSS.supports("color", n) || !v.display_space)
|
1680
|
+
n = new String(n), n.color = t;
|
1681
|
+
else {
|
1682
|
+
let a = t;
|
1683
|
+
if ((t.coords.some(X) || X(t.alpha)) && !(an ?? (an = CSS.supports("color", "hsl(none 50% 50%)"))) && (a = V(t), a.coords = a.coords.map(R), a.alpha = R(a.alpha), n = ie(a, r), CSS.supports("color", n)))
|
1684
|
+
return n = new String(n), n.color = a, n;
|
1685
|
+
a = C(a, e), n = new String(ie(a, r)), n.color = a;
|
1686
|
+
}
|
1687
|
+
return n;
|
1688
|
+
}
|
1689
|
+
function on(t, e) {
|
1690
|
+
return t = b(t), e = b(e), t.space === e.space && t.alpha === e.alpha && t.coords.every((r, n) => r === e.coords[n]);
|
1691
|
+
}
|
1692
|
+
function Z(t) {
|
1693
|
+
return P(t, [N, "y"]);
|
1694
|
+
}
|
1695
|
+
function H0(t, e) {
|
1696
|
+
O(t, [N, "y"], e);
|
1697
|
+
}
|
1698
|
+
function ln(t) {
|
1699
|
+
Object.defineProperty(t.prototype, "luminance", {
|
1700
|
+
get() {
|
1701
|
+
return Z(this);
|
1702
|
+
},
|
1703
|
+
set(e) {
|
1704
|
+
H0(this, e);
|
1705
|
+
}
|
1706
|
+
});
|
1707
|
+
}
|
1708
|
+
var cn = /* @__PURE__ */ Object.freeze({
|
1709
|
+
__proto__: null,
|
1710
|
+
getLuminance: Z,
|
1711
|
+
register: ln,
|
1712
|
+
setLuminance: H0
|
1713
|
+
});
|
1714
|
+
function un(t, e) {
|
1715
|
+
t = b(t), e = b(e);
|
1716
|
+
let r = Math.max(Z(t), 0), n = Math.max(Z(e), 0);
|
1717
|
+
return n > r && ([r, n] = [n, r]), (r + 0.05) / (n + 0.05);
|
1718
|
+
}
|
1719
|
+
const fn = 0.56, hn = 0.57, dn = 0.62, mn = 0.65, Ot = 0.022, gn = 1.414, pn = 0.1, bn = 5e-4, Mn = 1.14, Yt = 0.027, wn = 1.14;
|
1720
|
+
function Dt(t) {
|
1721
|
+
return t >= Ot ? t : t + (Ot - t) ** gn;
|
1722
|
+
}
|
1723
|
+
function W(t) {
|
1724
|
+
let e = t < 0 ? -1 : 1, r = Math.abs(t);
|
1725
|
+
return e * Math.pow(r, 2.4);
|
1726
|
+
}
|
1727
|
+
function yn(t, e) {
|
1728
|
+
e = b(e), t = b(t);
|
1729
|
+
let r, n, a, s, i, o;
|
1730
|
+
e = C(e, "srgb"), [s, i, o] = e.coords;
|
1731
|
+
let l = W(s) * 0.2126729 + W(i) * 0.7151522 + W(o) * 0.072175;
|
1732
|
+
t = C(t, "srgb"), [s, i, o] = t.coords;
|
1733
|
+
let c = W(s) * 0.2126729 + W(i) * 0.7151522 + W(o) * 0.072175, u = Dt(l), f = Dt(c), h = f > u;
|
1734
|
+
return Math.abs(f - u) < bn ? n = 0 : h ? (r = f ** fn - u ** hn, n = r * Mn) : (r = f ** mn - u ** dn, n = r * wn), Math.abs(n) < pn ? a = 0 : n > 0 ? a = n - Yt : a = n + Yt, a * 100;
|
1735
|
+
}
|
1736
|
+
function Cn(t, e) {
|
1737
|
+
t = b(t), e = b(e);
|
1738
|
+
let r = Math.max(Z(t), 0), n = Math.max(Z(e), 0);
|
1739
|
+
n > r && ([r, n] = [n, r]);
|
1740
|
+
let a = r + n;
|
1741
|
+
return a === 0 ? 0 : (r - n) / a;
|
1742
|
+
}
|
1743
|
+
const Ln = 5e4;
|
1744
|
+
function Sn(t, e) {
|
1745
|
+
t = b(t), e = b(e);
|
1746
|
+
let r = Math.max(Z(t), 0), n = Math.max(Z(e), 0);
|
1747
|
+
return n > r && ([r, n] = [n, r]), n === 0 ? Ln : (r - n) / n;
|
1748
|
+
}
|
1749
|
+
function _n(t, e) {
|
1750
|
+
t = b(t), e = b(e);
|
1751
|
+
let r = P(t, [E, "l"]), n = P(e, [E, "l"]);
|
1752
|
+
return Math.abs(r - n);
|
1753
|
+
}
|
1754
|
+
const Rn = 216 / 24389, Xt = 24 / 116, Ce = 24389 / 27;
|
1755
|
+
let Te = B.D65;
|
1756
|
+
var Ue = new m({
|
1757
|
+
id: "lab-d65",
|
1758
|
+
name: "Lab D65",
|
1759
|
+
coords: {
|
1760
|
+
l: {
|
1761
|
+
refRange: [0, 100],
|
1762
|
+
name: "Lightness"
|
1763
|
+
},
|
1764
|
+
a: {
|
1765
|
+
refRange: [-125, 125]
|
1766
|
+
},
|
1767
|
+
b: {
|
1768
|
+
refRange: [-125, 125]
|
1769
|
+
}
|
1770
|
+
},
|
1771
|
+
// Assuming XYZ is relative to D65, convert to CIE Lab
|
1772
|
+
// from CIE standard, which now defines these as a rational fraction
|
1773
|
+
white: Te,
|
1774
|
+
base: N,
|
1775
|
+
// Convert D65-adapted XYZ to Lab
|
1776
|
+
// CIE 15.3:2004 section 8.2.1.1
|
1777
|
+
fromBase(t) {
|
1778
|
+
let r = t.map((n, a) => n / Te[a]).map((n) => n > Rn ? Math.cbrt(n) : (Ce * n + 16) / 116);
|
1779
|
+
return [
|
1780
|
+
116 * r[1] - 16,
|
1781
|
+
// L
|
1782
|
+
500 * (r[0] - r[1]),
|
1783
|
+
// a
|
1784
|
+
200 * (r[1] - r[2])
|
1785
|
+
// b
|
1786
|
+
];
|
1787
|
+
},
|
1788
|
+
// Convert Lab to D65-adapted XYZ
|
1789
|
+
// Same result as CIE 15.3:2004 Appendix D although the derivation is different
|
1790
|
+
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
|
1791
|
+
toBase(t) {
|
1792
|
+
let e = [];
|
1793
|
+
return e[1] = (t[0] + 16) / 116, e[0] = t[1] / 500 + e[1], e[2] = e[1] - t[2] / 200, [
|
1794
|
+
e[0] > Xt ? Math.pow(e[0], 3) : (116 * e[0] - 16) / Ce,
|
1795
|
+
t[0] > 8 ? Math.pow((t[0] + 16) / 116, 3) : t[0] / Ce,
|
1796
|
+
e[2] > Xt ? Math.pow(e[2], 3) : (116 * e[2] - 16) / Ce
|
1797
|
+
].map((n, a) => n * Te[a]);
|
1798
|
+
},
|
1799
|
+
formats: {
|
1800
|
+
"lab-d65": {
|
1801
|
+
coords: ["<number> | <percentage>", "<number> | <percentage>[-1,1]", "<number> | <percentage>[-1,1]"]
|
1802
|
+
}
|
1803
|
+
}
|
1804
|
+
});
|
1805
|
+
const Oe = Math.pow(5, 0.5) * 0.5 + 0.5;
|
1806
|
+
function xn(t, e) {
|
1807
|
+
t = b(t), e = b(e);
|
1808
|
+
let r = P(t, [Ue, "l"]), n = P(e, [Ue, "l"]), a = Math.abs(Math.pow(r, Oe) - Math.pow(n, Oe)), s = Math.pow(a, 1 / Oe) * Math.SQRT2 - 40;
|
1809
|
+
return s < 7.5 ? 0 : s;
|
1810
|
+
}
|
1811
|
+
var _e = /* @__PURE__ */ Object.freeze({
|
1812
|
+
__proto__: null,
|
1813
|
+
contrastAPCA: yn,
|
1814
|
+
contrastDeltaPhi: xn,
|
1815
|
+
contrastLstar: _n,
|
1816
|
+
contrastMichelson: Cn,
|
1817
|
+
contrastWCAG21: un,
|
1818
|
+
contrastWeber: Sn
|
1819
|
+
});
|
1820
|
+
function Nn(t, e, r = {}) {
|
1821
|
+
ue(r) && (r = { algorithm: r });
|
1822
|
+
let { algorithm: n, ...a } = r;
|
1823
|
+
if (!n) {
|
1824
|
+
let s = Object.keys(_e).map((i) => i.replace(/^contrast/, "")).join(", ");
|
1825
|
+
throw new TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${s}`);
|
1826
|
+
}
|
1827
|
+
t = b(t), e = b(e);
|
1828
|
+
for (let s in _e)
|
1829
|
+
if ("contrast" + n.toLowerCase() === s.toLowerCase())
|
1830
|
+
return _e[s](t, e, a);
|
1831
|
+
throw new TypeError(`Unknown contrast algorithm: ${n}`);
|
1832
|
+
}
|
1833
|
+
function $e(t) {
|
1834
|
+
let [e, r, n] = fe(t, N), a = e + 15 * r + 3 * n;
|
1835
|
+
return [4 * e / a, 9 * r / a];
|
1836
|
+
}
|
1837
|
+
function T0(t) {
|
1838
|
+
let [e, r, n] = fe(t, N), a = e + r + n;
|
1839
|
+
return [e / a, r / a];
|
1840
|
+
}
|
1841
|
+
function Bn(t) {
|
1842
|
+
Object.defineProperty(t.prototype, "uv", {
|
1843
|
+
get() {
|
1844
|
+
return $e(this);
|
1845
|
+
}
|
1846
|
+
}), Object.defineProperty(t.prototype, "xy", {
|
1847
|
+
get() {
|
1848
|
+
return T0(this);
|
1849
|
+
}
|
1850
|
+
});
|
1851
|
+
}
|
1852
|
+
var In = /* @__PURE__ */ Object.freeze({
|
1853
|
+
__proto__: null,
|
1854
|
+
register: Bn,
|
1855
|
+
uv: $e,
|
1856
|
+
xy: T0
|
1857
|
+
});
|
1858
|
+
function se(t, e, r = {}) {
|
1859
|
+
ue(r) && (r = { method: r });
|
1860
|
+
let { method: n = v.deltaE, ...a } = r;
|
1861
|
+
for (let s in ee)
|
1862
|
+
if ("deltae" + n.toLowerCase() === s.toLowerCase())
|
1863
|
+
return ee[s](t, e, a);
|
1864
|
+
throw new TypeError(`Unknown deltaE method: ${n}`);
|
1865
|
+
}
|
1866
|
+
function zn(t, e = 0.25) {
|
1867
|
+
let n = [m.get("oklch", "lch"), "l"];
|
1868
|
+
return O(t, n, (a) => a * (1 + e));
|
1869
|
+
}
|
1870
|
+
function $n(t, e = 0.25) {
|
1871
|
+
let n = [m.get("oklch", "lch"), "l"];
|
1872
|
+
return O(t, n, (a) => a * (1 - e));
|
1873
|
+
}
|
1874
|
+
var Pn = /* @__PURE__ */ Object.freeze({
|
1875
|
+
__proto__: null,
|
1876
|
+
darken: $n,
|
1877
|
+
lighten: zn
|
1878
|
+
});
|
1879
|
+
function O0(t, e, r = 0.5, n = {}) {
|
1880
|
+
return [t, e] = [b(t), b(e)], D(r) === "object" && ([r, n] = [0.5, r]), he(t, e, n)(r);
|
1881
|
+
}
|
1882
|
+
function Y0(t, e, r = {}) {
|
1883
|
+
let n;
|
1884
|
+
st(t) && ([n, r] = [t, e], [t, e] = n.rangeArgs.colors);
|
1885
|
+
let {
|
1886
|
+
maxDeltaE: a,
|
1887
|
+
deltaEMethod: s,
|
1888
|
+
steps: i = 2,
|
1889
|
+
maxSteps: o = 1e3,
|
1890
|
+
...l
|
1891
|
+
} = r;
|
1892
|
+
n || ([t, e] = [b(t), b(e)], n = he(t, e, l));
|
1893
|
+
let c = se(t, e), u = a > 0 ? Math.max(i, Math.ceil(c / a) + 1) : i, f = [];
|
1894
|
+
if (o !== void 0 && (u = Math.min(u, o)), u === 1)
|
1895
|
+
f = [{ p: 0.5, color: n(0.5) }];
|
1896
|
+
else {
|
1897
|
+
let h = 1 / (u - 1);
|
1898
|
+
f = Array.from({ length: u }, (p, d) => {
|
1899
|
+
let g = d * h;
|
1900
|
+
return { p: g, color: n(g) };
|
1901
|
+
});
|
1902
|
+
}
|
1903
|
+
if (a > 0) {
|
1904
|
+
let h = f.reduce((p, d, g) => {
|
1905
|
+
if (g === 0)
|
1906
|
+
return 0;
|
1907
|
+
let M = se(d.color, f[g - 1].color, s);
|
1908
|
+
return Math.max(p, M);
|
1909
|
+
}, 0);
|
1910
|
+
for (; h > a; ) {
|
1911
|
+
h = 0;
|
1912
|
+
for (let p = 1; p < f.length && f.length < o; p++) {
|
1913
|
+
let d = f[p - 1], g = f[p], M = (g.p + d.p) / 2, _ = n(M);
|
1914
|
+
h = Math.max(h, se(_, d.color), se(_, g.color)), f.splice(p, 0, { p: M, color: n(M) }), p++;
|
1915
|
+
}
|
1916
|
+
}
|
1917
|
+
}
|
1918
|
+
return f = f.map((h) => h.color), f;
|
1919
|
+
}
|
1920
|
+
function he(t, e, r = {}) {
|
1921
|
+
if (st(t)) {
|
1922
|
+
let [l, c] = [t, e];
|
1923
|
+
return he(...l.rangeArgs.colors, { ...l.rangeArgs.options, ...c });
|
1924
|
+
}
|
1925
|
+
let { space: n, outputSpace: a, progression: s, premultiplied: i } = r;
|
1926
|
+
t = b(t), e = b(e), t = V(t), e = V(e);
|
1927
|
+
let o = { colors: [t, e], options: r };
|
1928
|
+
if (n ? n = m.get(n) : n = m.registry[v.interpolationSpace] || t.space, a = a ? m.get(a) : n, t = C(t, n), e = C(e, n), t = q(t), e = q(e), n.coords.h && n.coords.h.type === "angle") {
|
1929
|
+
let l = r.hue = r.hue || "shorter", c = [n, "h"], [u, f] = [P(t, c), P(e, c)];
|
1930
|
+
isNaN(u) && !isNaN(f) ? u = f : isNaN(f) && !isNaN(u) && (f = u), [u, f] = ur(l, [u, f]), O(t, c, u), O(e, c, f);
|
1931
|
+
}
|
1932
|
+
return i && (t.coords = t.coords.map((l) => l * t.alpha), e.coords = e.coords.map((l) => l * e.alpha)), Object.assign((l) => {
|
1933
|
+
l = s ? s(l) : l;
|
1934
|
+
let c = t.coords.map((h, p) => {
|
1935
|
+
let d = e.coords[p];
|
1936
|
+
return oe(h, d, l);
|
1937
|
+
}), u = oe(t.alpha, e.alpha, l), f = { space: n, coords: c, alpha: u };
|
1938
|
+
return i && (f.coords = f.coords.map((h) => h / u)), a !== n && (f = C(f, a)), f;
|
1939
|
+
}, {
|
1940
|
+
rangeArgs: o
|
1941
|
+
});
|
1942
|
+
}
|
1943
|
+
function st(t) {
|
1944
|
+
return D(t) === "function" && !!t.rangeArgs;
|
1945
|
+
}
|
1946
|
+
v.interpolationSpace = "lab";
|
1947
|
+
function En(t) {
|
1948
|
+
t.defineFunction("mix", O0, { returns: "color" }), t.defineFunction("range", he, { returns: "function<color>" }), t.defineFunction("steps", Y0, { returns: "array<color>" });
|
1949
|
+
}
|
1950
|
+
var vn = /* @__PURE__ */ Object.freeze({
|
1951
|
+
__proto__: null,
|
1952
|
+
isRange: st,
|
1953
|
+
mix: O0,
|
1954
|
+
range: he,
|
1955
|
+
register: En,
|
1956
|
+
steps: Y0
|
1957
|
+
}), D0 = new m({
|
1958
|
+
id: "hsl",
|
1959
|
+
name: "HSL",
|
1960
|
+
coords: {
|
1961
|
+
h: {
|
1962
|
+
refRange: [0, 360],
|
1963
|
+
type: "angle",
|
1964
|
+
name: "Hue"
|
1965
|
+
},
|
1966
|
+
s: {
|
1967
|
+
range: [0, 100],
|
1968
|
+
name: "Saturation"
|
1969
|
+
},
|
1970
|
+
l: {
|
1971
|
+
range: [0, 100],
|
1972
|
+
name: "Lightness"
|
1973
|
+
}
|
1974
|
+
},
|
1975
|
+
base: te,
|
1976
|
+
// Adapted from https://drafts.csswg.org/css-color-4/better-rgbToHsl.js
|
1977
|
+
fromBase: (t) => {
|
1978
|
+
let e = Math.max(...t), r = Math.min(...t), [n, a, s] = t, [i, o, l] = [NaN, 0, (r + e) / 2], c = e - r;
|
1979
|
+
if (c !== 0) {
|
1980
|
+
switch (o = l === 0 || l === 1 ? 0 : (e - l) / Math.min(l, 1 - l), e) {
|
1981
|
+
case n:
|
1982
|
+
i = (a - s) / c + (a < s ? 6 : 0);
|
1983
|
+
break;
|
1984
|
+
case a:
|
1985
|
+
i = (s - n) / c + 2;
|
1986
|
+
break;
|
1987
|
+
case s:
|
1988
|
+
i = (n - a) / c + 4;
|
1989
|
+
}
|
1990
|
+
i = i * 60;
|
1991
|
+
}
|
1992
|
+
return o < 0 && (i += 180, o = Math.abs(o)), i >= 360 && (i -= 360), [i, o * 100, l * 100];
|
1993
|
+
},
|
1994
|
+
// Adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative
|
1995
|
+
toBase: (t) => {
|
1996
|
+
let [e, r, n] = t;
|
1997
|
+
e = e % 360, e < 0 && (e += 360), r /= 100, n /= 100;
|
1998
|
+
function a(s) {
|
1999
|
+
let i = (s + e / 30) % 12, o = r * Math.min(n, 1 - n);
|
2000
|
+
return n - o * Math.max(-1, Math.min(i - 3, 9 - i, 1));
|
2001
|
+
}
|
2002
|
+
return [a(0), a(8), a(4)];
|
2003
|
+
},
|
2004
|
+
formats: {
|
2005
|
+
hsl: {
|
2006
|
+
coords: ["<number> | <angle>", "<percentage>", "<percentage>"]
|
2007
|
+
},
|
2008
|
+
hsla: {
|
2009
|
+
coords: ["<number> | <angle>", "<percentage>", "<percentage>"],
|
2010
|
+
commas: !0,
|
2011
|
+
lastAlpha: !0
|
2012
|
+
}
|
2013
|
+
}
|
2014
|
+
}), X0 = new m({
|
2015
|
+
id: "hsv",
|
2016
|
+
name: "HSV",
|
2017
|
+
coords: {
|
2018
|
+
h: {
|
2019
|
+
refRange: [0, 360],
|
2020
|
+
type: "angle",
|
2021
|
+
name: "Hue"
|
2022
|
+
},
|
2023
|
+
s: {
|
2024
|
+
range: [0, 100],
|
2025
|
+
name: "Saturation"
|
2026
|
+
},
|
2027
|
+
v: {
|
2028
|
+
range: [0, 100],
|
2029
|
+
name: "Value"
|
2030
|
+
}
|
2031
|
+
},
|
2032
|
+
base: D0,
|
2033
|
+
// https://en.wikipedia.org/wiki/HSL_and_HSV#Interconversion
|
2034
|
+
fromBase(t) {
|
2035
|
+
let [e, r, n] = t;
|
2036
|
+
r /= 100, n /= 100;
|
2037
|
+
let a = n + r * Math.min(n, 1 - n);
|
2038
|
+
return [
|
2039
|
+
e,
|
2040
|
+
// h is the same
|
2041
|
+
a === 0 ? 0 : 200 * (1 - n / a),
|
2042
|
+
// s
|
2043
|
+
100 * a
|
2044
|
+
];
|
2045
|
+
},
|
2046
|
+
// https://en.wikipedia.org/wiki/HSL_and_HSV#Interconversion
|
2047
|
+
toBase(t) {
|
2048
|
+
let [e, r, n] = t;
|
2049
|
+
r /= 100, n /= 100;
|
2050
|
+
let a = n * (1 - r / 2);
|
2051
|
+
return [
|
2052
|
+
e,
|
2053
|
+
// h is the same
|
2054
|
+
a === 0 || a === 1 ? 0 : (n - a) / Math.min(a, 1 - a) * 100,
|
2055
|
+
a * 100
|
2056
|
+
];
|
2057
|
+
},
|
2058
|
+
formats: {
|
2059
|
+
color: {
|
2060
|
+
id: "--hsv",
|
2061
|
+
coords: ["<number> | <angle>", "<percentage> | <number>", "<percentage> | <number>"]
|
2062
|
+
}
|
2063
|
+
}
|
2064
|
+
}), An = new m({
|
2065
|
+
id: "hwb",
|
2066
|
+
name: "HWB",
|
2067
|
+
coords: {
|
2068
|
+
h: {
|
2069
|
+
refRange: [0, 360],
|
2070
|
+
type: "angle",
|
2071
|
+
name: "Hue"
|
2072
|
+
},
|
2073
|
+
w: {
|
2074
|
+
range: [0, 100],
|
2075
|
+
name: "Whiteness"
|
2076
|
+
},
|
2077
|
+
b: {
|
2078
|
+
range: [0, 100],
|
2079
|
+
name: "Blackness"
|
2080
|
+
}
|
2081
|
+
},
|
2082
|
+
base: X0,
|
2083
|
+
fromBase(t) {
|
2084
|
+
let [e, r, n] = t;
|
2085
|
+
return [e, n * (100 - r) / 100, 100 - n];
|
2086
|
+
},
|
2087
|
+
toBase(t) {
|
2088
|
+
let [e, r, n] = t;
|
2089
|
+
r /= 100, n /= 100;
|
2090
|
+
let a = r + n;
|
2091
|
+
if (a >= 1) {
|
2092
|
+
let o = r / a;
|
2093
|
+
return [e, 0, o * 100];
|
2094
|
+
}
|
2095
|
+
let s = 1 - n, i = s === 0 ? 0 : 1 - r / s;
|
2096
|
+
return [e, i * 100, s * 100];
|
2097
|
+
},
|
2098
|
+
formats: {
|
2099
|
+
hwb: {
|
2100
|
+
coords: ["<number> | <angle>", "<percentage> | <number>", "<percentage> | <number>"]
|
2101
|
+
}
|
2102
|
+
}
|
2103
|
+
});
|
2104
|
+
const kn = [
|
2105
|
+
[0.5766690429101305, 0.1855582379065463, 0.1882286462349947],
|
2106
|
+
[0.29734497525053605, 0.6273635662554661, 0.07529145849399788],
|
2107
|
+
[0.02703136138641234, 0.07068885253582723, 0.9913375368376388]
|
2108
|
+
], Hn = [
|
2109
|
+
[2.0415879038107465, -0.5650069742788596, -0.34473135077832956],
|
2110
|
+
[-0.9692436362808795, 1.8759675015077202, 0.04155505740717557],
|
2111
|
+
[0.013444280632031142, -0.11836239223101838, 1.0151749943912054]
|
2112
|
+
];
|
2113
|
+
var j0 = new z({
|
2114
|
+
id: "a98rgb-linear",
|
2115
|
+
cssId: "--a98-rgb-linear",
|
2116
|
+
name: "Linear Adobe® 98 RGB compatible",
|
2117
|
+
white: "D65",
|
2118
|
+
toXYZ_M: kn,
|
2119
|
+
fromXYZ_M: Hn
|
2120
|
+
}), Tn = new z({
|
2121
|
+
id: "a98rgb",
|
2122
|
+
cssId: "a98-rgb",
|
2123
|
+
name: "Adobe® 98 RGB compatible",
|
2124
|
+
base: j0,
|
2125
|
+
toBase: (t) => t.map((e) => Math.pow(Math.abs(e), 563 / 256) * Math.sign(e)),
|
2126
|
+
fromBase: (t) => t.map((e) => Math.pow(Math.abs(e), 256 / 563) * Math.sign(e))
|
2127
|
+
});
|
2128
|
+
const On = [
|
2129
|
+
[0.7977666449006423, 0.13518129740053308, 0.0313477341283922],
|
2130
|
+
[0.2880748288194013, 0.711835234241873, 8993693872564e-17],
|
2131
|
+
[0, 0, 0.8251046025104602]
|
2132
|
+
], Yn = [
|
2133
|
+
[1.3457868816471583, -0.25557208737979464, -0.05110186497554526],
|
2134
|
+
[-0.5446307051249019, 1.5082477428451468, 0.02052744743642139],
|
2135
|
+
[0, 0, 1.2119675456389452]
|
2136
|
+
];
|
2137
|
+
var q0 = new z({
|
2138
|
+
id: "prophoto-linear",
|
2139
|
+
cssId: "--prophoto-rgb-linear",
|
2140
|
+
name: "Linear ProPhoto",
|
2141
|
+
white: "D50",
|
2142
|
+
base: rt,
|
2143
|
+
toXYZ_M: On,
|
2144
|
+
fromXYZ_M: Yn
|
2145
|
+
});
|
2146
|
+
const Dn = 1 / 512, Xn = 16 / 512;
|
2147
|
+
var jn = new z({
|
2148
|
+
id: "prophoto",
|
2149
|
+
cssId: "prophoto-rgb",
|
2150
|
+
name: "ProPhoto",
|
2151
|
+
base: q0,
|
2152
|
+
toBase(t) {
|
2153
|
+
return t.map((e) => e < Xn ? e / 16 : e ** 1.8);
|
2154
|
+
},
|
2155
|
+
fromBase(t) {
|
2156
|
+
return t.map((e) => e >= Dn ? e ** (1 / 1.8) : 16 * e);
|
2157
|
+
}
|
2158
|
+
}), qn = new m({
|
2159
|
+
id: "oklch",
|
2160
|
+
name: "Oklch",
|
2161
|
+
coords: {
|
2162
|
+
l: {
|
2163
|
+
refRange: [0, 1],
|
2164
|
+
name: "Lightness"
|
2165
|
+
},
|
2166
|
+
c: {
|
2167
|
+
refRange: [0, 0.4],
|
2168
|
+
name: "Chroma"
|
2169
|
+
},
|
2170
|
+
h: {
|
2171
|
+
refRange: [0, 360],
|
2172
|
+
type: "angle",
|
2173
|
+
name: "Hue"
|
2174
|
+
}
|
2175
|
+
},
|
2176
|
+
white: "D65",
|
2177
|
+
base: K,
|
2178
|
+
fromBase(t) {
|
2179
|
+
let [e, r, n] = t, a;
|
2180
|
+
const s = 2e-4;
|
2181
|
+
return Math.abs(r) < s && Math.abs(n) < s ? a = NaN : a = Math.atan2(n, r) * 180 / Math.PI, [
|
2182
|
+
e,
|
2183
|
+
// OKLab L is still L
|
2184
|
+
Math.sqrt(r ** 2 + n ** 2),
|
2185
|
+
// Chroma
|
2186
|
+
H(a)
|
2187
|
+
// Hue, in degrees [0 to 360)
|
2188
|
+
];
|
2189
|
+
},
|
2190
|
+
// Convert from polar form
|
2191
|
+
toBase(t) {
|
2192
|
+
let [e, r, n] = t, a, s;
|
2193
|
+
return isNaN(n) ? (a = 0, s = 0) : (a = r * Math.cos(n * Math.PI / 180), s = r * Math.sin(n * Math.PI / 180)), [e, a, s];
|
2194
|
+
},
|
2195
|
+
formats: {
|
2196
|
+
oklch: {
|
2197
|
+
coords: ["<percentage> | <number>", "<number> | <percentage>[0,1]", "<number> | <angle>"]
|
2198
|
+
}
|
2199
|
+
}
|
2200
|
+
});
|
2201
|
+
let Z0 = B.D65;
|
2202
|
+
const Zn = 216 / 24389, jt = 24389 / 27, [qt, Zt] = $e({ space: N, coords: Z0 });
|
2203
|
+
var G0 = new m({
|
2204
|
+
id: "luv",
|
2205
|
+
name: "Luv",
|
2206
|
+
coords: {
|
2207
|
+
l: {
|
2208
|
+
refRange: [0, 100],
|
2209
|
+
name: "Lightness"
|
2210
|
+
},
|
2211
|
+
// Reference ranges from https://facelessuser.github.io/coloraide/colors/luv/
|
2212
|
+
u: {
|
2213
|
+
refRange: [-215, 215]
|
2214
|
+
},
|
2215
|
+
v: {
|
2216
|
+
refRange: [-215, 215]
|
2217
|
+
}
|
2218
|
+
},
|
2219
|
+
white: Z0,
|
2220
|
+
base: N,
|
2221
|
+
// Convert D65-adapted XYZ to Luv
|
2222
|
+
// https://en.wikipedia.org/wiki/CIELUV#The_forward_transformation
|
2223
|
+
fromBase(t) {
|
2224
|
+
let e = [R(t[0]), R(t[1]), R(t[2])], r = e[1], [n, a] = $e({ space: N, coords: e });
|
2225
|
+
if (!Number.isFinite(n) || !Number.isFinite(a))
|
2226
|
+
return [0, 0, 0];
|
2227
|
+
let s = r <= Zn ? jt * r : 116 * Math.cbrt(r) - 16;
|
2228
|
+
return [
|
2229
|
+
s,
|
2230
|
+
13 * s * (n - qt),
|
2231
|
+
13 * s * (a - Zt)
|
2232
|
+
];
|
2233
|
+
},
|
2234
|
+
// Convert Luv to D65-adapted XYZ
|
2235
|
+
// https://en.wikipedia.org/wiki/CIELUV#The_reverse_transformation
|
2236
|
+
toBase(t) {
|
2237
|
+
let [e, r, n] = t;
|
2238
|
+
if (e === 0 || X(e))
|
2239
|
+
return [0, 0, 0];
|
2240
|
+
r = R(r), n = R(n);
|
2241
|
+
let a = r / (13 * e) + qt, s = n / (13 * e) + Zt, i = e <= 8 ? e / jt : Math.pow((e + 16) / 116, 3);
|
2242
|
+
return [
|
2243
|
+
i * (9 * a / (4 * s)),
|
2244
|
+
i,
|
2245
|
+
i * ((12 - 3 * a - 20 * s) / (4 * s))
|
2246
|
+
];
|
2247
|
+
},
|
2248
|
+
formats: {
|
2249
|
+
color: {
|
2250
|
+
id: "--luv",
|
2251
|
+
coords: ["<number> | <percentage>", "<number> | <percentage>[-1,1]", "<number> | <percentage>[-1,1]"]
|
2252
|
+
}
|
2253
|
+
}
|
2254
|
+
}), it = new m({
|
2255
|
+
id: "lchuv",
|
2256
|
+
name: "LChuv",
|
2257
|
+
coords: {
|
2258
|
+
l: {
|
2259
|
+
refRange: [0, 100],
|
2260
|
+
name: "Lightness"
|
2261
|
+
},
|
2262
|
+
c: {
|
2263
|
+
refRange: [0, 220],
|
2264
|
+
name: "Chroma"
|
2265
|
+
},
|
2266
|
+
h: {
|
2267
|
+
refRange: [0, 360],
|
2268
|
+
type: "angle",
|
2269
|
+
name: "Hue"
|
2270
|
+
}
|
2271
|
+
},
|
2272
|
+
base: G0,
|
2273
|
+
fromBase(t) {
|
2274
|
+
let [e, r, n] = t, a;
|
2275
|
+
const s = 0.02;
|
2276
|
+
return Math.abs(r) < s && Math.abs(n) < s ? a = NaN : a = Math.atan2(n, r) * 180 / Math.PI, [
|
2277
|
+
e,
|
2278
|
+
// L is still L
|
2279
|
+
Math.sqrt(r ** 2 + n ** 2),
|
2280
|
+
// Chroma
|
2281
|
+
H(a)
|
2282
|
+
// Hue, in degrees [0 to 360)
|
2283
|
+
];
|
2284
|
+
},
|
2285
|
+
toBase(t) {
|
2286
|
+
let [e, r, n] = t;
|
2287
|
+
return r < 0 && (r = 0), isNaN(n) && (n = 0), [
|
2288
|
+
e,
|
2289
|
+
// L is still L
|
2290
|
+
r * Math.cos(n * Math.PI / 180),
|
2291
|
+
// u
|
2292
|
+
r * Math.sin(n * Math.PI / 180)
|
2293
|
+
// v
|
2294
|
+
];
|
2295
|
+
},
|
2296
|
+
formats: {
|
2297
|
+
color: {
|
2298
|
+
id: "--lchuv",
|
2299
|
+
coords: ["<number> | <percentage>", "<number> | <percentage>", "<number> | <angle>"]
|
2300
|
+
}
|
2301
|
+
}
|
2302
|
+
});
|
2303
|
+
const Gn = 216 / 24389, Jn = 24389 / 27, Gt = x[0][0], Jt = x[0][1], Ye = x[0][2], Ft = x[1][0], Wt = x[1][1], De = x[1][2], Qt = x[2][0], Ut = x[2][1], Xe = x[2][2];
|
2304
|
+
function Q(t, e, r) {
|
2305
|
+
const n = e / (Math.sin(r) - t * Math.cos(r));
|
2306
|
+
return n < 0 ? 1 / 0 : n;
|
2307
|
+
}
|
2308
|
+
function Be(t) {
|
2309
|
+
const e = Math.pow(t + 16, 3) / 1560896, r = e > Gn ? e : t / Jn, n = r * (284517 * Gt - 94839 * Ye), a = r * (838422 * Ye + 769860 * Jt + 731718 * Gt), s = r * (632260 * Ye - 126452 * Jt), i = r * (284517 * Ft - 94839 * De), o = r * (838422 * De + 769860 * Wt + 731718 * Ft), l = r * (632260 * De - 126452 * Wt), c = r * (284517 * Qt - 94839 * Xe), u = r * (838422 * Xe + 769860 * Ut + 731718 * Qt), f = r * (632260 * Xe - 126452 * Ut);
|
2310
|
+
return {
|
2311
|
+
r0s: n / s,
|
2312
|
+
r0i: a * t / s,
|
2313
|
+
r1s: n / (s + 126452),
|
2314
|
+
r1i: (a - 769860) * t / (s + 126452),
|
2315
|
+
g0s: i / l,
|
2316
|
+
g0i: o * t / l,
|
2317
|
+
g1s: i / (l + 126452),
|
2318
|
+
g1i: (o - 769860) * t / (l + 126452),
|
2319
|
+
b0s: c / f,
|
2320
|
+
b0i: u * t / f,
|
2321
|
+
b1s: c / (f + 126452),
|
2322
|
+
b1i: (u - 769860) * t / (f + 126452)
|
2323
|
+
};
|
2324
|
+
}
|
2325
|
+
function Kt(t, e) {
|
2326
|
+
const r = e / 360 * Math.PI * 2, n = Q(t.r0s, t.r0i, r), a = Q(t.r1s, t.r1i, r), s = Q(t.g0s, t.g0i, r), i = Q(t.g1s, t.g1i, r), o = Q(t.b0s, t.b0i, r), l = Q(t.b1s, t.b1i, r);
|
2327
|
+
return Math.min(n, a, s, i, o, l);
|
2328
|
+
}
|
2329
|
+
var Fn = new m({
|
2330
|
+
id: "hsluv",
|
2331
|
+
name: "HSLuv",
|
2332
|
+
coords: {
|
2333
|
+
h: {
|
2334
|
+
refRange: [0, 360],
|
2335
|
+
type: "angle",
|
2336
|
+
name: "Hue"
|
2337
|
+
},
|
2338
|
+
s: {
|
2339
|
+
range: [0, 100],
|
2340
|
+
name: "Saturation"
|
2341
|
+
},
|
2342
|
+
l: {
|
2343
|
+
range: [0, 100],
|
2344
|
+
name: "Lightness"
|
2345
|
+
}
|
2346
|
+
},
|
2347
|
+
base: it,
|
2348
|
+
gamutSpace: te,
|
2349
|
+
// Convert LCHuv to HSLuv
|
2350
|
+
fromBase(t) {
|
2351
|
+
let [e, r, n] = [R(t[0]), R(t[1]), R(t[2])], a;
|
2352
|
+
if (e > 99.9999999)
|
2353
|
+
a = 0, e = 100;
|
2354
|
+
else if (e < 1e-8)
|
2355
|
+
a = 0, e = 0;
|
2356
|
+
else {
|
2357
|
+
let s = Be(e), i = Kt(s, n);
|
2358
|
+
a = r / i * 100;
|
2359
|
+
}
|
2360
|
+
return [n, a, e];
|
2361
|
+
},
|
2362
|
+
// Convert HSLuv to LCHuv
|
2363
|
+
toBase(t) {
|
2364
|
+
let [e, r, n] = [R(t[0]), R(t[1]), R(t[2])], a;
|
2365
|
+
if (n > 99.9999999)
|
2366
|
+
n = 100, a = 0;
|
2367
|
+
else if (n < 1e-8)
|
2368
|
+
n = 0, a = 0;
|
2369
|
+
else {
|
2370
|
+
let s = Be(n);
|
2371
|
+
a = Kt(s, e) / 100 * r;
|
2372
|
+
}
|
2373
|
+
return [n, a, e];
|
2374
|
+
},
|
2375
|
+
formats: {
|
2376
|
+
color: {
|
2377
|
+
id: "--hsluv",
|
2378
|
+
coords: ["<number> | <angle>", "<percentage> | <number>", "<percentage> | <number>"]
|
2379
|
+
}
|
2380
|
+
}
|
2381
|
+
});
|
2382
|
+
x[0][0];
|
2383
|
+
x[0][1];
|
2384
|
+
x[0][2];
|
2385
|
+
x[1][0];
|
2386
|
+
x[1][1];
|
2387
|
+
x[1][2];
|
2388
|
+
x[2][0];
|
2389
|
+
x[2][1];
|
2390
|
+
x[2][2];
|
2391
|
+
function U(t, e) {
|
2392
|
+
return Math.abs(e) / Math.sqrt(Math.pow(t, 2) + 1);
|
2393
|
+
}
|
2394
|
+
function Vt(t) {
|
2395
|
+
let e = U(t.r0s, t.r0i), r = U(t.r1s, t.r1i), n = U(t.g0s, t.g0i), a = U(t.g1s, t.g1i), s = U(t.b0s, t.b0i), i = U(t.b1s, t.b1i);
|
2396
|
+
return Math.min(e, r, n, a, s, i);
|
2397
|
+
}
|
2398
|
+
var Wn = new m({
|
2399
|
+
id: "hpluv",
|
2400
|
+
name: "HPLuv",
|
2401
|
+
coords: {
|
2402
|
+
h: {
|
2403
|
+
refRange: [0, 360],
|
2404
|
+
type: "angle",
|
2405
|
+
name: "Hue"
|
2406
|
+
},
|
2407
|
+
s: {
|
2408
|
+
range: [0, 100],
|
2409
|
+
name: "Saturation"
|
2410
|
+
},
|
2411
|
+
l: {
|
2412
|
+
range: [0, 100],
|
2413
|
+
name: "Lightness"
|
2414
|
+
}
|
2415
|
+
},
|
2416
|
+
base: it,
|
2417
|
+
gamutSpace: "self",
|
2418
|
+
// Convert LCHuv to HPLuv
|
2419
|
+
fromBase(t) {
|
2420
|
+
let [e, r, n] = [R(t[0]), R(t[1]), R(t[2])], a;
|
2421
|
+
if (e > 99.9999999)
|
2422
|
+
a = 0, e = 100;
|
2423
|
+
else if (e < 1e-8)
|
2424
|
+
a = 0, e = 0;
|
2425
|
+
else {
|
2426
|
+
let s = Be(e), i = Vt(s);
|
2427
|
+
a = r / i * 100;
|
2428
|
+
}
|
2429
|
+
return [n, a, e];
|
2430
|
+
},
|
2431
|
+
// Convert HPLuv to LCHuv
|
2432
|
+
toBase(t) {
|
2433
|
+
let [e, r, n] = [R(t[0]), R(t[1]), R(t[2])], a;
|
2434
|
+
if (n > 99.9999999)
|
2435
|
+
n = 100, a = 0;
|
2436
|
+
else if (n < 1e-8)
|
2437
|
+
n = 0, a = 0;
|
2438
|
+
else {
|
2439
|
+
let s = Be(n);
|
2440
|
+
a = Vt(s) / 100 * r;
|
2441
|
+
}
|
2442
|
+
return [n, a, e];
|
2443
|
+
},
|
2444
|
+
formats: {
|
2445
|
+
color: {
|
2446
|
+
id: "--hpluv",
|
2447
|
+
coords: ["<number> | <angle>", "<percentage> | <number>", "<percentage> | <number>"]
|
2448
|
+
}
|
2449
|
+
}
|
2450
|
+
});
|
2451
|
+
const e0 = 203, t0 = 2610 / 2 ** 14, Qn = 2 ** 14 / 2610, Un = 2523 / 2 ** 5, r0 = 2 ** 5 / 2523, n0 = 3424 / 2 ** 12, a0 = 2413 / 2 ** 7, s0 = 2392 / 2 ** 7;
|
2452
|
+
var Kn = new z({
|
2453
|
+
id: "rec2100pq",
|
2454
|
+
cssId: "rec2100-pq",
|
2455
|
+
name: "REC.2100-PQ",
|
2456
|
+
base: ze,
|
2457
|
+
toBase(t) {
|
2458
|
+
return t.map(function(e) {
|
2459
|
+
return (Math.max(e ** r0 - n0, 0) / (a0 - s0 * e ** r0)) ** Qn * 1e4 / e0;
|
2460
|
+
});
|
2461
|
+
},
|
2462
|
+
fromBase(t) {
|
2463
|
+
return t.map(function(e) {
|
2464
|
+
let r = Math.max(e * e0 / 1e4, 0), n = n0 + a0 * r ** t0, a = 1 + s0 * r ** t0;
|
2465
|
+
return (n / a) ** Un;
|
2466
|
+
});
|
2467
|
+
}
|
2468
|
+
});
|
2469
|
+
const i0 = 0.17883277, o0 = 0.28466892, l0 = 0.55991073, je = 3.7743;
|
2470
|
+
var Vn = new z({
|
2471
|
+
id: "rec2100hlg",
|
2472
|
+
cssId: "rec2100-hlg",
|
2473
|
+
name: "REC.2100-HLG",
|
2474
|
+
referred: "scene",
|
2475
|
+
base: ze,
|
2476
|
+
toBase(t) {
|
2477
|
+
return t.map(function(e) {
|
2478
|
+
return e <= 0.5 ? e ** 2 / 3 * je : (Math.exp((e - l0) / i0) + o0) / 12 * je;
|
2479
|
+
});
|
2480
|
+
},
|
2481
|
+
fromBase(t) {
|
2482
|
+
return t.map(function(e) {
|
2483
|
+
return e /= je, e <= 1 / 12 ? Math.sqrt(3 * e) : i0 * Math.log(12 * e - o0) + l0;
|
2484
|
+
});
|
2485
|
+
}
|
2486
|
+
});
|
2487
|
+
const J0 = {};
|
2488
|
+
j.add("chromatic-adaptation-start", (t) => {
|
2489
|
+
t.options.method && (t.M = F0(t.W1, t.W2, t.options.method));
|
2490
|
+
});
|
2491
|
+
j.add("chromatic-adaptation-end", (t) => {
|
2492
|
+
t.M || (t.M = F0(t.W1, t.W2, t.options.method));
|
2493
|
+
});
|
2494
|
+
function Pe({ id: t, toCone_M: e, fromCone_M: r }) {
|
2495
|
+
J0[t] = arguments[0];
|
2496
|
+
}
|
2497
|
+
function F0(t, e, r = "Bradford") {
|
2498
|
+
let n = J0[r], [a, s, i] = L(n.toCone_M, t), [o, l, c] = L(n.toCone_M, e), u = [
|
2499
|
+
[o / a, 0, 0],
|
2500
|
+
[0, l / s, 0],
|
2501
|
+
[0, 0, c / i]
|
2502
|
+
], f = L(u, n.toCone_M);
|
2503
|
+
return L(n.fromCone_M, f);
|
2504
|
+
}
|
2505
|
+
Pe({
|
2506
|
+
id: "von Kries",
|
2507
|
+
toCone_M: [
|
2508
|
+
[0.40024, 0.7076, -0.08081],
|
2509
|
+
[-0.2263, 1.16532, 0.0457],
|
2510
|
+
[0, 0, 0.91822]
|
2511
|
+
],
|
2512
|
+
fromCone_M: [
|
2513
|
+
[1.8599363874558397, -1.1293816185800916, 0.21989740959619328],
|
2514
|
+
[0.3611914362417676, 0.6388124632850422, -6370596838649899e-21],
|
2515
|
+
[0, 0, 1.0890636230968613]
|
2516
|
+
]
|
2517
|
+
});
|
2518
|
+
Pe({
|
2519
|
+
id: "Bradford",
|
2520
|
+
// Convert an array of XYZ values in the range 0.0 - 1.0
|
2521
|
+
// to cone fundamentals
|
2522
|
+
toCone_M: [
|
2523
|
+
[0.8951, 0.2664, -0.1614],
|
2524
|
+
[-0.7502, 1.7135, 0.0367],
|
2525
|
+
[0.0389, -0.0685, 1.0296]
|
2526
|
+
],
|
2527
|
+
// and back
|
2528
|
+
fromCone_M: [
|
2529
|
+
[0.9869929054667121, -0.14705425642099013, 0.15996265166373122],
|
2530
|
+
[0.4323052697233945, 0.5183602715367774, 0.049291228212855594],
|
2531
|
+
[-0.00852866457517732, 0.04004282165408486, 0.96848669578755]
|
2532
|
+
]
|
2533
|
+
});
|
2534
|
+
Pe({
|
2535
|
+
id: "CAT02",
|
2536
|
+
// with complete chromatic adaptation to W2, so D = 1.0
|
2537
|
+
toCone_M: [
|
2538
|
+
[0.7328, 0.4296, -0.1624],
|
2539
|
+
[-0.7036, 1.6975, 61e-4],
|
2540
|
+
[3e-3, 0.0136, 0.9834]
|
2541
|
+
],
|
2542
|
+
fromCone_M: [
|
2543
|
+
[1.0961238208355142, -0.27886900021828726, 0.18274517938277307],
|
2544
|
+
[0.4543690419753592, 0.4735331543074117, 0.07209780371722911],
|
2545
|
+
[-0.009627608738429355, -0.00569803121611342, 1.0153256399545427]
|
2546
|
+
]
|
2547
|
+
});
|
2548
|
+
Pe({
|
2549
|
+
id: "CAT16",
|
2550
|
+
toCone_M: [
|
2551
|
+
[0.401288, 0.650173, -0.051461],
|
2552
|
+
[-0.250268, 1.204414, 0.045854],
|
2553
|
+
[-2079e-6, 0.048952, 0.953127]
|
2554
|
+
],
|
2555
|
+
// the extra precision is needed to avoid roundtripping errors
|
2556
|
+
fromCone_M: [
|
2557
|
+
[1.862067855087233, -1.0112546305316845, 0.14918677544445172],
|
2558
|
+
[0.3875265432361372, 0.6214474419314753, -0.008973985167612521],
|
2559
|
+
[-0.01584149884933386, -0.03412293802851557, 1.0499644368778496]
|
2560
|
+
]
|
2561
|
+
});
|
2562
|
+
Object.assign(B, {
|
2563
|
+
// whitepoint values from ASTM E308-01 with 10nm spacing, 1931 2 degree observer
|
2564
|
+
// all normalized to Y (luminance) = 1.00000
|
2565
|
+
// Illuminant A is a tungsten electric light, giving a very warm, orange light.
|
2566
|
+
A: [1.0985, 1, 0.35585],
|
2567
|
+
// Illuminant C was an early approximation to daylight: illuminant A with a blue filter.
|
2568
|
+
C: [0.98074, 1, 1.18232],
|
2569
|
+
// The daylight series of illuminants simulate natural daylight.
|
2570
|
+
// The color temperature (in degrees Kelvin/100) ranges from
|
2571
|
+
// cool, overcast daylight (D50) to bright, direct sunlight (D65).
|
2572
|
+
D55: [0.95682, 1, 0.92149],
|
2573
|
+
D75: [0.94972, 1, 1.22638],
|
2574
|
+
// Equal-energy illuminant, used in two-stage CAT16
|
2575
|
+
E: [1, 1, 1],
|
2576
|
+
// The F series of illuminants represent fluorescent lights
|
2577
|
+
F2: [0.99186, 1, 0.67393],
|
2578
|
+
F7: [0.95041, 1, 1.08747],
|
2579
|
+
F11: [1.00962, 1, 0.6435]
|
2580
|
+
});
|
2581
|
+
B.ACES = [0.32168 / 0.33767, 1, (1 - 0.32168 - 0.33767) / 0.33767];
|
2582
|
+
const ea = [
|
2583
|
+
[0.6624541811085053, 0.13400420645643313, 0.1561876870049078],
|
2584
|
+
[0.27222871678091454, 0.6740817658111484, 0.05368951740793705],
|
2585
|
+
[-0.005574649490394108, 0.004060733528982826, 1.0103391003129971]
|
2586
|
+
], ta = [
|
2587
|
+
[1.6410233796943257, -0.32480329418479, -0.23642469523761225],
|
2588
|
+
[-0.6636628587229829, 1.6153315916573379, 0.016756347685530137],
|
2589
|
+
[0.011721894328375376, -0.008284441996237409, 0.9883948585390215]
|
2590
|
+
];
|
2591
|
+
var W0 = new z({
|
2592
|
+
id: "acescg",
|
2593
|
+
cssId: "--acescg",
|
2594
|
+
name: "ACEScg",
|
2595
|
+
// ACEScg – A scene-referred, linear-light encoding of ACES Data
|
2596
|
+
// https://docs.acescentral.com/specifications/acescg/
|
2597
|
+
// uses the AP1 primaries, see section 4.3.1 Color primaries
|
2598
|
+
coords: {
|
2599
|
+
r: {
|
2600
|
+
range: [0, 65504],
|
2601
|
+
name: "Red"
|
2602
|
+
},
|
2603
|
+
g: {
|
2604
|
+
range: [0, 65504],
|
2605
|
+
name: "Green"
|
2606
|
+
},
|
2607
|
+
b: {
|
2608
|
+
range: [0, 65504],
|
2609
|
+
name: "Blue"
|
2610
|
+
}
|
2611
|
+
},
|
2612
|
+
referred: "scene",
|
2613
|
+
white: B.ACES,
|
2614
|
+
toXYZ_M: ea,
|
2615
|
+
fromXYZ_M: ta
|
2616
|
+
});
|
2617
|
+
const Le = 2 ** -16, qe = -0.35828683, Se = (Math.log2(65504) + 9.72) / 17.52;
|
2618
|
+
var ra = new z({
|
2619
|
+
id: "acescc",
|
2620
|
+
cssId: "--acescc",
|
2621
|
+
name: "ACEScc",
|
2622
|
+
// see S-2014-003 ACEScc – A Logarithmic Encoding of ACES Data
|
2623
|
+
// https://docs.acescentral.com/specifications/acescc/
|
2624
|
+
// uses the AP1 primaries, see section 4.3.1 Color primaries
|
2625
|
+
// Appendix A: "Very small ACES scene referred values below 7 1/4 stops
|
2626
|
+
// below 18% middle gray are encoded as negative ACEScc values.
|
2627
|
+
// These values should be preserved per the encoding in Section 4.4
|
2628
|
+
// so that all positive ACES values are maintained."
|
2629
|
+
coords: {
|
2630
|
+
r: {
|
2631
|
+
range: [qe, Se],
|
2632
|
+
name: "Red"
|
2633
|
+
},
|
2634
|
+
g: {
|
2635
|
+
range: [qe, Se],
|
2636
|
+
name: "Green"
|
2637
|
+
},
|
2638
|
+
b: {
|
2639
|
+
range: [qe, Se],
|
2640
|
+
name: "Blue"
|
2641
|
+
}
|
2642
|
+
},
|
2643
|
+
referred: "scene",
|
2644
|
+
base: W0,
|
2645
|
+
// from section 4.4.2 Decoding Function
|
2646
|
+
toBase(t) {
|
2647
|
+
const e = -0.3013698630136986;
|
2648
|
+
return t.map(function(r) {
|
2649
|
+
return r <= e ? (2 ** (r * 17.52 - 9.72) - Le) * 2 : r < Se ? 2 ** (r * 17.52 - 9.72) : 65504;
|
2650
|
+
});
|
2651
|
+
},
|
2652
|
+
// Non-linear encoding function from S-2014-003, section 4.4.1 Encoding Function
|
2653
|
+
fromBase(t) {
|
2654
|
+
return t.map(function(e) {
|
2655
|
+
return e <= 0 ? (Math.log2(Le) + 9.72) / 17.52 : e < Le ? (Math.log2(Le + e * 0.5) + 9.72) / 17.52 : (Math.log2(e) + 9.72) / 17.52;
|
2656
|
+
});
|
2657
|
+
}
|
2658
|
+
// encoded media white (rgb 1,1,1) => linear [ 222.861, 222.861, 222.861 ]
|
2659
|
+
// encoded media black (rgb 0,0,0) => linear [ 0.0011857, 0.0011857, 0.0011857]
|
2660
|
+
}), c0 = /* @__PURE__ */ Object.freeze({
|
2661
|
+
__proto__: null,
|
2662
|
+
A98RGB: Tn,
|
2663
|
+
A98RGB_Linear: j0,
|
2664
|
+
ACEScc: ra,
|
2665
|
+
ACEScg: W0,
|
2666
|
+
CAM16_JMh: jr,
|
2667
|
+
HCT: ce,
|
2668
|
+
HPLuv: Wn,
|
2669
|
+
HSL: D0,
|
2670
|
+
HSLuv: Fn,
|
2671
|
+
HSV: X0,
|
2672
|
+
HWB: An,
|
2673
|
+
ICTCP: Fe,
|
2674
|
+
JzCzHz: Je,
|
2675
|
+
Jzazbz: S0,
|
2676
|
+
LCH: le,
|
2677
|
+
LCHuv: it,
|
2678
|
+
Lab: E,
|
2679
|
+
Lab_D65: Ue,
|
2680
|
+
Luv: G0,
|
2681
|
+
OKLCH: qn,
|
2682
|
+
OKLab: K,
|
2683
|
+
P3: k0,
|
2684
|
+
P3_Linear: v0,
|
2685
|
+
ProPhoto: jn,
|
2686
|
+
ProPhoto_Linear: q0,
|
2687
|
+
REC_2020: E0,
|
2688
|
+
REC_2020_Linear: ze,
|
2689
|
+
REC_2100_HLG: Vn,
|
2690
|
+
REC_2100_PQ: Kn,
|
2691
|
+
XYZ_ABS_D65: nt,
|
2692
|
+
XYZ_D50: rt,
|
2693
|
+
XYZ_D65: N,
|
2694
|
+
sRGB: te,
|
2695
|
+
sRGB_Linear: A0
|
2696
|
+
});
|
2697
|
+
class w {
|
2698
|
+
/**
|
2699
|
+
* Creates an instance of Color.
|
2700
|
+
* Signatures:
|
2701
|
+
* - `new Color(stringToParse)`
|
2702
|
+
* - `new Color(otherColor)`
|
2703
|
+
* - `new Color({space, coords, alpha})`
|
2704
|
+
* - `new Color(space, coords, alpha)`
|
2705
|
+
* - `new Color(spaceId, coords, alpha)`
|
2706
|
+
*/
|
2707
|
+
constructor(...e) {
|
2708
|
+
let r;
|
2709
|
+
e.length === 1 && (r = b(e[0]));
|
2710
|
+
let n, a, s;
|
2711
|
+
r ? (n = r.space || r.spaceId, a = r.coords, s = r.alpha) : [n, a, s] = e, Object.defineProperty(this, "space", {
|
2712
|
+
value: m.get(n),
|
2713
|
+
writable: !1,
|
2714
|
+
enumerable: !0,
|
2715
|
+
configurable: !0
|
2716
|
+
// see note in https://262.ecma-international.org/8.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver
|
2717
|
+
}), this.coords = a ? a.slice() : [0, 0, 0], this.alpha = s > 1 || s === void 0 ? 1 : s < 0 ? 0 : s;
|
2718
|
+
for (let i = 0; i < this.coords.length; i++)
|
2719
|
+
this.coords[i] === "NaN" && (this.coords[i] = NaN);
|
2720
|
+
for (let i in this.space.coords)
|
2721
|
+
Object.defineProperty(this, i, {
|
2722
|
+
get: () => this.get(i),
|
2723
|
+
set: (o) => this.set(i, o)
|
2724
|
+
});
|
2725
|
+
}
|
2726
|
+
get spaceId() {
|
2727
|
+
return this.space.id;
|
2728
|
+
}
|
2729
|
+
clone() {
|
2730
|
+
return new w(this.space, this.coords, this.alpha);
|
2731
|
+
}
|
2732
|
+
toJSON() {
|
2733
|
+
return {
|
2734
|
+
spaceId: this.spaceId,
|
2735
|
+
coords: this.coords,
|
2736
|
+
alpha: this.alpha
|
2737
|
+
};
|
2738
|
+
}
|
2739
|
+
display(...e) {
|
2740
|
+
let r = sn(this, ...e);
|
2741
|
+
return r.color = new w(r.color), r;
|
2742
|
+
}
|
2743
|
+
/**
|
2744
|
+
* Get a color from the argument passed
|
2745
|
+
* Basically gets us the same result as new Color(color) but doesn't clone an existing color object
|
2746
|
+
*/
|
2747
|
+
static get(e, ...r) {
|
2748
|
+
return e instanceof w ? e : new w(e, ...r);
|
2749
|
+
}
|
2750
|
+
static defineFunction(e, r, n = r) {
|
2751
|
+
let { instance: a = !0, returns: s } = n, i = function(...o) {
|
2752
|
+
let l = r(...o);
|
2753
|
+
if (s === "color")
|
2754
|
+
l = w.get(l);
|
2755
|
+
else if (s === "function<color>") {
|
2756
|
+
let c = l;
|
2757
|
+
l = function(...u) {
|
2758
|
+
let f = c(...u);
|
2759
|
+
return w.get(f);
|
2760
|
+
}, Object.assign(l, c);
|
2761
|
+
} else s === "array<color>" && (l = l.map((c) => w.get(c)));
|
2762
|
+
return l;
|
2763
|
+
};
|
2764
|
+
e in w || (w[e] = i), a && (w.prototype[e] = function(...o) {
|
2765
|
+
return i(this, ...o);
|
2766
|
+
});
|
2767
|
+
}
|
2768
|
+
static defineFunctions(e) {
|
2769
|
+
for (let r in e)
|
2770
|
+
w.defineFunction(r, e[r], e[r]);
|
2771
|
+
}
|
2772
|
+
static extend(e) {
|
2773
|
+
if (e.register)
|
2774
|
+
e.register(w);
|
2775
|
+
else
|
2776
|
+
for (let r in e)
|
2777
|
+
w.defineFunction(r, e[r]);
|
2778
|
+
}
|
2779
|
+
}
|
2780
|
+
w.defineFunctions({
|
2781
|
+
get: P,
|
2782
|
+
getAll: fe,
|
2783
|
+
set: O,
|
2784
|
+
setAll: tt,
|
2785
|
+
to: C,
|
2786
|
+
equals: on,
|
2787
|
+
inGamut: J,
|
2788
|
+
toGamut: q,
|
2789
|
+
distance: L0,
|
2790
|
+
toString: ie
|
2791
|
+
});
|
2792
|
+
Object.assign(w, {
|
2793
|
+
util: ar,
|
2794
|
+
hooks: j,
|
2795
|
+
WHITES: B,
|
2796
|
+
Space: m,
|
2797
|
+
spaces: m.registry,
|
2798
|
+
parse: y0,
|
2799
|
+
// Global defaults one may want to configure
|
2800
|
+
defaults: v
|
2801
|
+
});
|
2802
|
+
for (let t of Object.keys(c0))
|
2803
|
+
m.register(c0[t]);
|
2804
|
+
for (let t in m.registry)
|
2805
|
+
Ke(t, m.registry[t]);
|
2806
|
+
j.add("colorspace-init-end", (t) => {
|
2807
|
+
var e;
|
2808
|
+
Ke(t.id, t), (e = t.aliases) == null || e.forEach((r) => {
|
2809
|
+
Ke(r, t);
|
2810
|
+
});
|
2811
|
+
});
|
2812
|
+
function Ke(t, e) {
|
2813
|
+
let r = t.replace(/-/g, "_");
|
2814
|
+
Object.defineProperty(w.prototype, r, {
|
2815
|
+
// Convert coords to coords in another colorspace and return them
|
2816
|
+
// Source colorspace: this.spaceId
|
2817
|
+
// Target colorspace: id
|
2818
|
+
get() {
|
2819
|
+
let n = this.getAll(t);
|
2820
|
+
return typeof Proxy > "u" ? n : new Proxy(n, {
|
2821
|
+
has: (a, s) => {
|
2822
|
+
try {
|
2823
|
+
return m.resolveCoord([e, s]), !0;
|
2824
|
+
} catch {
|
2825
|
+
}
|
2826
|
+
return Reflect.has(a, s);
|
2827
|
+
},
|
2828
|
+
get: (a, s, i) => {
|
2829
|
+
if (s && typeof s != "symbol" && !(s in a)) {
|
2830
|
+
let { index: o } = m.resolveCoord([e, s]);
|
2831
|
+
if (o >= 0)
|
2832
|
+
return a[o];
|
2833
|
+
}
|
2834
|
+
return Reflect.get(a, s, i);
|
2835
|
+
},
|
2836
|
+
set: (a, s, i, o) => {
|
2837
|
+
if (s && typeof s != "symbol" && !(s in a) || s >= 0) {
|
2838
|
+
let { index: l } = m.resolveCoord([e, s]);
|
2839
|
+
if (l >= 0)
|
2840
|
+
return a[l] = i, this.setAll(t, a), !0;
|
2841
|
+
}
|
2842
|
+
return Reflect.set(a, s, i, o);
|
2843
|
+
}
|
2844
|
+
});
|
2845
|
+
},
|
2846
|
+
// Convert coords in another colorspace to internal coords and set them
|
2847
|
+
// Target colorspace: this.spaceId
|
2848
|
+
// Source colorspace: id
|
2849
|
+
set(n) {
|
2850
|
+
this.setAll(t, n);
|
2851
|
+
},
|
2852
|
+
configurable: !0,
|
2853
|
+
enumerable: !0
|
2854
|
+
});
|
2855
|
+
}
|
2856
|
+
w.extend(ee);
|
2857
|
+
w.extend({ deltaE: se });
|
2858
|
+
Object.assign(w, { deltaEMethods: ee });
|
2859
|
+
w.extend(Pn);
|
2860
|
+
w.extend({ contrast: Nn });
|
2861
|
+
w.extend(In);
|
2862
|
+
w.extend(cn);
|
2863
|
+
w.extend(vn);
|
2864
|
+
w.extend(_e);
|
2865
|
+
export {
|
2866
|
+
w as C
|
2867
|
+
};
|