Slider with multiple colors

Hi guys,

Problem:
Does anyone know how to create a slider with multiple colors (refer image below) that can be controlled via script? Or any other method that’s feasible.

What I need:
In the attached image, the blue color is idle time and the purple color is active time. The time frame is 60 seconds. So 5 seconds it’s idle, and then the following 5 seconds it’s active and so forth.

What I’ve tried
Overlapping multiple sliders but I’ll need to have lots of sliders in the worst case scenario that the active time switches on every other seconds. I’ve tried line rendered but it doesn’t scale well in 2D with my GUI.

Any help is appreciated. Thanks. I’m on Unity 2017.3.1p4.
113693-untitled.png

Good day.

I think you have 2 options:

  1. Create your own slider script/sprites
  2. Delete Slider background, use a invisible Slider fill area, and via script move / expand / reduce sizes of the bule/purple zones.

Try it! Sure you will get it!

Bye :smiley: