首页 > 代码库 > 给UIColor 添加自定义属性(颜色)

给UIColor 添加自定义属性(颜色)

#import <UIKit/UIKit.h>

@interface UIColor (Addition)
+ (UIColor *)lightGreenColor;
@end


#import "UIColor+Addition.h"

@implementation UIColor (Addition)


+ (UIColor *)lightGreenColor
{
    return [UIColor colorWithRed:kRed/255.0 green:kGreen/255.0 blue:kBlue/255.0 alpha:1.0];
}
@end

给UIColor 添加自定义属性(颜色)