Skip to content

Commit

Permalink
Change the slice indicator color with the theme
Browse files Browse the repository at this point in the history
  • Loading branch information
haticekaratay committed Mar 21, 2024
1 parent ee2c26d commit 6f33aa7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions jdaviz/core/marks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand Down Expand Up @@ -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={}):
Expand Down

0 comments on commit 6f33aa7

Please sign in to comment.