Hi @kisvegabor,
What colour was the old switch/slider “on”?
IE:
Thanks!
You can use any image editor software to pick the color. E.g. Paint or GIMP. But there are online tools too, such as Online Image color picker
I was hoping you could tell me what the exact colour was.
Thanks
From the lv_conf_template.h
of v7:
Thanks for that.
I have managed to get the sliders to have the right background colour for the LV_PART_INDICATOR but for the life of me I cant get the switch to do the same.
lv_obj_t * switchName = lv_switch_create(parent);
lv_obj_set_pos(switchName, xpos-20, yPos-10);
lv_obj_set_height(switchName, 35); /*Set height*/
lv_obj_set_width(switchName, 100);
//lv_obj_set_style_bg_color(switchName, lv_color_hex(0x494f57), LV_PART_INDICATOR);
lv_obj_set_style_bg_color(switchName, lv_color_hex(0x01a2b1), LV_PART_INDICATOR);
Any ideas what II am doing wrong?
Thanks
For the switch, you should use LV_PART_MAIN
.
MAIN if for the off state:
I want to adjust the on state:
I believe you just need LV_PART_MAIN | LV_STATE_CHECKED
as the selector. I’m not at a PC to confirm the name right now, so hopefully my memory is accurate.
LV_PART_MAIN | LV_STATE_CHECKED doesn’t make any difference either.
According to the docs switch only has 3 parts:
It looks like main is off, knob is the round part and I assumed like slider indicator was for the “on” part but it seems to do nothing.
Maybe I found a bug?
Thanks
It looks like LV_PART_INDICATOR | LV_STATE_CHECKED
works for me.
Bingo, that works as expected.
Thank you!!