From 75ec8816f6202ab995183ad6402b7d20fd70f06d Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 4 Sep 2021 14:56:09 +0200 Subject: [PATCH] Fix LVGO color names --- tasmota/berry/examples/watch_renaissance/autoexec.be | 4 ++-- tasmota/berry/lvgl_examples/drawing_2.be | 10 +++++----- tasmota/berry/lvgl_examples/lvgl_demo.be | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tasmota/berry/examples/watch_renaissance/autoexec.be b/tasmota/berry/examples/watch_renaissance/autoexec.be index 37adda377..6acdc8860 100644 --- a/tasmota/berry/examples/watch_renaissance/autoexec.be +++ b/tasmota/berry/examples/watch_renaissance/autoexec.be @@ -11,13 +11,13 @@ lv.start() scr = lv.scr_act() -scr.set_style_local_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(lv.BLACK)) +scr.set_style_local_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(lv.COLOR_BLACK)) ren_back = lv_img(scr) ren_back.set_src("A:/watch_ren_back_240.png") ren_back.align(0, lv.ALIGN_CENTER, 0, 0) ren_day = lv_label(ren_back) -ren_day.set_style_local_text_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(lv.BLACK)) +ren_day.set_style_local_text_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(lv.COLOR_BLACK)) ren_day.set_long_mode(lv.LABEL_LONG_CROP) ren_day.set_align(lv.LABEL_ALIGN_CENTER) ren_day.set_text("") diff --git a/tasmota/berry/lvgl_examples/drawing_2.be b/tasmota/berry/lvgl_examples/drawing_2.be index 8903b389d..94cdcb9af 100644 --- a/tasmota/berry/lvgl_examples/drawing_2.be +++ b/tasmota/berry/lvgl_examples/drawing_2.be @@ -16,13 +16,13 @@ mask_map.resize(MASK_WIDTH * MASK_HEIGHT * 4) # Create a "8 bit alpha" canvas and clear it canvas = lv_canvas(lv.scr_act()) canvas.set_buffer(mask_map, MASK_WIDTH, MASK_HEIGHT, lv.IMG_CF_ALPHA_8BIT) -canvas.fill_bg(lv_color(lv.BLACK), lv.OPA_TRANSP) -canvas.fill_bg(lv_color(lv.BLACK), lv.OPA_50) +canvas.fill_bg(lv_color(lv.COLOR_BLACK), lv.OPA_TRANSP) +canvas.fill_bg(lv_color(lv.COLOR_BLACK), lv.OPA_50) # Draw a label to the canvas. The result "image" will be used as mask label_dsc = lv_draw_label_dsc() lv.draw_label_dsc_init(label_dsc) -label_dsc.color = lv_color(lv.WHITE) +label_dsc.color = lv_color(lv.COLOR_WHITE) canvas.draw_text(5, 5, MASK_WIDTH, label_dsc, "Text with gradient", lv.LABEL_ALIGN_CENTER) # The mask is read, the canvas is not required anymore @@ -46,8 +46,8 @@ om.add_mask(m) # Create a style with gradient style_bg = lv_style() style_bg.set_bg_opa(lv.STATE_DEFAULT, lv.OPA_COVER) -style_bg.set_bg_color(lv.STATE_DEFAULT, lv_color(lv.RED)) -style_bg.set_bg_grad_color(lv.STATE_DEFAULT, lv_color(lv.BLUE)) +style_bg.set_bg_color(lv.STATE_DEFAULT, lv_color(lv.COLOR_RED)) +style_bg.set_bg_grad_color(lv.STATE_DEFAULT, lv_color(lv.COLOR_BLUE)) style_bg.set_bg_grad_dir(lv.STATE_DEFAULT, lv.GRAD_DIR_HOR) # Create and object with the gradient style on the object mask. diff --git a/tasmota/berry/lvgl_examples/lvgl_demo.be b/tasmota/berry/lvgl_examples/lvgl_demo.be index b3ff41869..823f3b472 100644 --- a/tasmota/berry/lvgl_examples/lvgl_demo.be +++ b/tasmota/berry/lvgl_examples/lvgl_demo.be @@ -59,7 +59,7 @@ log.set_style_local_pad_right(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, log_height+1) bars = lv_wifi_bars(log) -bars.set_style_local_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(lv.BLACK)) +bars.set_style_local_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(lv.COLOR_BLACK)) bars.set_height(log_height) bars.set_width(log_height)