Bar graph with discrete colors

Hi everyone,

I am currently trying to implement a bar indicator with a discrete color pattern (Green, Yellow, Red), wherein the bar graph shouldn’t change its entire color value once it reaches a certain threshold. See the picture for refference. Does anybody ever tried something like this?

Best regards

Screenshot and/or video

You can achieve this effect by using a slider with images.
lv_obj_set_style_bg_img_src(slider, &images, LV_PART_INDICATOR | LV_STATE_DEFAULT);
image

Hi Liz, thanks for your answer. I guess this could work. Thanks for the responds. I might should have mentioned that we are working on a stm32 board and our Flash space is rather limited. Do you think there is a way to achieve this without images? Maybe with lv_bar_ gradients?