Skip to content

Commit

Permalink
Swap case order
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Nov 15, 2023
1 parent 4bdcb69 commit 245785d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jdaviz/configs/default/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,13 +641,14 @@ def apply_RGB_presets(self):
default_opacity = 1
if n_visible > 2:
default_opacity = 1 / math.log2(n_visible)

# Sample along a colormap if we have too many layers
if n_visible >= 2 and n_visible < len(preset_colors):
preset_colors = [preset_colors[i] for i in preset_inds[n_visible]]
elif n_visible > len(preset_colors):
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)]
elif n_visible >= 2 and n_visible < len(preset_colors):
preset_colors = [preset_colors[i] for i in preset_inds[n_visible]]

for i in range(n_visible):
self.layer_selected = visible_layers[i]
Expand Down

0 comments on commit 245785d

Please sign in to comment.