Try this:
c1 = [1,0,0,1]; // red
c2 = [1,.5,0,1]; // orange
c3 = [1,1,0,1]; // yellow
c4 = [0,1,0,1]; // green
c5 = [0,1,1,1]; // cyan
c6 = [0,0,1,1]; // blue
colors = [c1,c2,c3,c4,c5,c6,c5,c4,c3,c2];
secondsPerColor = 1;
idx = Math.floor((time – inPoint)/secondsPerColor)%colors.length;
colors[idx]
Dan