3636 DEFAULT_COLORMAPS ,
3737 build_icon_from_cmap ,
3838 build_icon_from_cmap_name ,
39+ get_cmap ,
3940)
4041from plotpy .tools .base import (
4142 CommandTool ,
@@ -530,12 +531,10 @@ def activate_cmap(
530531 if isinstance (cmap , QAction ):
531532 self ._active_colormap = cmap .data () # type: ignore
532533 elif isinstance (cmap , str ):
533- cmap = cmap .lower ()
534- assert cmap in ALL_COLORMAPS
535- self ._active_colormap = ALL_COLORMAPS [cmap ]
534+ self ._active_colormap = get_cmap (cmap )
536535 elif isinstance (cmap , CustomQwtLinearColormap ):
537536 self ._active_colormap = cmap
538-
537+ *
539538 plot = self .get_active_plot ()
540539 if self ._active_colormap is not None and plot is not None :
541540 items = self .get_selected_images (plot )
@@ -560,9 +559,7 @@ def update_status(self, plot: BasePlot):
560559 cmap_name = item .get_color_map_name ()
561560 if cmap_name :
562561 icon = build_icon_from_cmap_name (cmap_name )
563- self ._active_colormap = ALL_COLORMAPS .get (
564- cmap_name .lower (), DEFAULT
565- )
562+ self ._active_colormap = get_cmap (cmap_name )
566563 else :
567564 self .action .setEnabled (False )
568565 self ._active_colormap = ALL_COLORMAPS .get ("jet" , DEFAULT )
0 commit comments