@holoviz/panel 0.14.3 → 1.0.0-a.1
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/dist/bundled/@microsoft/fast-components@2.30.6/dist/fast-components.iife.min.js +217 -0
- package/dist/bundled/@microsoft/fast-components@2.30.6/dist/fast-components.js +28286 -0
- package/dist/bundled/@microsoft/fast-components@2.30.6/dist/fast-components.min.js +217 -0
- package/dist/bundled/bootstrap/css/bootstrap.css +688 -0
- package/dist/bundled/bootstrap5/css/bootstrap-grid.css +4226 -0
- package/dist/bundled/bootstrap5/css/bootstrap-grid.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-grid.rtl.css +4225 -0
- package/dist/bundled/bootstrap5/css/bootstrap-grid.rtl.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-reboot.css +591 -0
- package/dist/bundled/bootstrap5/css/bootstrap-reboot.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-reboot.rtl.css +588 -0
- package/dist/bundled/bootstrap5/css/bootstrap-reboot.rtl.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-utilities.css +5099 -0
- package/dist/bundled/bootstrap5/css/bootstrap-utilities.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-utilities.rtl.css +5090 -0
- package/dist/bundled/bootstrap5/css/bootstrap-utilities.rtl.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap.css +11783 -0
- package/dist/bundled/bootstrap5/css/bootstrap.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap.rtl.css +11747 -0
- package/dist/bundled/bootstrap5/css/bootstrap.rtl.min.css +6 -0
- package/dist/bundled/bootstrap5/js/bootstrap.bundle.js +6295 -0
- package/dist/bundled/bootstrap5/js/bootstrap.bundle.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +7 -0
- package/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.esm.js +4422 -0
- package/dist/bundled/bootstrap5/js/bootstrap.esm.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.esm.min.js +7 -0
- package/dist/bundled/bootstrap5/js/bootstrap.esm.min.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.js +4468 -0
- package/dist/bundled/bootstrap5/js/bootstrap.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.min.js +7 -0
- package/dist/bundled/bootstrap5/js/bootstrap.min.js.map +1 -0
- package/dist/bundled/bootstrapdarktheme/bootstrap_dark.css +170 -0
- package/dist/bundled/bootstrapdefaulttheme/bootstrap_default.css +120 -0
- package/dist/bundled/bootstraptemplate/bootstrap.css +119 -77
- package/dist/bundled/darktheme/dark.css +33 -106
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_fast.min.css +1 -0
- package/dist/bundled/defaulttheme/default.css +33 -2
- package/dist/bundled/fast/css/fast.css +919 -0
- package/dist/bundled/fast/js/fast_design.js +87 -0
- package/dist/bundled/fastbasetemplate/fast.css +335 -0
- package/dist/bundled/fastgridtemplate/fast_grid_template.css +256 -232
- package/dist/bundled/golden-layout@1.5.9/dist/css/goldenlayout-base.css +1 -0
- package/dist/bundled/golden-layout@1.5.9/dist/css/theme/goldenlayout-dark-theme.css +1 -0
- package/dist/bundled/goldentemplate/golden.css +2 -22
- package/dist/bundled/material/css/material.css +443 -0
- package/dist/bundled/materialtemplate/dark.css +2 -20
- package/dist/bundled/materialtemplate/default.css +2 -17
- package/dist/bundled/materialtemplate/material.css +119 -114
- package/dist/bundled/materialthememixin/material_variables.css +19 -0
- package/dist/bundled/native/css/native.css +28 -0
- package/dist/bundled/notificationarea/panel/1.0.0-a.1/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.0.0-a.1/dist/bundled/bootstrap5/css/bootstrap.min.css +2 -0
- package/dist/bundled/panel/1.0.0-a.1/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +2 -0
- package/dist/bundled/panel/1.0.0-a.1/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.0.0-a.1/dist/bundled/jquery/jquery.slim.min.js +2 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/fonts.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/material-dark.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/material.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/monokai.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/solarized-dark.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/solarized.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/themes.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/vaporwave.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/variables.css +0 -0
- package/dist/bundled/plotlyplot/panel/1.0.0-a.1/dist/bundled/jquery/jquery.slim.min.js +2 -0
- package/dist/bundled/react-dom@17/umd/react-dom.production.min.js +245 -0
- package/dist/bundled/react-grid-layout@1.3.4/dist/react-grid-layout.min.js +2 -0
- package/dist/bundled/react-grid-layout@1.3.4/dist/react-grid-layout.min.js.map +1 -0
- package/dist/bundled/react@17/umd/react.production.min.js +31 -0
- package/dist/bundled/reacttemplate/react.css +0 -12
- package/dist/bundled/vanillatemplate/vanilla.css +129 -134
- package/dist/css/alerts.css +64 -64
- package/dist/css/booleanstatus.css +48 -0
- package/dist/css/card.css +16 -8
- package/dist/css/dataframe.css +7 -2
- package/dist/css/debugger.css +16 -10
- package/dist/css/divider.css +10 -0
- package/dist/css/editable_slider.css +22 -0
- package/dist/css/katex.css +3 -0
- package/dist/css/loadingspinner.css +119 -0
- package/dist/css/markdown.css +2 -1
- package/dist/css/perspective-datatable.css +504 -0
- package/dist/css/plotly.css +246 -0
- package/dist/css/progress.css +209 -0
- package/dist/css/widgetbox.css +9 -0
- package/dist/css/widgets.css +0 -305
- package/dist/dts/styles/alerts.css.d.ts +3 -0
- package/dist/dts/styles/booleanstatus.css.d.ts +3 -0
- package/dist/dts/styles/card.css.d.ts +3 -0
- package/dist/dts/styles/dataframe.css.d.ts +3 -0
- package/dist/dts/styles/debugger.css.d.ts +3 -0
- package/dist/dts/styles/divider.css.d.ts +4 -0
- package/dist/dts/styles/editable_slider.css.d.ts +8 -0
- package/dist/dts/styles/json.css.d.ts +3 -0
- package/dist/dts/styles/katex.css.d.ts +3 -0
- package/dist/dts/styles/loading.css.d.ts +3 -0
- package/dist/dts/styles/loadingspinner.css.d.ts +3 -0
- package/dist/dts/styles/markdown.css.d.ts +3 -0
- package/dist/dts/styles/perspective-datatable.css.d.ts +3 -0
- package/dist/dts/styles/plotly.css.d.ts +3 -0
- package/dist/dts/styles/progress.css.d.ts +3 -0
- package/dist/dts/styles/widgetbox.css.d.ts +3 -0
- package/dist/dts/styles/widgets.css.d.ts +4 -0
- package/dist/lib/models/ace.d.ts +3 -5
- package/dist/lib/models/ace.js +24 -23
- package/dist/lib/models/ace.js.map +1 -1
- package/dist/lib/models/audio.d.ts +2 -4
- package/dist/lib/models/audio.js +18 -18
- package/dist/lib/models/audio.js.map +1 -1
- package/dist/lib/models/card.d.ts +3 -3
- package/dist/lib/models/card.js +56 -62
- package/dist/lib/models/card.js.map +1 -1
- package/dist/lib/models/comm_manager.d.ts +2 -2
- package/dist/lib/models/comm_manager.js +20 -19
- package/dist/lib/models/comm_manager.js.map +1 -1
- package/dist/lib/models/data.js +1 -1
- package/dist/lib/models/data.js.map +1 -1
- package/dist/lib/models/datetime_picker.d.ts +8 -7
- package/dist/lib/models/datetime_picker.js +128 -34
- package/dist/lib/models/datetime_picker.js.map +1 -1
- package/dist/lib/models/deckgl.d.ts +2 -4
- package/dist/lib/models/deckgl.js +24 -25
- package/dist/lib/models/deckgl.js.map +1 -1
- package/dist/lib/models/echarts.d.ts +3 -2
- package/dist/lib/models/echarts.js +22 -12
- package/dist/lib/models/echarts.js.map +1 -1
- package/dist/lib/models/file_download.d.ts +2 -2
- package/dist/lib/models/file_download.js +18 -17
- package/dist/lib/models/file_download.js.map +1 -1
- package/dist/lib/models/html.d.ts +5 -3
- package/dist/lib/models/html.js +20 -16
- package/dist/lib/models/html.js.map +1 -1
- package/dist/lib/models/index.d.ts +1 -2
- package/dist/lib/models/index.js +1 -2
- package/dist/lib/models/index.js.map +1 -1
- package/dist/lib/models/ipywidget.d.ts +2 -6
- package/dist/lib/models/ipywidget.js +14 -24
- package/dist/lib/models/ipywidget.js.map +1 -1
- package/dist/lib/models/json.d.ts +1 -1
- package/dist/lib/models/json.js +14 -12
- package/dist/lib/models/json.js.map +1 -1
- package/dist/lib/models/jsoneditor.d.ts +9 -6
- package/dist/lib/models/jsoneditor.js +27 -18
- package/dist/lib/models/jsoneditor.js.map +1 -1
- package/dist/lib/models/katex.d.ts +0 -1
- package/dist/lib/models/katex.js +7 -6
- package/dist/lib/models/katex.js.map +1 -1
- package/dist/lib/models/layout.d.ts +25 -22
- package/dist/lib/models/layout.js +75 -81
- package/dist/lib/models/layout.js.map +1 -1
- package/dist/lib/models/location.d.ts +0 -1
- package/dist/lib/models/location.js +15 -14
- package/dist/lib/models/location.js.map +1 -1
- package/dist/lib/models/mathjax.d.ts +0 -3
- package/dist/lib/models/mathjax.js +6 -16
- package/dist/lib/models/mathjax.js.map +1 -1
- package/dist/lib/models/pdf.d.ts +24 -0
- package/dist/lib/models/pdf.js +62 -0
- package/dist/lib/models/pdf.js.map +1 -0
- package/dist/lib/models/perspective.d.ts +4 -9
- package/dist/lib/models/perspective.js +36 -64
- package/dist/lib/models/perspective.js.map +1 -1
- package/dist/lib/models/player.d.ts +0 -1
- package/dist/lib/models/player.js +18 -17
- package/dist/lib/models/player.js.map +1 -1
- package/dist/lib/models/plotly.d.ts +3 -7
- package/dist/lib/models/plotly.js +60 -67
- package/dist/lib/models/plotly.js.map +1 -1
- package/dist/lib/models/progress.d.ts +4 -7
- package/dist/lib/models/progress.js +28 -32
- package/dist/lib/models/progress.js.map +1 -1
- package/dist/lib/models/quill.d.ts +3 -6
- package/dist/lib/models/quill.js +25 -24
- package/dist/lib/models/quill.js.map +1 -1
- package/dist/lib/models/reactive_html.d.ts +6 -12
- package/dist/lib/models/reactive_html.js +48 -121
- package/dist/lib/models/reactive_html.js.map +1 -1
- package/dist/lib/models/singleselect.d.ts +0 -1
- package/dist/lib/models/singleselect.js +11 -10
- package/dist/lib/models/singleselect.js.map +1 -1
- package/dist/lib/models/speech_to_text.d.ts +1 -2
- package/dist/lib/models/speech_to_text.js +27 -26
- package/dist/lib/models/speech_to_text.js.map +1 -1
- package/dist/lib/models/state.d.ts +0 -2
- package/dist/lib/models/state.js +12 -13
- package/dist/lib/models/state.js.map +1 -1
- package/dist/lib/models/tabulator.d.ts +10 -14
- package/dist/lib/models/tabulator.js +73 -150
- package/dist/lib/models/tabulator.js.map +1 -1
- package/dist/lib/models/terminal.d.ts +6 -7
- package/dist/lib/models/terminal.js +20 -26
- package/dist/lib/models/terminal.js.map +1 -1
- package/dist/lib/models/text_to_speech.d.ts +1 -2
- package/dist/lib/models/text_to_speech.js +16 -15
- package/dist/lib/models/text_to_speech.js.map +1 -1
- package/dist/lib/models/trend.d.ts +1 -2
- package/dist/lib/models/trend.js +24 -23
- package/dist/lib/models/trend.js.map +1 -1
- package/dist/lib/models/vega.d.ts +7 -6
- package/dist/lib/models/vega.js +31 -36
- package/dist/lib/models/vega.js.map +1 -1
- package/dist/lib/models/video.d.ts +2 -4
- package/dist/lib/models/video.js +18 -18
- package/dist/lib/models/video.js.map +1 -1
- package/dist/lib/models/videostream.d.ts +2 -4
- package/dist/lib/models/videostream.js +19 -19
- package/dist/lib/models/videostream.js.map +1 -1
- package/dist/lib/models/vtk/util.d.ts +4 -4
- package/dist/lib/models/vtk/vtkaxes.d.ts +1 -2
- package/dist/lib/models/vtk/vtkaxes.js +15 -14
- package/dist/lib/models/vtk/vtkaxes.js.map +1 -1
- package/dist/lib/models/vtk/vtkjs.d.ts +0 -1
- package/dist/lib/models/vtk/vtkjs.js +9 -8
- package/dist/lib/models/vtk/vtkjs.js.map +1 -1
- package/dist/lib/models/vtk/vtklayout.d.ts +2 -5
- package/dist/lib/models/vtk/vtklayout.js +24 -30
- package/dist/lib/models/vtk/vtklayout.js.map +1 -1
- package/dist/lib/models/vtk/vtksynchronized.d.ts +0 -1
- package/dist/lib/models/vtk/vtksynchronized.js +17 -16
- package/dist/lib/models/vtk/vtksynchronized.js.map +1 -1
- package/dist/lib/models/vtk/vtkvolume.d.ts +0 -1
- package/dist/lib/models/vtk/vtkvolume.js +27 -26
- package/dist/lib/models/vtk/vtkvolume.js.map +1 -1
- package/dist/lib/styles/alerts.css.d.ts +1 -2
- package/dist/lib/styles/alerts.css.js +1 -139
- package/dist/lib/styles/booleanstatus.css.d.ts +1 -0
- package/dist/lib/styles/booleanstatus.css.js +1 -0
- package/dist/lib/styles/card.css.d.ts +1 -2
- package/dist/lib/styles/card.css.js +1 -43
- package/dist/lib/styles/dataframe.css.d.ts +1 -2
- package/dist/lib/styles/dataframe.css.js +1 -44
- package/dist/lib/styles/debugger.css.d.ts +1 -2
- package/dist/lib/styles/debugger.css.js +1 -68
- package/dist/lib/styles/divider.css.d.ts +2 -0
- package/dist/lib/styles/divider.css.js +2 -0
- package/dist/lib/styles/editable_slider.css.d.ts +6 -0
- package/dist/lib/styles/editable_slider.css.js +6 -0
- package/dist/lib/styles/json.css.d.ts +1 -2
- package/dist/lib/styles/json.css.js +1 -197
- package/dist/lib/styles/katex.css.d.ts +1 -0
- package/dist/lib/styles/katex.css.js +1 -0
- package/dist/lib/styles/loading.css.d.ts +1 -2
- package/dist/lib/styles/loading.css.js +1 -31
- package/dist/lib/styles/loadingspinner.css.d.ts +1 -0
- package/dist/lib/styles/loadingspinner.css.js +17 -0
- package/dist/lib/styles/markdown.css.d.ts +1 -2
- package/dist/lib/styles/markdown.css.js +1 -91
- package/dist/lib/styles/perspective-datatable.css.d.ts +1 -0
- package/dist/lib/styles/perspective-datatable.css.js +1 -0
- package/dist/lib/styles/plotly.css.d.ts +1 -0
- package/dist/lib/styles/plotly.css.js +1 -0
- package/dist/lib/styles/progress.css.d.ts +1 -0
- package/dist/lib/styles/progress.css.js +22 -0
- package/dist/lib/styles/widgetbox.css.d.ts +1 -0
- package/dist/lib/styles/widgetbox.css.js +1 -0
- package/dist/lib/styles/widgets.css.d.ts +2 -2
- package/dist/lib/styles/widgets.css.js +2 -320
- package/dist/panel.js +4467 -5894
- package/dist/panel.js.map +1 -1
- package/dist/panel.json +1 -1
- package/dist/panel.min.js +65 -102
- package/dist/wheels/bokeh-3.1.0.dev4-py3-none-any.whl +0 -0
- package/dist/wheels/panel-1.0.0a1-py3-none-any.whl +0 -0
- package/package.json +5 -4
- package/dist/bundled/bootstraptemplate/dark.css +0 -19
- package/dist/bundled/css/golden-layout@1.5.9/src/css/goldenlayout-base.css +0 -1
- package/dist/bundled/css/panel/0.14.3/dist/bundled/bootstrap4/css/bootstrap.min.css +0 -2
- package/dist/bundled/css/panel/0.14.3/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/datatabulator/@holoviz/panel@0.14.3/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/fast/tabulator_fast.min.css +0 -1
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/fast/tabulator_fast.min.css +0 -1
- package/dist/bundled/fastbasetemplate/fast_awesome.css +0 -13
- package/dist/bundled/fastbasetemplate/fast_bokeh.css +0 -1646
- package/dist/bundled/fastbasetemplate/fast_bokeh_slickgrid.css +0 -200
- package/dist/bundled/fastbasetemplate/fast_panel.css +0 -53
- package/dist/bundled/fastbasetemplate/fast_panel_dataframe.css +0 -14
- package/dist/bundled/fastbasetemplate/fast_panel_markdown.css +0 -23
- package/dist/bundled/fastbasetemplate/fast_panel_widgets.css +0 -301
- package/dist/bundled/fastbasetemplate/fast_root.css +0 -41
- package/dist/bundled/fastdarktheme/fast_root_dark.css +0 -4
- package/dist/bundled/fastdefaulttheme/fast_root_default.css +0 -4
- package/dist/bundled/fastgridtemplate/dark.css +0 -26
- package/dist/bundled/fastgridtemplate/default.css +0 -4
- package/dist/bundled/fastlisttemplate/dark.css +0 -13
- package/dist/bundled/fastlisttemplate/default.css +0 -1
- package/dist/bundled/fastlisttemplate/fast_list_template.css +0 -237
- package/dist/bundled/goldentemplate/dark.css +0 -26
- package/dist/bundled/goldentemplate/default.css +0 -23
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/array-pixel-blob.js +0 -39
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-blending.js +0 -270
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-converters.js +0 -524
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-hsl.js +0 -42
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-hsv.js +0 -42
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-interpolation.js +0 -133
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-lab.js +0 -47
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-lch.js +0 -50
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-palette.js +0 -285
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-quantization.js +0 -135
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-rgba-64.js +0 -95
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-scale.js +0 -176
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-xyz.js +0 -50
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/component-state-color-palette.js +0 -113
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/histogram.js +0 -76
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/index.js +0 -19
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/math-utilities.js +0 -138
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/named-colors.js +0 -743
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/palette-extractor.js +0 -134
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/parse-color.js +0 -219
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/pixel-blob.js +0 -72
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/pixel-box.js +0 -249
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/__test__/harness.js +0 -33
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/__test__/server.js +0 -36
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.iife.min.js +0 -19
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.js +0 -25813
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.min.js +0 -19
- package/dist/bundled/js/ajax/libs/react-grid-layout/1.1.1/react-grid-layout.min.js +0 -7
- package/dist/bundled/js/ajax/libs/react-grid-layout/1.1.1/react-grid-layout.min.js.map +0 -1
- package/dist/bundled/js/panel/0.14.3/dist/bundled/bootstrap4/js/bootstrap.bundle.min.js +0 -2
- package/dist/bundled/js/panel/0.14.3/dist/bundled/jquery/jquery.slim.min.js +0 -2
- package/dist/bundled/js/react-dom@18/umd/react-dom.production.min.js +0 -267
- package/dist/bundled/js/react@18/umd/react.production.min.js +0 -31
- package/dist/bundled/notificationarea/panel/0.14.3/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/plotlyplot/panel/0.14.3/dist/bundled/jquery/jquery.slim.min.js +0 -2
- package/dist/bundled/reacttemplate/dark.css +0 -18
- package/dist/bundled/reacttemplate/default.css +0 -12
- package/dist/bundled/theme/dark.css +0 -107
- package/dist/bundled/theme/default.css +0 -3
- package/dist/bundled/vanillatemplate/default.css +0 -8
- package/dist/idom/package.json +0 -38
- package/dist/lib/models/idom.d.ts +0 -36
- package/dist/lib/models/idom.js +0 -239
- package/dist/lib/models/idom.js.map +0 -1
- package/dist/lib/models/tabs.d.ts +0 -24
- package/dist/lib/models/tabs.js +0 -231
- package/dist/lib/models/tabs.js.map +0 -1
- package/dist/wheels/bokeh-2.4.3-py3-none-any.whl +0 -0
- package/dist/wheels/panel-0.14.3-py3-none-any.whl +0 -0
- /package/dist/bundled/{js/babel-standalone@latest → babel-standalone@latest}/babel.min.js +0 -0
- /package/dist/bundled/{js/golden-layout@1.5.9 → golden-layout@1.5.9}/dist/goldenlayout.min.js +0 -0
- /package/dist/bundled/{css/material-components-web@7.0.0 → material-components-web@7.0.0}/dist/material-components-web.min.css +0 -0
- /package/dist/bundled/{js/material-components-web@7.0.0 → material-components-web@7.0.0}/dist/material-components-web.min.js +0 -0
|
@@ -1,524 +0,0 @@
|
|
|
1
|
-
import { ColorHSL } from "./color-hsl.js";
|
|
2
|
-
import { ColorHSV } from "./color-hsv.js";
|
|
3
|
-
import { ColorLAB } from "./color-lab.js";
|
|
4
|
-
import { ColorLCH } from "./color-lch.js";
|
|
5
|
-
import { ColorRGBA64 } from "./color-rgba-64.js";
|
|
6
|
-
import { ColorXYZ } from "./color-xyz.js";
|
|
7
|
-
import { degreesToRadians, radiansToDegrees } from "./math-utilities.js";
|
|
8
|
-
// All hue values are in degrees rather than radians or normalized
|
|
9
|
-
// All conversions use the D65 2 degree white point for XYZ
|
|
10
|
-
// Info on conversions and constants used can be found in the following:
|
|
11
|
-
// https://en.wikipedia.org/wiki/CIELAB_color_space
|
|
12
|
-
// https://en.wikipedia.org/wiki/Illuminant_D65
|
|
13
|
-
// https://ninedegreesbelow.com/photography/xyz-rgb.html
|
|
14
|
-
// http://user.engineering.uiowa.edu/~aip/Misc/ColorFAQ.html
|
|
15
|
-
// https://web.stanford.edu/~sujason/ColorBalancing/adaptation.html
|
|
16
|
-
// http://brucelindbloom.com/index.html
|
|
17
|
-
/**
|
|
18
|
-
* Get the luminance of a color in the linear RGB space.
|
|
19
|
-
* This is not the same as the relative luminance in the sRGB space for WCAG contrast calculations. Use rgbToRelativeLuminance instead.
|
|
20
|
-
* @param rgb - The input color
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export function rgbToLinearLuminance(rgb) {
|
|
25
|
-
return rgb.r * 0.2126 + rgb.g * 0.7152 + rgb.b * 0.0722;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Get the relative luminance of a color.
|
|
29
|
-
* Adjusts the color to sRGB space, which is necessary for the WCAG contrast spec.
|
|
30
|
-
* The alpha channel of the input is ignored.
|
|
31
|
-
* @param rgb - The input color
|
|
32
|
-
*
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
35
|
-
export function rgbToRelativeLuminance(rgb) {
|
|
36
|
-
function luminanceHelper(i) {
|
|
37
|
-
if (i <= 0.03928) {
|
|
38
|
-
return i / 12.92;
|
|
39
|
-
}
|
|
40
|
-
return Math.pow((i + 0.055) / 1.055, 2.4);
|
|
41
|
-
}
|
|
42
|
-
return rgbToLinearLuminance(new ColorRGBA64(luminanceHelper(rgb.r), luminanceHelper(rgb.g), luminanceHelper(rgb.b), 1));
|
|
43
|
-
}
|
|
44
|
-
const calculateContrastRatio = (a, b) => (a + 0.05) / (b + 0.05);
|
|
45
|
-
/**
|
|
46
|
-
* Calculate the contrast ratio between two colors. Uses the formula described by {@link https://www.w3.org/TR/WCAG20-TECHS/G17.html | WCAG 2.0}.
|
|
47
|
-
*
|
|
48
|
-
* @remarks
|
|
49
|
-
* The alpha channel of the input is ignored
|
|
50
|
-
*
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
export function contrastRatio(a, b) {
|
|
54
|
-
const luminanceA = rgbToRelativeLuminance(a);
|
|
55
|
-
const luminanceB = rgbToRelativeLuminance(b);
|
|
56
|
-
return luminanceA > luminanceB
|
|
57
|
-
? calculateContrastRatio(luminanceA, luminanceB)
|
|
58
|
-
: calculateContrastRatio(luminanceB, luminanceA);
|
|
59
|
-
}
|
|
60
|
-
function calcChannelOverlay(match, background, overlay) {
|
|
61
|
-
if (overlay - background === 0) {
|
|
62
|
-
return 0;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return (match - background) / (overlay - background);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function calcRgbOverlay(rgbMatch, rgbBackground, rgbOverlay) {
|
|
69
|
-
const rChannel = calcChannelOverlay(rgbMatch.r, rgbBackground.r, rgbOverlay.r);
|
|
70
|
-
const gChannel = calcChannelOverlay(rgbMatch.g, rgbBackground.g, rgbOverlay.g);
|
|
71
|
-
const bChannel = calcChannelOverlay(rgbMatch.b, rgbBackground.b, rgbOverlay.b);
|
|
72
|
-
return (rChannel + gChannel + bChannel) / 3;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Calculate an overlay color that uses rgba (rgb + alpha) that matches the appearance of a given solid color when placed on the same background
|
|
76
|
-
* @param rgbMatch - The solid color the overlay should match in appearance when placed over the rgbBackground
|
|
77
|
-
* @param rgbBackground - The background on which the overlay rests
|
|
78
|
-
* @param rgbOverlay - The rgb color of the overlay. Typically this is either pure white or pure black and when not provided will be determined automatically. This color will be used in the returned output
|
|
79
|
-
* @returns The rgba (rgb + alpha) color of the overlay
|
|
80
|
-
*
|
|
81
|
-
* @public
|
|
82
|
-
*/
|
|
83
|
-
export function calculateOverlayColor(rgbMatch, rgbBackground, rgbOverlay = null) {
|
|
84
|
-
let alpha = 0;
|
|
85
|
-
let overlay = rgbOverlay;
|
|
86
|
-
if (overlay !== null) {
|
|
87
|
-
alpha = calcRgbOverlay(rgbMatch, rgbBackground, overlay);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
overlay = new ColorRGBA64(0, 0, 0, 1);
|
|
91
|
-
alpha = calcRgbOverlay(rgbMatch, rgbBackground, overlay);
|
|
92
|
-
if (alpha <= 0) {
|
|
93
|
-
overlay = new ColorRGBA64(1, 1, 1, 1);
|
|
94
|
-
alpha = calcRgbOverlay(rgbMatch, rgbBackground, overlay);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
alpha = Math.round(alpha * 1000) / 1000;
|
|
98
|
-
return new ColorRGBA64(overlay.r, overlay.g, overlay.b, alpha);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Converts a {@link @microsoft/fast-colors#ColorRGBA64} to a {@link @microsoft/fast-colors#ColorHSL}
|
|
102
|
-
* @param rgb - the rgb color to convert
|
|
103
|
-
*
|
|
104
|
-
* @remarks
|
|
105
|
-
* The alpha channel of the input is ignored
|
|
106
|
-
*
|
|
107
|
-
* @public
|
|
108
|
-
*/
|
|
109
|
-
export function rgbToHSL(rgb) {
|
|
110
|
-
const max = Math.max(rgb.r, rgb.g, rgb.b);
|
|
111
|
-
const min = Math.min(rgb.r, rgb.g, rgb.b);
|
|
112
|
-
const delta = max - min;
|
|
113
|
-
let hue = 0;
|
|
114
|
-
if (delta !== 0) {
|
|
115
|
-
if (max === rgb.r) {
|
|
116
|
-
hue = 60 * (((rgb.g - rgb.b) / delta) % 6);
|
|
117
|
-
}
|
|
118
|
-
else if (max === rgb.g) {
|
|
119
|
-
hue = 60 * ((rgb.b - rgb.r) / delta + 2);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
hue = 60 * ((rgb.r - rgb.g) / delta + 4);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (hue < 0) {
|
|
126
|
-
hue += 360;
|
|
127
|
-
}
|
|
128
|
-
const lum = (max + min) / 2;
|
|
129
|
-
let sat = 0;
|
|
130
|
-
if (delta !== 0) {
|
|
131
|
-
sat = delta / (1 - Math.abs(2 * lum - 1));
|
|
132
|
-
}
|
|
133
|
-
return new ColorHSL(hue, sat, lum);
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Converts a {@link @microsoft/fast-colors#ColorHSL} to a {@link @microsoft/fast-colors#ColorRGBA64}
|
|
137
|
-
* @param hsl - the hsl color to convert
|
|
138
|
-
* @param alpha - the alpha value
|
|
139
|
-
*
|
|
140
|
-
* @public
|
|
141
|
-
*/
|
|
142
|
-
export function hslToRGB(hsl, alpha = 1) {
|
|
143
|
-
const c = (1 - Math.abs(2 * hsl.l - 1)) * hsl.s;
|
|
144
|
-
const x = c * (1 - Math.abs(((hsl.h / 60) % 2) - 1));
|
|
145
|
-
const m = hsl.l - c / 2;
|
|
146
|
-
let r = 0;
|
|
147
|
-
let g = 0;
|
|
148
|
-
let b = 0;
|
|
149
|
-
if (hsl.h < 60) {
|
|
150
|
-
r = c;
|
|
151
|
-
g = x;
|
|
152
|
-
b = 0;
|
|
153
|
-
}
|
|
154
|
-
else if (hsl.h < 120) {
|
|
155
|
-
r = x;
|
|
156
|
-
g = c;
|
|
157
|
-
b = 0;
|
|
158
|
-
}
|
|
159
|
-
else if (hsl.h < 180) {
|
|
160
|
-
r = 0;
|
|
161
|
-
g = c;
|
|
162
|
-
b = x;
|
|
163
|
-
}
|
|
164
|
-
else if (hsl.h < 240) {
|
|
165
|
-
r = 0;
|
|
166
|
-
g = x;
|
|
167
|
-
b = c;
|
|
168
|
-
}
|
|
169
|
-
else if (hsl.h < 300) {
|
|
170
|
-
r = x;
|
|
171
|
-
g = 0;
|
|
172
|
-
b = c;
|
|
173
|
-
}
|
|
174
|
-
else if (hsl.h < 360) {
|
|
175
|
-
r = c;
|
|
176
|
-
g = 0;
|
|
177
|
-
b = x;
|
|
178
|
-
}
|
|
179
|
-
return new ColorRGBA64(r + m, g + m, b + m, alpha);
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Converts a {@link @microsoft/fast-colors#ColorRGBA64} to a {@link @microsoft/fast-colors#ColorHSV}
|
|
183
|
-
* @param rgb - the rgb color to convert
|
|
184
|
-
*
|
|
185
|
-
* @remarks
|
|
186
|
-
* The alpha channel of the input is ignored
|
|
187
|
-
*
|
|
188
|
-
* @public
|
|
189
|
-
*/
|
|
190
|
-
export function rgbToHSV(rgb) {
|
|
191
|
-
const max = Math.max(rgb.r, rgb.g, rgb.b);
|
|
192
|
-
const min = Math.min(rgb.r, rgb.g, rgb.b);
|
|
193
|
-
const delta = max - min;
|
|
194
|
-
let hue = 0;
|
|
195
|
-
if (delta !== 0) {
|
|
196
|
-
if (max === rgb.r) {
|
|
197
|
-
hue = 60 * (((rgb.g - rgb.b) / delta) % 6);
|
|
198
|
-
}
|
|
199
|
-
else if (max === rgb.g) {
|
|
200
|
-
hue = 60 * ((rgb.b - rgb.r) / delta + 2);
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
hue = 60 * ((rgb.r - rgb.g) / delta + 4);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
if (hue < 0) {
|
|
207
|
-
hue += 360;
|
|
208
|
-
}
|
|
209
|
-
let sat = 0;
|
|
210
|
-
if (max !== 0) {
|
|
211
|
-
sat = delta / max;
|
|
212
|
-
}
|
|
213
|
-
return new ColorHSV(hue, sat, max);
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Converts a {@link @microsoft/fast-colors#ColorHSV} to a {@link @microsoft/fast-colors#ColorRGBA64}
|
|
217
|
-
* @param hsv - the hsv color to convert
|
|
218
|
-
* @param alpha - the alpha value
|
|
219
|
-
*
|
|
220
|
-
* @public
|
|
221
|
-
*/
|
|
222
|
-
export function hsvToRGB(hsv, alpha = 1) {
|
|
223
|
-
const c = hsv.s * hsv.v;
|
|
224
|
-
const x = c * (1 - Math.abs(((hsv.h / 60) % 2) - 1));
|
|
225
|
-
const m = hsv.v - c;
|
|
226
|
-
let r = 0;
|
|
227
|
-
let g = 0;
|
|
228
|
-
let b = 0;
|
|
229
|
-
if (hsv.h < 60) {
|
|
230
|
-
r = c;
|
|
231
|
-
g = x;
|
|
232
|
-
b = 0;
|
|
233
|
-
}
|
|
234
|
-
else if (hsv.h < 120) {
|
|
235
|
-
r = x;
|
|
236
|
-
g = c;
|
|
237
|
-
b = 0;
|
|
238
|
-
}
|
|
239
|
-
else if (hsv.h < 180) {
|
|
240
|
-
r = 0;
|
|
241
|
-
g = c;
|
|
242
|
-
b = x;
|
|
243
|
-
}
|
|
244
|
-
else if (hsv.h < 240) {
|
|
245
|
-
r = 0;
|
|
246
|
-
g = x;
|
|
247
|
-
b = c;
|
|
248
|
-
}
|
|
249
|
-
else if (hsv.h < 300) {
|
|
250
|
-
r = x;
|
|
251
|
-
g = 0;
|
|
252
|
-
b = c;
|
|
253
|
-
}
|
|
254
|
-
else if (hsv.h < 360) {
|
|
255
|
-
r = c;
|
|
256
|
-
g = 0;
|
|
257
|
-
b = x;
|
|
258
|
-
}
|
|
259
|
-
return new ColorRGBA64(r + m, g + m, b + m, alpha);
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Converts a {@link @microsoft/fast-colors#ColorLCH} to a {@link @microsoft/fast-colors#ColorLAB}
|
|
263
|
-
* @param lch - the lch color to convert
|
|
264
|
-
*
|
|
265
|
-
* @public
|
|
266
|
-
*/
|
|
267
|
-
export function lchToLAB(lch) {
|
|
268
|
-
let a = 0;
|
|
269
|
-
let b = 0;
|
|
270
|
-
if (lch.h !== 0) {
|
|
271
|
-
a = Math.cos(degreesToRadians(lch.h)) * lch.c;
|
|
272
|
-
b = Math.sin(degreesToRadians(lch.h)) * lch.c;
|
|
273
|
-
}
|
|
274
|
-
return new ColorLAB(lch.l, a, b);
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Converts a {@link @microsoft/fast-colors#ColorLAB} to a {@link @microsoft/fast-colors#ColorLCH}
|
|
278
|
-
* @param lab - the lab color to convert
|
|
279
|
-
*
|
|
280
|
-
* @remarks
|
|
281
|
-
* The discontinuity in the C parameter at 0 means that floating point errors will often result in values near 0 giving unpredictable results.
|
|
282
|
-
* EG: 0.0000001 gives a very different result than -0.0000001
|
|
283
|
-
* In cases where both a and b are very near zero this function will return an LCH color with an H of 0
|
|
284
|
-
* More info about the atan2 function: {@link https://en.wikipedia.org/wiki/Atan2}
|
|
285
|
-
* @public
|
|
286
|
-
*/
|
|
287
|
-
export function labToLCH(lab) {
|
|
288
|
-
let h = 0;
|
|
289
|
-
// Because of the discontinuity at 0 if a number is very close to 0 - often due to floating point errors - then
|
|
290
|
-
// it gives unexpected results. EG: 0.000000000001 gives a different result than 0. So just avoid any number
|
|
291
|
-
// that has both a and b very close to zero and lump it in with the h = 0 case.
|
|
292
|
-
if (Math.abs(lab.b) > 0.001 || Math.abs(lab.a) > 0.001) {
|
|
293
|
-
h = radiansToDegrees(Math.atan2(lab.b, lab.a));
|
|
294
|
-
}
|
|
295
|
-
if (h < 0) {
|
|
296
|
-
h += 360;
|
|
297
|
-
}
|
|
298
|
-
const c = Math.sqrt(lab.a * lab.a + lab.b * lab.b);
|
|
299
|
-
return new ColorLCH(lab.l, c, h);
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Converts a {@link @microsoft/fast-colors#ColorLAB} to a {@link @microsoft/fast-colors#ColorXYZ}
|
|
303
|
-
* @param lab - the lab color to convert
|
|
304
|
-
*
|
|
305
|
-
* @public
|
|
306
|
-
*/
|
|
307
|
-
export function labToXYZ(lab) {
|
|
308
|
-
const fy = (lab.l + 16) / 116;
|
|
309
|
-
const fx = fy + lab.a / 500;
|
|
310
|
-
const fz = fy - lab.b / 200;
|
|
311
|
-
const xcubed = Math.pow(fx, 3);
|
|
312
|
-
const ycubed = Math.pow(fy, 3);
|
|
313
|
-
const zcubed = Math.pow(fz, 3);
|
|
314
|
-
let x = 0;
|
|
315
|
-
if (xcubed > ColorLAB.epsilon) {
|
|
316
|
-
x = xcubed;
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
x = (116 * fx - 16) / ColorLAB.kappa;
|
|
320
|
-
}
|
|
321
|
-
let y = 0;
|
|
322
|
-
if (lab.l > ColorLAB.epsilon * ColorLAB.kappa) {
|
|
323
|
-
y = ycubed;
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
y = lab.l / ColorLAB.kappa;
|
|
327
|
-
}
|
|
328
|
-
let z = 0;
|
|
329
|
-
if (zcubed > ColorLAB.epsilon) {
|
|
330
|
-
z = zcubed;
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
z = (116 * fz - 16) / ColorLAB.kappa;
|
|
334
|
-
}
|
|
335
|
-
x = ColorXYZ.whitePoint.x * x;
|
|
336
|
-
y = ColorXYZ.whitePoint.y * y;
|
|
337
|
-
z = ColorXYZ.whitePoint.z * z;
|
|
338
|
-
return new ColorXYZ(x, y, z);
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Converts a {@link @microsoft/fast-colors#ColorXYZ} to a {@link @microsoft/fast-colors#ColorLAB}
|
|
342
|
-
* @param xyz - the xyz color to convert
|
|
343
|
-
*
|
|
344
|
-
* @public
|
|
345
|
-
*/
|
|
346
|
-
export function xyzToLAB(xyz) {
|
|
347
|
-
function xyzToLABHelper(i) {
|
|
348
|
-
if (i > ColorLAB.epsilon) {
|
|
349
|
-
return Math.pow(i, 1 / 3);
|
|
350
|
-
}
|
|
351
|
-
return (ColorLAB.kappa * i + 16) / 116;
|
|
352
|
-
}
|
|
353
|
-
const x = xyzToLABHelper(xyz.x / ColorXYZ.whitePoint.x);
|
|
354
|
-
const y = xyzToLABHelper(xyz.y / ColorXYZ.whitePoint.y);
|
|
355
|
-
const z = xyzToLABHelper(xyz.z / ColorXYZ.whitePoint.z);
|
|
356
|
-
const l = 116 * y - 16;
|
|
357
|
-
const a = 500 * (x - y);
|
|
358
|
-
const b = 200 * (y - z);
|
|
359
|
-
return new ColorLAB(l, a, b);
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Converts a {@link @microsoft/fast-colors#ColorRGBA64} to a {@link @microsoft/fast-colors#ColorXYZ}
|
|
363
|
-
* @param rgb - the rgb color to convert
|
|
364
|
-
*
|
|
365
|
-
* @remarks
|
|
366
|
-
* The alpha channel of the input is ignored
|
|
367
|
-
* @public
|
|
368
|
-
*/
|
|
369
|
-
export function rgbToXYZ(rgb) {
|
|
370
|
-
function rgbToXYZHelper(i) {
|
|
371
|
-
if (i <= 0.04045) {
|
|
372
|
-
return i / 12.92;
|
|
373
|
-
}
|
|
374
|
-
return Math.pow((i + 0.055) / 1.055, 2.4);
|
|
375
|
-
}
|
|
376
|
-
const r = rgbToXYZHelper(rgb.r);
|
|
377
|
-
const g = rgbToXYZHelper(rgb.g);
|
|
378
|
-
const b = rgbToXYZHelper(rgb.b);
|
|
379
|
-
const x = r * 0.4124564 + g * 0.3575761 + b * 0.1804375;
|
|
380
|
-
const y = r * 0.2126729 + g * 0.7151522 + b * 0.072175;
|
|
381
|
-
const z = r * 0.0193339 + g * 0.119192 + b * 0.9503041;
|
|
382
|
-
return new ColorXYZ(x, y, z);
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Converts a {@link @microsoft/fast-colors#ColorXYZ} to a {@link @microsoft/fast-colors#ColorRGBA64}
|
|
386
|
-
* @param xyz - the xyz color to convert
|
|
387
|
-
* @param alpha - the alpha value
|
|
388
|
-
*
|
|
389
|
-
* @remarks
|
|
390
|
-
* Note that the xyz color space is significantly larger than sRGB. As such, this can return colors rgb values greater than 1 or less than 0
|
|
391
|
-
* @public
|
|
392
|
-
*/
|
|
393
|
-
export function xyzToRGB(xyz, alpha = 1) {
|
|
394
|
-
function xyzToRGBHelper(i) {
|
|
395
|
-
if (i <= 0.0031308) {
|
|
396
|
-
return i * 12.92;
|
|
397
|
-
}
|
|
398
|
-
return 1.055 * Math.pow(i, 1 / 2.4) - 0.055;
|
|
399
|
-
}
|
|
400
|
-
const r = xyzToRGBHelper(xyz.x * 3.2404542 - xyz.y * 1.5371385 - xyz.z * 0.4985314);
|
|
401
|
-
const g = xyzToRGBHelper(xyz.x * -0.969266 + xyz.y * 1.8760108 + xyz.z * 0.041556);
|
|
402
|
-
const b = xyzToRGBHelper(xyz.x * 0.0556434 - xyz.y * 0.2040259 + xyz.z * 1.0572252);
|
|
403
|
-
return new ColorRGBA64(r, g, b, alpha);
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
* Converts a {@link @microsoft/fast-colors#ColorRGBA64} to a {@link @microsoft/fast-colors#ColorLAB}
|
|
407
|
-
* @param rgb - the rgb color to convert
|
|
408
|
-
*
|
|
409
|
-
* @remarks
|
|
410
|
-
* The alpha channel of the input is ignored
|
|
411
|
-
*
|
|
412
|
-
* @public
|
|
413
|
-
*/
|
|
414
|
-
export function rgbToLAB(rgb) {
|
|
415
|
-
return xyzToLAB(rgbToXYZ(rgb));
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* Converts a {@link @microsoft/fast-colors#ColorLAB} to a {@link @microsoft/fast-colors#ColorRGBA64}
|
|
419
|
-
* @param lab - the LAB color to convert
|
|
420
|
-
* @param alpha - the alpha value
|
|
421
|
-
*
|
|
422
|
-
* @remarks
|
|
423
|
-
* Note that the xyz color space (which the conversion from LAB uses) is significantly larger than sRGB. As such, this can return colors rgb values greater than 1 or less than 0
|
|
424
|
-
*
|
|
425
|
-
* @public
|
|
426
|
-
*/
|
|
427
|
-
export function labToRGB(lab, alpha = 1) {
|
|
428
|
-
return xyzToRGB(labToXYZ(lab), alpha);
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* Convert a {@link @microsoft/fast-colors#ColorRGBA64} to a {@link @microsoft/fast-colors#ColorLCH}
|
|
432
|
-
*
|
|
433
|
-
* @param rgb - the rgb color to convert
|
|
434
|
-
*
|
|
435
|
-
* @remarks
|
|
436
|
-
* The alpha channel of the input is ignored
|
|
437
|
-
*
|
|
438
|
-
* @public
|
|
439
|
-
*/
|
|
440
|
-
export function rgbToLCH(rgb) {
|
|
441
|
-
return labToLCH(rgbToLAB(rgb));
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Convert a {@link @microsoft/fast-colors#ColorLCH} to a {@link @microsoft/fast-colors#ColorRGBA64}
|
|
445
|
-
* @param lch - the LCH color to convert
|
|
446
|
-
* @param alpha - the alpha value
|
|
447
|
-
*
|
|
448
|
-
* @public
|
|
449
|
-
*/
|
|
450
|
-
export function lchToRGB(lch, alpha = 1) {
|
|
451
|
-
return labToRGB(lchToLAB(lch), alpha);
|
|
452
|
-
}
|
|
453
|
-
/**
|
|
454
|
-
* Converts a color temperature to a {@link @microsoft/fast-colors#ColorRGBA64}
|
|
455
|
-
* @param tempKelvin - the temperature to convert
|
|
456
|
-
* @param alpha - the alpha value
|
|
457
|
-
*
|
|
458
|
-
* @public
|
|
459
|
-
*/
|
|
460
|
-
export function temperatureToRGB(tempKelvin, alpha = 1) {
|
|
461
|
-
// The constants I could find assumed a decimal range of [0,255] for each channel. Just going to put a /255.0 at the end
|
|
462
|
-
let r = 0;
|
|
463
|
-
let g = 0;
|
|
464
|
-
let b = 0;
|
|
465
|
-
if (tempKelvin <= 1000) {
|
|
466
|
-
tempKelvin = 1000;
|
|
467
|
-
}
|
|
468
|
-
else if (tempKelvin >= 40000) {
|
|
469
|
-
tempKelvin = 40000;
|
|
470
|
-
}
|
|
471
|
-
if (tempKelvin < 6600.0) {
|
|
472
|
-
r = 255.0;
|
|
473
|
-
g = tempKelvin / 100.0 - 2.0;
|
|
474
|
-
g =
|
|
475
|
-
-155.25485562709179 -
|
|
476
|
-
0.44596950469579133 * g +
|
|
477
|
-
104.49216199393888 * Math.log(g);
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
r = tempKelvin / 100.0 - 55.0;
|
|
481
|
-
r = 351.97690566805693 + 0.114206453784165 * r - 40.25366309332127 * Math.log(r);
|
|
482
|
-
g = tempKelvin / 100.0 - 50.0;
|
|
483
|
-
g = 325.4494125711974 + 0.07943456536662342 * g - 28.0852963507957 * Math.log(g);
|
|
484
|
-
}
|
|
485
|
-
if (tempKelvin >= 6600.0) {
|
|
486
|
-
b = 255.0;
|
|
487
|
-
}
|
|
488
|
-
else if (tempKelvin < 2000.0) {
|
|
489
|
-
b = 0.0;
|
|
490
|
-
}
|
|
491
|
-
else {
|
|
492
|
-
b = tempKelvin / 100.0 - 10;
|
|
493
|
-
b =
|
|
494
|
-
-254.76935184120902 +
|
|
495
|
-
0.8274096064007395 * b +
|
|
496
|
-
115.67994401066147 * Math.log(b);
|
|
497
|
-
}
|
|
498
|
-
return new ColorRGBA64(r / 255, g / 255, b / 255, alpha);
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Convert a rgb color to a color temperature
|
|
502
|
-
* @param rgb - the color to convert
|
|
503
|
-
*
|
|
504
|
-
* @remarks
|
|
505
|
-
* The alpha channel of the input is ignored
|
|
506
|
-
*
|
|
507
|
-
* @public
|
|
508
|
-
*/
|
|
509
|
-
export function rgbToTemperature(rgb) {
|
|
510
|
-
let t = 0;
|
|
511
|
-
let min = 1000;
|
|
512
|
-
let max = 40000;
|
|
513
|
-
while (max - min > 0.4) {
|
|
514
|
-
t = (max + min) / 2.0;
|
|
515
|
-
const testColor = temperatureToRGB(t);
|
|
516
|
-
if (testColor.b / testColor.r >= rgb.b / rgb.r) {
|
|
517
|
-
max = t;
|
|
518
|
-
}
|
|
519
|
-
else {
|
|
520
|
-
min = t;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
return Math.round(t);
|
|
524
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { roundToPrecisionSmall } from "./math-utilities.js";
|
|
2
|
-
/**
|
|
3
|
-
* This uses Hue values in "degree" format. So expect a range of [0,360]. Some other implementations instead uses radians or a normalized Hue with range [0,1]. Be aware of this when checking values or using other libraries.
|
|
4
|
-
*
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export class ColorHSL {
|
|
8
|
-
constructor(hue, sat, lum) {
|
|
9
|
-
this.h = hue;
|
|
10
|
-
this.s = sat;
|
|
11
|
-
this.l = lum;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Construct a {@link ColorHSL} from a config object.
|
|
15
|
-
*/
|
|
16
|
-
static fromObject(data) {
|
|
17
|
-
if (data && !isNaN(data.h) && !isNaN(data.s) && !isNaN(data.l)) {
|
|
18
|
-
return new ColorHSL(data.h, data.s, data.l);
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Determines if a color is equal to another
|
|
24
|
-
* @param rhs - the value to compare
|
|
25
|
-
*/
|
|
26
|
-
equalValue(rhs) {
|
|
27
|
-
return this.h === rhs.h && this.s === rhs.s && this.l === rhs.l;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Returns a new {@link ColorHSL} rounded to the provided precision
|
|
31
|
-
* @param precision - the precision to round to
|
|
32
|
-
*/
|
|
33
|
-
roundToPrecision(precision) {
|
|
34
|
-
return new ColorHSL(roundToPrecisionSmall(this.h, precision), roundToPrecisionSmall(this.s, precision), roundToPrecisionSmall(this.l, precision));
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Returns the {@link ColorHSL} formatted as an object.
|
|
38
|
-
*/
|
|
39
|
-
toObject() {
|
|
40
|
-
return { h: this.h, s: this.s, l: this.l };
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { roundToPrecisionSmall } from "./math-utilities.js";
|
|
2
|
-
/**
|
|
3
|
-
* This uses Hue values in "degree" format. So expect a range of [0,360]. Some other implementations instead uses radians or a normalized Hue with range [0,1]. Be aware of this when checking values or using other libraries.
|
|
4
|
-
*
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export class ColorHSV {
|
|
8
|
-
constructor(hue, sat, val) {
|
|
9
|
-
this.h = hue;
|
|
10
|
-
this.s = sat;
|
|
11
|
-
this.v = val;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Construct a {@link ColorHSV} from a config object.
|
|
15
|
-
*/
|
|
16
|
-
static fromObject(data) {
|
|
17
|
-
if (data && !isNaN(data.h) && !isNaN(data.s) && !isNaN(data.v)) {
|
|
18
|
-
return new ColorHSV(data.h, data.s, data.v);
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Determines if a color is equal to another
|
|
24
|
-
* @param rhs - the value to compare
|
|
25
|
-
*/
|
|
26
|
-
equalValue(rhs) {
|
|
27
|
-
return this.h === rhs.h && this.s === rhs.s && this.v === rhs.v;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Returns a new {@link ColorHSV} rounded to the provided precision
|
|
31
|
-
* @param precision - the precision to round to
|
|
32
|
-
*/
|
|
33
|
-
roundToPrecision(precision) {
|
|
34
|
-
return new ColorHSV(roundToPrecisionSmall(this.h, precision), roundToPrecisionSmall(this.s, precision), roundToPrecisionSmall(this.v, precision));
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Returns the {@link ColorHSV} formatted as an object.
|
|
38
|
-
*/
|
|
39
|
-
toObject() {
|
|
40
|
-
return { h: this.h, s: this.s, v: this.v };
|
|
41
|
-
}
|
|
42
|
-
}
|