I want an array where each field in the array contains a color code
array(0 => \'#4CFF00\', 1 => \'#FFE97F\')
And I want this to go t
You should use a colour model like Hue-Saturation-Value (HSV), and cycle the hue from 0 degrees all the way around the spectrum to 360 degrees, at which whatever saturation and value suited you. (If you want to go from green->green, just start at 120 degrees)
Here's an illustration which shows the difference between RGB and HSV based gradients: the top gradient is just going from green to red in an RGB model, but the lower one uses HSV, resulting in a more pleasing effect.