How to set locally image_recolor


As are having
lv_obj_set_style_local_image_recolor_opa() to modify recoloring opacity locally to an object (without having to modify a style), it is a way to specify which will be the color ?
Something like lv_style_local_set_image_recolor() which doesn’t exist.

What LVGL version are you using?


What do you want to achieve?

Avoid to use a style only the specify the color to apply.

What have you tried so far?

All variations of lv_style_local_set_image_recolor() name. No luck.

By the way, I would appreciate to know where I can find all those functions : I guess they are macros as I can’t find their definition anywhere.


lv_obj_set_style_local_image_recolor ?

Does not exist. Try using:

lv_obj_set_style_local_image_recolor(img1, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, color);
1 Like

Yes, you got it : THANKS :star_struck:

Now, how can I retrieve all these functions and related prototype ?

As there is no reference in LVGL tree for such function, I guess they are only preprocessor aliases. But how to find them ?


For v7, there’s a macro nest in lv_core/lv_obj_style_dec.h that builds them.

For v8, they’re generated in a header file by a Python script, and searching for them will work as expected.

I would recommend looking at the style documentation for a list of properties.