def handle_update(event):
    frame_color = Color(event['frameColor'])
    frame_scale = event.get('frameScale', '-0.1')
    toolbar_color = Color(event['toolbarColor'])
    toolbar_scale = event.get('toolbarScale', '0.1')
    emit(
        'update', {
            'frameColor': frame_color.hex,
            'toolbarColor': toolbar_color.hex,
            'frameFontColor': frame_color.alternative.hex,
            'toolbarFontColor': toolbar_color.alternative.hex,
            'autoFrameColor': toolbar_color.add_light(1,
                                                      float(frame_scale)).hex,
            'autoToolbarColor': frame_color.add_light(
                1, float(toolbar_scale)).hex,
        })
Beispiel #2
0
 def setup_frame(self, frame: Color):
     self.colors['frame'] = frame
     self.colors['frame_inactive'] = frame.add_light(m=0.9, a=-0.1)
     self.colors['frame_incognito'] = frame.add_light(m=0.9, a=-0.1)
     self.colors['frame_incognito_inactive'] = frame.add_light(m=0.9,
                                                               a=-0.2)