1#
2# Using the text style properties
3#
4
5style = lv.style_t()
6style.init()
7
8style.set_radius(5)
9style.set_bg_opa(lv.OPA.COVER)
10style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 3))
11style.set_border_width(2)
12style.set_border_color(lv.palette_main(lv.PALETTE.BLUE))
13style.set_pad_all(10)
14
15style.set_text_color(lv.palette_main(lv.PALETTE.BLUE))
16style.set_text_letter_space(5)
17style.set_text_line_space(20)
18style.set_text_decor(lv.TEXT_DECOR.UNDERLINE)
19
20# Create an object with the new style
21obj = lv.label(lv.scr_act())
22obj.add_style(style, 0)
23obj.set_text("Text of\n"
24             "a label")
25
26obj.center()
27
28