0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 19:21:50 +02:00

fix(colors): extend color map validation for matplotlib and colorcet maps (if available)

This commit is contained in:
2024-10-28 17:17:03 +01:00
parent b039933405
commit 14dd8c5b29

View File

@ -482,7 +482,11 @@ class Colors:
Raises:
PydanticCustomError: If colormap is invalid.
"""
available_colormaps = pg.colormap.listMaps()
available_pg_maps = pg.colormap.listMaps()
available_mpl_maps = pg.colormap.listMaps("matplotlib")
available_mpl_colorcet = pg.colormap.listMaps("colorcet")
available_colormaps = available_pg_maps + available_mpl_maps + available_mpl_colorcet
if color_map not in available_colormaps:
if return_error:
raise PydanticCustomError(