Description
The color of line created can’t be changed using _lv_obj_set_style_local_color,the color still be the same with the style added before.
What MCU/Processor/Board and compiler are you using?
STM32L476RCT6
What do you want to achieve?
Change the line color when event happens
What have you tried so far?
I use the refresh style function to see if the style is not applied,but nothing changed.
Code to reproduce
my code
lv_style_init(&line_deco_style);
lv_style_set_line_color(&line_deco_style, LV_STATE_DEFAULT, LV_COLOR_MAKE(0XFF,0X3D,0X32));
lv_style_set_line_width(&line_deco_style, LV_STATE_DEFAULT, 4);
lv_style_set_line_rounded(&line_deco_style, LV_STATE_DEFAULT, true);
static lv_point_t p[] = {{0, 0}, {0, 34}};
list1_line = lv_line_create(home_screen, NULL);
lv_obj_add_style(list1_line, LV_LINE_PART_MAIN, &line_deco_style);
_lv_obj_set_style_local_color(list1_line, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0XFF,0Xe8,0X19));
lv_obj_refresh_style(list1_line,LV_OBJ_PART_MAIN,LV_STATE_DEFAULT);
lv_line_set_points(list1_line, p, 2);
Screenshot and/or video
The color is the same with the style setting,the new set color not working