Example #1
0
    def __init__(self, **kwargs):
        is_dark = kwargs.pop('is_dark', False)
        self._rgb = {
            **colors.accent_colors(is_dark),
            **colors.foreground_background(is_dark)
        }

        super().__init__(**kwargs)

        self.sync_light_or_dark(is_dark, do_refresh=False)
Example #2
0
def light_or_dark(is_dark=True):
    accent = colors.accent_colors(is_dark)
    fb = colors.foreground_background(is_dark)
    rgb = {
        'profile': fb['foreground'],
        'edge': fb['foreground'],
        'ct': accent['blue'],
        'ray': fb['foreground'],
        'rayfan_fill': [254, 197, 254, 64],  # magenta, 25%
        'ax_ray': rgb2mpl([138, 43, 226]),  # blueviolet
        'pr_ray': rgb2mpl([198, 113, 113]),  # sgi salmon
    }
    return {**rgb, **accent, **fb}
Example #3
0
 def sync_light_or_dark(self, is_dark, do_refresh=True):
     self._rgb = {
         **colors.accent_colors(is_dark),
         **colors.foreground_background(is_dark)
     }
     apply_style(is_dark)
     self.set_facecolor(self._rgb['background'])
     if hasattr(self, 'ax'):
         axes = self.ax
         axes.set_facecolor(self._rgb['background1'])
         axes.tick_params(colors=self._rgb['foreground'],
                          grid_color=self._rgb['background'])
     if do_refresh:
         self.refresh()
Example #4
0
def light_or_dark(is_dark=True):
    accent = colors.accent_colors(is_dark)
    fb = colors.foreground_background(is_dark)
    rgb = {
        'node': fb['foreground'],
        'edge': fb['foreground'],
        # 'node': accent['cyan'],
        # 'edge': accent['cyan'],
        'slide': accent['blue'],
        'object_image': accent['magenta'],
        'stop': accent['magenta'],
        'conj_line': accent['orange'],
        'shift': fb['foreground'],
        'barrel': accent['green'],
        }
    return {**rgb, **fb}