What's the best way to draw lines on a meter bar

I need to make a bar that looks like this:

43339-lines.jpg

I’ve already got the bar working with a slider behind a mask, and made a panel on the right that generates the numbers (they need to by created dynamically)

all that’s left is creating the lines inside the meter.
they need to be created dynamically (prefab) and be able to change color.

i’m fairly new to unity, so i thought maybe someone can suggest a nice way to do this

If you want different colors for different box, the slider texture won’t work. From what I see, you need a step meter and not a smooth sliding meter. You’ll need a white box as texture. Use that as prefab. Recode to instantiate boxes according to the values and change the color of the prefab using color property.