接口部分
@interface UIColor (Extend)
+ (UIColor *)corlorWithR:(CGFloat)r G:(CGFloat)g B:(CGFloat)b;
@end
实现部分
@implementation UIColor (Extend)
+ (UIColor *)corlorWithR:(CGFloat)r G:(CGFloat)g B:(CGFloat)b
{
return [UIColor colorWithRed:r / 255.0 green:g / 255.0 blue:b / 255.0 alpha:1];
}
@end
网友评论