首页 > 其他 > 详细

随机颜色文件 用的时候直接推进去好方便

时间:2014-10-31 15:44:55      阅读:119      评论:0      收藏:0      [点我收藏+]
#import <UIKit/UIKit.h>

@interface UIColor (RandomColor)
//随机颜色
+ (UIColor *)randomColor;
@end


#import "UIColor+RandomColor.h"

@implementation UIColor (RandomColor)

+ (UIColor *)randomColor {
    return [self colorWithRed:arc4random() % 256 / 255.0 green:arc4random() % 256 / 255.0 blue:arc4random() % 256 / 255.0 alpha:1.0];
}


@end


随机颜色文件 用的时候直接推进去好方便

原文:http://blog.csdn.net/snn5love11314/article/details/40654187

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!