From 14dd8c5b2947c92f6643b888d71975e4e8d4ee88 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Mon, 28 Oct 2024 17:17:03 +0100 Subject: [PATCH] fix(colors): extend color map validation for matplotlib and colorcet maps (if available) --- bec_widgets/utils/colors.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bec_widgets/utils/colors.py b/bec_widgets/utils/colors.py index a6d9d365..0cc911b2 100644 --- a/bec_widgets/utils/colors.py +++ b/bec_widgets/utils/colors.py @@ -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(