From b47d9bfc7d37e7f2c9bdf7d38bc611369d246536 Mon Sep 17 00:00:00 2001 From: Ricky O'Steen Date: Mon, 13 Nov 2023 13:18:43 -0500 Subject: [PATCH] Improve logic for loop Co-authored-by: Kyle Conroy --- .../configs/default/plugins/plot_options/plot_options.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/jdaviz/configs/default/plugins/plot_options/plot_options.py b/jdaviz/configs/default/plugins/plot_options/plot_options.py index 6d7b8abea2..62fdcae11a 100644 --- a/jdaviz/configs/default/plugins/plot_options/plot_options.py +++ b/jdaviz/configs/default/plugins/plot_options/plot_options.py @@ -641,15 +641,12 @@ def apply_RGB_presets(self): # Sample along a colormap if we have too many layers if n_visible > len(preset_colors): cmap = matplotlib.colormaps['gist_rainbow'].resampled(n_visible) + preset_colors = [matplotlib.colors.to_hex(cmap(i), keep_alpha=True) for i in range(n_visible)] for i in range(n_visible): self.layer_selected = visible_layers[i] self.image_opacity_value = default_opacity - if n_visible <= len(preset_colors): - self.image_color_value = preset_colors[i] - else: - self.image_color_value = matplotlib.colors.to_hex(cmap(i), keep_alpha=True) - + self.image_color_value = preset_colors[i] self.stretch_function_value = "arcsinh" self.stretch_preset_value = 99