Fixed colorpicker bug
This commit is contained in:
parent
336b527b0e
commit
666af3fffa
|
@ -644,12 +644,15 @@ class MDColorPicker(BaseDialog):
|
|||
|
||||
rgba = [0, 0, 0, 0]
|
||||
if isinstance(selected_color, list):
|
||||
if selected_color[0] > 1:
|
||||
rgba = [x / 255.0 for x in selected_color] + [
|
||||
self._opacity_value_selected_color
|
||||
]
|
||||
else:
|
||||
rgba = selected_color
|
||||
# if selected_color[0] > 1:
|
||||
# rgba = [x / 255.0 for x in selected_color] + [
|
||||
# self._opacity_value_selected_color
|
||||
# ]
|
||||
# else:
|
||||
# rgba = selected_color
|
||||
rgba = [x / 255.0 for x in selected_color] + [
|
||||
self._opacity_value_selected_color
|
||||
]
|
||||
elif isinstance(selected_color, str):
|
||||
rgba = get_color_from_hex(selected_color)[:-1] + [
|
||||
self._opacity_value_selected_color
|
||||
|
|
|
@ -3004,12 +3004,12 @@ class SidebandApp(MDApp):
|
|||
color_picker.open()
|
||||
color_picker.bind(on_release=self.telemetry_fg_select)
|
||||
def job(sender=None):
|
||||
color_picker._rgb = self.sideband.config["telemetry_fg"][:-1]
|
||||
color_picker._rgb = self.sideband.config["telemetry_fg"][0:3]
|
||||
color_picker.ids.view_headline.on_tab_press()
|
||||
Clock.schedule_once(job, 0)
|
||||
|
||||
def telemetry_fg_select(self, instance_color_picker: MDColorPicker, type_color: str, selected_color: Union[list, str]):
|
||||
color = selected_color[:-1] + [1]
|
||||
s = selected_color; color = [s[0], s[1], s[2], 1]
|
||||
self.telemetry_screen.ids.telemetry_icon_preview.icon_color = color
|
||||
self.sideband.config["telemetry_fg"] = color
|
||||
self.sideband.save_configuration()
|
||||
|
@ -3025,12 +3025,12 @@ class SidebandApp(MDApp):
|
|||
color_picker.open()
|
||||
color_picker.bind(on_release=self.telemetry_bg_select)
|
||||
def job(sender=None):
|
||||
color_picker._rgb = self.sideband.config["telemetry_bg"][:-1]
|
||||
color_picker._rgb = self.sideband.config["telemetry_bg"][0:3]
|
||||
color_picker.ids.view_headline.on_tab_press()
|
||||
Clock.schedule_once(job, 0)
|
||||
|
||||
def telemetry_bg_select(self, instance_color_picker: MDColorPicker, type_color: str, selected_color: Union[list, str]):
|
||||
color = selected_color[:-1] + [1]
|
||||
s = selected_color; color = [s[0], s[1], s[2], 1]
|
||||
self.telemetry_screen.ids.telemetry_icon_preview.md_bg_color = color
|
||||
self.sideband.config["telemetry_bg"] = color
|
||||
self.sideband.save_configuration()
|
||||
|
|
Loading…
Reference in New Issue