Style a LED like in the examples

  • Be sure to update lvgl from the latest version from the master branch.

I cannot constantly update to the newest version with my now pretty big project.


I am trying to make LED’s like in the documentation for LED’s. It says “LED with custom style”. What I really like about those is the light coming out of the circle giving the impression that the led is lightning it’s surroundings.
All I need is the styles used for the led in the example.

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

I am working with the simulator in codeblocks.

What LVGL version are you using?


What do you want to achieve?

To have LED’s like in the example.

What have you tried so far?

I made a rounded container with the leds style which changes brightness but I don’t know how to achieve the over the border light effect.
I tried to figure out what style is applied to it in the examples but I couldn’t figure out what is going on but I guess it could be obvious if I was pointed to the right direction.

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*/

Screenshot and/or video

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

These are the default LED styles:

And this is where some properties are overridden based on the brightness:

1 Like

I must admit the second part is a bit too advanced but I am very happy with the result using these styles.