mirror of
https://github.com/pyapp-kit/superqt.git
synced 2026-01-04 11:21:09 +01:00
Add colormap combobox and utils (#195)
* feat: add colormap combobox * working on styles * add comment * style: [pre-commit.ci] auto fixes [...] * progress on combo * style: [pre-commit.ci] auto fixes [...] * decent styles * move stuff around * adding tests * add numpy for tests * add cmap to tests * fix type * fix for pyqt * remove topointf * better lineedit styles * better add colormap * increate linux atol * cast to int * more tests * tests * try fix * try fix test * again * skip pyside * test import * fix lineedit * add checkerboard for transparency --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
19
examples/colormap_combo_box.py
Normal file
19
examples/colormap_combo_box.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget
|
||||
|
||||
from superqt.cmap import CmapCatalogComboBox, QColormapComboBox
|
||||
|
||||
app = QApplication([])
|
||||
|
||||
wdg = QWidget()
|
||||
layout = QVBoxLayout(wdg)
|
||||
|
||||
catalog_combo = CmapCatalogComboBox(interpolation="linear")
|
||||
|
||||
selected_cmap_combo = QColormapComboBox(allow_user_colormaps=True)
|
||||
selected_cmap_combo.addColormaps(["viridis", "plasma", "magma", "inferno", "turbo"])
|
||||
|
||||
layout.addWidget(catalog_combo)
|
||||
layout.addWidget(selected_cmap_combo)
|
||||
|
||||
wdg.show()
|
||||
app.exec()
|
||||
Reference in New Issue
Block a user