Dynamic Gradient Linear Fill

I have a 600x200 Pixel Box and want to change its color dynamicaly (with an Array of Colors maybe?) to a Linear Gradient Fill with 4 Colors (Red,Blue,Yellow and Cyan).

Can any1 help me out with this???