标签:
1.产生随机颜色:
-(UIColor *)randomColor{ //产生随机颜色
static BOOL seed = NO;
if (!seed) {
seed = YES;
srandom(time(NULL));
}
CGFloat red = (CGFloat)random()/(CGFloat)RAND_MAX;
CGFloat green = (CGFloat)random()/(CGFloat)RAND_MAX;
CGFloat blue = (CGFloat)random()/(CGFloat)RAND_MAX;
return [UIColor colorWithRed:red green:green blue:blue alpha:1.0f];//alpha为1.0,颜色完全不透明
}
标签:
原文地址:http://www.cnblogs.com/zhanggui/p/4242727.html