0
- (void) initColorsSet {
colors = [NSMutableArray new];

[colors addObject:[UIColor colorWithR:51  G:102 B:255]]; 
[colors addObject:[UIColor colorWithR:137 G:173 B:1]]; 
[colors addObject:[UIColor colorWithR:253 G:213 B:55]]; 
[colors addObject:[UIColor colorWithR:239 G:78  B:34]];
[colors addObject:[UIColor colorWithR:186 G:0  B:187]];
[colors addObject:[UIColor colorWithR:255 G:109  B:254]];
[colors addObject:[UIColor colorWithR:0 G:193  B:0]];
[colors addObject:[UIColor colorWithR:101 G:255 B:255]]; 
[colors addObject:[UIColor colorWithR:233 G:0  B:104]];
[colors addObject:[UIColor colorWithR:196 G:255  B:104]];
[colors addObject:[UIColor colorWithR:254 G:240  B:170]];
[colors addObject:[UIColor colorWithR:2 G:227  B:166]];

for (NSInteger i = [colors count]; i < 60; i++ ) {
    [colors addObject:[UIColor colorWithR:(((float)arc4random()/0x100000000)*255)
                                        G:(((float)arc4random()/0x100000000)*255)
                                        B:(((float)arc4random()/0x100000000)*255) ]]; 
}

}

- (UIColor*) colorByIndex:(int)index {
    int trueIndex = index >= 12 ? index % 12 : index;
    return [colors objectAtIndex:trueIndex];
}

从上面的代码中我需要删除渐变效果,我该怎么做?谢谢

4

0 回答 0