Shader to candy stripe mesh with given color properties

Hi I have a cuboid mesh of width 1, height 1 and depth 6, which I’d like to shade with 3 colors like so:

[19817-screen+shot+2013-12-27+at+20.48.28.png|19817]

Note the colors repeat in a candy stripe sequence along the “depth”, or z-axis.

Is it possible to do this with a shader by supplying the colors at runtime, and if so could you provide even the tiniest of hints what I might research?

Or should I just create a Texture2D and try to align that onto the mesh?

Thanks in advance, Phil.

oh this is easy

just take and create a texture with the 3 colors for example but dont clamp

mark them as a tileable texture

then adjust tiling based on z axis length

so lets say you have 3 colors and by default they are 1/2 a meter
tile it based on times to tile = length / .5f;