How to remove GLOWING effect of LED object?


I want to remove the glowing effect of LED object which makes a bit blurry look.

What MCU/Processor/Board and compiler are you using?


What LVGL version are you using?


What do you want to achieve?

I want a simple circle behaving like an LED and toggling the LED color on/off withouth any affect but simply showing provided HEX color codes. Cuz now I give OFF color as 0xd9d9d9 and i got darker (due to lv_led_set_brightness or too glowing shiny one. Same goes for my green color 0x00ff29 either too dark or too glowing!

What have you tried so far?

I played with lv_led_on/off, lv_led_set_brightness in various combinations.

I couldn’t also find a simple circle shape; if I could, I would directly use circle for this purpose.

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

// example: it's too dark and therefore it's not MY given color code
||ui->screen_led_3 = lv_led_create(ui->screen_cont_1);|
||lv_led_set_brightness(ui->screen_led_3, 0);|
||lv_led_set_color(ui->screen_led_3, lv_color_hex(0xD9D9D9));|
||lv_obj_set_pos(ui->screen_led_3, 166, 184);|
||lv_obj_set_size(ui->screen_led_3, 10, 10);|

// Example: it's correct color but this time TOO glowing at the edges hence it doesn't work as we're required. 
||lv_led_set_brightness(ui->screen_led_3, 255);|
||lv_led_set_color(ui->screen_led_3, lv_color_hex(0xD9D9D9));|
||lv_obj_set_pos(ui->screen_led_3, 166, 184);|
||lv_obj_set_size(ui->screen_led_3, 10, 10);|

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

below is the UI design that we want to achieve.
Screen Shot 2024-04-15 at 19.36.01

and below is what we got (shot photo from real display so quality is a bit bad; sorry)

1 Like

lv_obj_set_style_shadow_spread(led, 0, LV_PART_MAIN | LV_STATE_DEFAULT)

Thank you very much Li Zhao Ming… It works exactly as we needed! :slight_smile:

I am troubled by the same problem!!
lvgl version 8.3 has too few apis, many Settings are not available, and it is difficult for a novice like me to achieve what I want.

You know I’m also very new in this and so far community and LVGL team helped us quite well. We’re very happy to have such a library being offered as open source.