Description
When setting a lv_style_const_prop_t value involving colors (border color, bg_color, outline_color, shadow_color, etc) the entered color value is converted from a 32-bit integer to an 8-bit integer. This means you can only modify the blue color channel, and you cannot modify green or red channels.
This can be corrected by changing the .value field in lv_style_gen.h from .color to .num:
#define LV_STYLE_CONST_BG_COLOR(val)
{
.prop = LV_STYLE_BG_OPA, .value = { .color .num = Val }
}
What MCU/Processor/Board and compiler are you using?
Desktop Linux, x86, GCC
What LVGL version are you using?
V9.2.2
What do you want to achieve?
Properly set const color style
What have you tried so far?
Modifying lv_style_gen.h can fix the issue
Code to reproduce
const lv_style_const_prop_t style_props = {
LV_STYLE_CONST_BG_COLOR(0xFFFFFF), //should be white, is blue due to error
LV_STYLE_CONST_PROPS_END
};
LV_STYLE_CONST_INIT(myStyle, &style_props);