chore(demo): fix lv_demo_widget if THEME_DEFAULT is not enabled

This commit is contained in:
Gabor Kiss-Vamosi
2022-05-04 21:14:23 +02:00
parent a99eb6bb6a
commit ed3538a1ad

View File

@@ -1083,10 +1083,10 @@ static void color_event_cb(lv_event_t * e)
lv_palette_t * palette_primary = lv_event_get_user_data(e);
lv_palette_t palette_secondary = (*palette_primary) + 3; /*Use another palette as secondary*/
if(palette_secondary >= _LV_PALETTE_LAST) palette_secondary = 0;
#if LV_USE_THEME_DEFAULT
lv_theme_default_init(NULL, lv_palette_main(*palette_primary), lv_palette_main(palette_secondary),
LV_THEME_DEFAULT_DARK, font_normal);
#endif
lv_color_t color = lv_palette_main(*palette_primary);
lv_style_set_text_color(&style_icon, color);
lv_chart_set_series_color(chart1, ser1, color);