Description
I have some sliders that I want to set the background colour. For the life of me I cant find out whats going wrong. The colour that I set isnt the one that ends up on screen…
What MCU/Processor/Board and compiler are you using?
Simulator
What LVGL version are you using?
8.1
What do you want to achieve?
Set the slider main to the value I want…
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
lv_obj_t * sliderName = lv_slider_create(parent);
//lv_obj_remove_style_all(sliderName);
//lv_obj_set_width(blslider, screenWidth-100); /*Set the width*/
lv_obj_set_pos(sliderName, xpos, yPos);
lv_obj_set_height(sliderName, 25); /*Set height*/
lv_obj_set_width(sliderName, sliderWidth);
lv_obj_set_style_bg_color(sliderName, lv_color_hex(0x01a2b1), LV_PART_INDICATOR);
lv_obj_set_style_opa(sliderName, LV_OPA_100, LV_PART_MAIN);
lv_obj_set_style_bg_color(sliderName, lv_color_hex(0x000000), LV_PART_MAIN);
static lv_style_t style_slider;
lv_style_init(&style_slider);
lv_style_set_bg_color(&style_slider, lv_color_hex(0x58585E));
lv_obj_add_style(sliderName, &style_slider, LV_PART_KNOB);
Screenshot and/or video
This clearly isnt 0x000000…
Thanks!