I am setting up an array that has a transition throughout he colors of the rainbow. Right now I've just manually entered the colors in the array but there are too many to manually type... as of now I just go from 0.25 to 0.5 to 0.75 to 1 and so on until I go from Red to green to blue and back. (see code below) how can I have the array automatically generate the colors with more than just 0.25 --> 0.5 --> 0.75 but maybe 0.05 --> 0.10 --> 0.15 --> 0.20 and so on,... here is my array:
rainbowColors = [[NSArray alloc] initWithObjects:
[UIColor colorWithRed:1 green:0 blue:0 alpha:1],
[UIColor colorWithRed:1 green:0.25 blue:0 alpha:1],
[UIColor colorWithRed:1 green:0.5 blue:0 alpha:1],
[UIColor colorWithRed:1 green:0.75 blue:0 alpha:1],
[UIColor colorWithRed:1 green:1 blue:0 alpha:1],
[UIColor colorWithRed:0.75 green:1 blue:0 alpha:1],
[UIColor colorWithRed:0.5 green:1 blue:0 alpha:1],
[UIColor colorWithRed:0.25 green:1 blue:0 alpha:1],
[UIColor colorWithRed:0 green:1 blue:0 alpha:1],
[UIColor colorWithRed:0 green:1 blue:0.25 alpha:1],
[UIColor colorWithRed:0 green:1 blue:0.5 alpha:1],
[UIColor colorWithRed:0 green:1 blue:0.75 alpha:1],
[UIColor colorWithRed:0 green:1 blue:1 alpha:1],
[UIColor colorWithRed:0 green:0.75 blue:1 alpha:1],
[UIColor colorWithRed:0 green:0.5 blue:1 alpha:1],
[UIColor colorWithRed:0 green:0.25 blue:1 alpha:1],
[UIColor colorWithRed:0 green:0 blue:1 alpha:1],
[UIColor colorWithRed:0.25 green:0 blue:1 alpha:1],
[UIColor colorWithRed:0.5 green:0 blue:1 alpha:1],
[UIColor colorWithRed:0.75 green:0 blue:1 alpha:1],
[UIColor colorWithRed:1 green:0 blue:1 alpha:1],
[UIColor colorWithRed:1 green:0 blue:0.75 alpha:1],
[UIColor colorWithRed:1 green:0 blue:0.5 alpha:1],
[UIColor colorWithRed:1 green:0 blue:0.25 alpha:1],nil];