I use the LED widget a lot but I do not like the OFF state color and style…
There are two ways to style the LED widget:
ONE: do NOT use lv_led_on, lv_led_off and lv_led_toggle but:
LED OFF code:
lv_led_set_color(objects.led_1, lv_palette_main(LV_PALETTE_GREY)); // choose your ‘off’ color
LED ON code:
lv_led_set_color(objects.led_1, lv_palette_main(LV_PALETTE_RED)); // any color…
or
lv_led_set_color(objects.led_1, lv_color_hex(0xffe62c2c); // choose any hex color
TWO: if you want to NOT have the ‘glow’ effect when the LED is OFF, using the code above, you can use the code below to choose your STYLE and COLOR when the LED is in OFF state:
NOTE: in the OFF state, setting the brightness higher will give you more ‘glow’ effect around the LED’s edges.
LED OFF code:
lv_led_off(objects.led_1);
lv_led_set_color(objects.led_1, lv_color_hex(0xfffbfcfe)); //very light grey
lv_led_set_brightness(objects.led_2, 170);
LED ON code:
lv_led_on(objects.led_1);
lv_led_set_color(objects.led_1, lv_palette_main(LV_PALETTE_RED));
lv_led_set_brightness(objects.led_2, 255);