Set default background color and text color

I’m am really new to this and finally got a hello world working using a 240x240 screen on a smartwatch, but the background was white. Is there a way to set the default background of the screen to be dark and the default text to be white?

void display_screen() {
  static lv_style_t style;
  lv_style_set_bg_color(&style, lv_color_black());
  lv_style_set_text_color(&style, lv_color_white());
  String LVGL_Arduino = "Hello World! ";
  lv_obj_t *label = lv_label_create( lv_scr_act() );
  lv_label_set_text( label, LVGL_Arduino.c_str() );
  lv_obj_align( label, LV_ALIGN_CENTER, 0, 0 );

I just see a white square.

Maybe you might take a look at the function lv_style_set_bg_opa

Found this example while searching to set background and text.

1 Like