This solution requires you to click a button to cause the effect. I don't think that's what you wanted. I believe you solution is not as complicated as this too.
1. Add a new number field to your table of colors called it ColorIndex (done?)
2. Add a row number to each value in your gallery call it GalleryRowNumber (done?) (use the link I sent you on how to do this)
3. Set a variable equal to the number of colors (or rows in this case) in your table of colors (done?). Call the variable VarNumberofColors. You can set this variable in the Startup of the App or the OnVisible of the screen.
4. In the Color property of the gallery to be Lookup(<your table of colors>, ColorIndex = Mod(ThisItem.RowNumber, VarNumberofColors), <name of color field>). Check my syntax on this. Also, make sure what's in your table are "Color.Red", "Color.Black", etc. for your varlues of the <name of color field>.
I can't say that I've built this and tested it, but I believe this will get you to your solution. If I have time I'll build out the code, but thinking you can probably get there with this?
Hope this helps.