Customizing LVGL Arc parts


Based in this image theres everything i want to know if its possible to customize and also How like what LV_PART Of the arc are those and what styling should be used on it

sets the width of the arc, in the image above that is going to be the gray color
lv_obj_set_style_arc_width(arc_obj, new_width, 0)

sets the arc indicator width, in the image above that is the blue
lv_obj_set_style_arc_width(arc_obj, new_width, LV_PART_INDICATOR)

sets the color of the arc. This would be the gray part
lv_obj_set_style_arc_color(arc_obj, new_color, 0)

sets the color of the arc indicator which is the blue part
lv_obj_set_style_arc_color(arc_obj, new_color, LV_PART_INDICATOR)

sets the opacity of the arc. This would be the gray part
lv_obj_set_style_arc_opa(arc_obj, new_opa, 0)

sets the opacity of the arc indicator which is the blue part
lv_obj_set_style_arc_opa(arc_obj, new_opa, LV_PART_INDICATOR)

2 Likes

Sir you really solved mt problem quick and easy thanks

no worries m8, glad to help out.

Just to let you know that there is a bug if you have the end of the arc set to be rounded and you set an opacity other than fully opaque the rounded end ends up having a dark spot in it. This is because of the colored circle being placed on top of the colored indicator to make the round end. The bug is known so no need to make a bug report about it. It’s on the “todo” list to get fixed.

Why you dont read Arc (lv_arc) — LVGL documentation

and FYI cool is part Place another object to the knob

I cannot remember off hand if you have to use the obj_set_style_arc_* with LV_PART_KNOB or if you can use functions like lv_obj_set_style_bg_color and lv_obj_set_style_bg_opawith it. It might work for both. I don't think the last 2 functions work using LV_PART_INDICATOR` You would have to play around with it.

i had already read it but still had some doubts

1 Like

what i was really looking for now was this

lv_obj_set_style_arc_opa(arc_obj, new_opa, 0)