How to change indicator color of switch?

Hello!
The by default switch color is blue as shown of indicator. I want to change the indicator color to green as shown in the image. Can you please tell me any API used lvgl v8.0 to change the switch color?
blue

Thanks & Regards,
Amreen

Try something like this (change the hex code for your green):

    lv_obj_set_style_bg_color(switchName, lv_color_hex(0x01a2b1), LV_PART_INDICATOR | LV_STATE_CHECKED);

Hope that helps

1 Like

Thanks @elgerg. Given solution is working. :+1:

what about change the color in the not switched case?!
Thanks in advance! :smiley:

PS:
I’ve solved using : lv_obj_set_style_bg_color(switch, lv_palette_darken(LV_PALETTE_GREY, 3), 0); :slight_smile: