Open amirgon opened 1 year ago
See: https://forum.lvgl.io/t/gradient-is-not-working-with-lv-draw-rect-dsc-t/10612
rect_dsc.bg_grad.stops[0].color = lv.palette_main(lv.PALETTE.RED) rect_dsc.bg_grad.stops[1].color = lv.palette_main(lv.PALETTE.BLUE)
does not work, because stops is converted to list and does not update the original array upon update.
A workaround can be to the the whole array:
rect_dsc.bg_grad.stops = [ lv.gradient_stop_t({'color': lv.palette_main(lv.PALETTE.RED)}), lv.gradient_stop_t({'color': lv.palette_main(lv.PALETTE.BLUE), 'frac':0xff}) ]
See: https://forum.lvgl.io/t/gradient-is-not-working-with-lv-draw-rect-dsc-t/10612
does not work, because stops is converted to list and does not update the original array upon update.
A workaround can be to the the whole array: