1#
2# Using the Shadow style properties
3#
4
5style = lv.style_t()
6style.init()
7
8# Set a background color and a radius
9style.set_radius(5)
10style.set_bg_opa(lv.OPA.COVER)
11style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1))
12
13# Add a shadow
14style.set_shadow_width(8)
15style.set_shadow_color(lv.palette_main(lv.PALETTE.BLUE))
16style.set_shadow_ofs_x(10)
17style.set_shadow_ofs_y(20)
18
19# Create an object with the new style
20obj = lv.obj(lv.scr_act())
21obj.add_style(style, 0)
22obj.center()
23