[UIColor colorWithRed:arc4random_uniform(256)/255.0
green:arc4random_uniform(256)/255.0
blue:arc4random_uniform(256)/255.0 alpha:0.3]
随机数函数arc4random_uniform(x),可以用来产生0~(x-1)范围内的随机数。如果要生成1~x的随机数:arc4random_uniform(x)+1
[UIColor colorWithRed:arc4random_uniform(256)/255.0
green:arc4random_uniform(256)/255.0
blue:arc4random_uniform(256)/255.0 alpha:0.3]
随机数函数arc4random_uniform(x),可以用来产生0~(x-1)范围内的随机数。如果要生成1~x的随机数:arc4random_uniform(x)+1
本文标题:随机颜色,随机数
本文链接:https://www.haomeiwen.com/subject/pezyittx.html
网友评论