|
19 | 19 | primary_color=lv.theme_get_color_primary(None) |
20 | 20 | color_string=prefs.get_string("theme_primary_color") |
21 | 21 | ifcolor_string: |
22 | | -color_string=color_string.replace("0x","").replace("#","").strip().lower() |
23 | | -color_int=int(color_string,16) |
24 | | -print(f"Setting primary color:{color_int}") |
25 | | -primary_color=lv.color_hex(color_int) |
| 22 | +try: |
| 23 | +color_string=color_string.replace("0x","").replace("#","").strip().lower() |
| 24 | +color_int=int(color_string,16) |
| 25 | +print(f"Setting primary color:{color_int}") |
| 26 | +primary_color=lv.color_hex(color_int) |
| 27 | +exceptExceptionase: |
| 28 | +print(f"Converting color setting '{color_string}' to lv_color_hex() got exception:{e}") |
26 | 29 | theme=lv.theme_default_init(display._disp_drv,primary_color,lv.color_hex(0xFBDC05),theme_dark_bool,lv.font_montserrat_12) |
27 | 30 |
|
28 | 31 | #display.set_theme(theme) |
|