How to remove GLOWING effect of LED object?

Description

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?

ESP32-S3

What LVGL version are you using?

V8.3

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.
Cheers,

Hello, I am very sorry to ask you here, because my network is not good, I can not normally browse the LVGL community, or even post questions.

I thought it was rude to ask my question under @Aydin_Yasar’s post, but I did have a problem in development and had to ask for help.

I ran into an unsolvable difficulty when creating slider controls:
The effect I want is that the slider is not valid when clicking on the event, it can be dragged at any point in the slider, but not based on a knob (LV_PART_KNOB), like the volume adjustment on the iPhone, the same event callback.

But I’ve been working on it for a week and I can’t figure it out, and I really need your help!
Processing: 微信图片_20240422172717.jpg…Processing: 微信图片_20240422172706.jpg…

大佬,教教我吧0.0