acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

lv_example_style_2.py (499B)

      1 #
      2 # Using the background style properties
      3 #
      4 style = lv.style_t()
      5 style.init()
      6 style.set_radius(5)
      7 
      8 # Make a gradient
      9 style.set_bg_opa(lv.OPA.COVER)
     10 style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1))
     11 style.set_bg_grad_color(lv.palette_main(lv.PALETTE.BLUE))
     12 style.set_bg_grad_dir(lv.GRAD_DIR.VER)
     13 
     14 # Shift the gradient to the bottom
     15 style.set_bg_main_stop(128)
     16 style.set_bg_grad_stop(192)
     17 
     18 # Create an object with the new style
     19 obj = lv.obj(lv.scr_act())
     20 obj.add_style(style, 0)
     21 obj.center()