I would like to change the color of several objects dynamically during runtime. For example, by selecting the color via a color wheel.
I use LVGL v8.4.0 and create/export the UI with Squareline Studio.
I can export the UI with objects that each have an individual color setting.
Changing the color of each individual object would be possible, but very time consuming.
I had assumed that I could create a global style/theme with a color that I could then change.
I have not yet found a solution to dynamically change a globally defined color property.
This did not lead to success. The color change works, but I have to call ui_object_set_themeable_style_property() for each object. Code:
ui_theme_variable_t newColor[1] = {0xFFFFFF};
ui_object_set_themeable_style_property(ui_object, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR, newColor);
_ui_theme_set_variable_styles(UI_VARIABLE_STYLES_MODE_FOLLOW);
Regards René