From 6f33aa768b99bdf393c12b5c35a4a1b8edeec28b Mon Sep 17 00:00:00 2001 From: Hatice Karatay Date: Thu, 21 Mar 2024 08:05:46 -0400 Subject: [PATCH] Change the slice indicator color with the theme --- jdaviz/core/marks.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/jdaviz/core/marks.py b/jdaviz/core/marks.py index a2634adfd7..e870728896 100644 --- a/jdaviz/core/marks.py +++ b/jdaviz/core/marks.py @@ -6,6 +6,7 @@ from copy import deepcopy from glue.core import HubListener from specutils import Spectrum1D +import ipyvuetify as v from jdaviz.core.events import GlobalDisplayUnitChanged from jdaviz.core.events import (SliceToolStateMessage, LineIdentifyMessage, @@ -20,7 +21,7 @@ 'LineUncertainties', 'ScatterMask', 'SelectedSpaxel', 'MarkersMark', 'FootprintOverlay', 'ApertureMark', 'SpectralExtractionPreview'] -accent_color = "#c75d2c" +accent_color = "#FF9D42" if v.theme.dark_effective else "#c75d2c" class OffscreenLinesMarks(HubListener): @@ -343,15 +344,22 @@ def _value_handle_oob(self, x=None, update_label=False): self._update_label() def _update_colors_opacities(self): + dark_accent = "#FF9D42" + light_accent = "#C75109" + dark_primary = "#53CBFF" + light_primary = "#00617E" # orange (accent) if active, import button blue otherwise (see css in main_styles.vue) if not self._show_if_inactive and not self._active: self.label.visible = False self.visible = False return - self.visible = True self.label.visible = self._show_value - self.colors = ["#c75109" if self._active else "#007BA1"] + if self._active: + self.colors = [dark_accent if v.theme.dark_effective else light_accent] + else: + self.colors = [dark_primary if v.theme.dark_effective else light_primary] + self.opacities = [1.0 if self._active else 0.9] def _on_change_state(self, msg={}):