声明一个类方法
Header file UIColor+XYZPalette.h
:
@interface UIColor (XYZPalette)
+(UIColor *)xyz_indigoColor;
@end
和实施 UIColor+XYZPalette.m
:
@implementation UIColor (XYZPalette)
+(UIColor *)xyz_indigoColor
{
return [UIColor colorWithRed:75/255.0f green:0/255.0f blue:130/255.0f alpha:1.0f];
}
@end