在.h里面的
#import//标准颜色
#define kStyle_Color_按钮蓝 @"#1992f5"
#define kStyle_Color_按钮红 @"#ff524c"
#define kStyle_Color_正文颜色 @"#222"
#define kStyle_Color_文本白 @"#fff"
#define kStyle_Color_文本红 @"#ff4700"
#define kStyle_Color_文本蓝 @"#4A90E2"
#define kStyle_Color_次要文本颜色 @"#666"
#define kStyle_Color_字段颜色 @"#999"
#define kStyle_Color_禁用文本颜色 @"#ccc"
#define kStyle_Color_线条灰 @"#d6d6d6"
#define kStyle_Color_浅线灰 @"#ebebeb"
#define kStyle_Color_背景色 @"#f5f5f5"
//标准字
#define kStyle_FontSize_XL @"21"
#define kStyle_FontSize_L @"18"
#define kStyle_FontSize_M @"15"
#define kStyle_FontSize_S @"14"
#define kStyle_FontSize_XS @"13"
#define kStyle_FontSize_XXS @"12"
#define kStyle_FontSize_XXXS @"11"
#define FontWithSize(_size) [AppStyleConfigure getAppFont:_size]
#define BoldFontWithSize(_size) [AppStyleConfigure getAppBoldFont:_size]
@interface StyleNormKit : NSObject
//获取color
+(UIColor*)getColor:(NSString*)type;
//字体大小
+(CGFloat)getFont:(NSString*)font;
@end
在.m文件里的
#import "StyleNormKit.h"
@implementation StyleNormKit
//获取color
+(UIColor*)getColor:(NSString*)type{
if ([type isEqualToString:kStyle_Color_按钮蓝]) {
return [UIColor colorWithRed:25.f/255.f
green:146.f/255.f
blue:245.f/255.f
alpha:1];
}else if ([type isEqualToString:kStyle_Color_按钮红]) {
return [UIColor colorWithRed:255.f/255.f
green:71.f/255.f
blue:0.0f
alpha:1];
}else if ([type isEqualToString:kStyle_Color_正文颜色]) {
return [UIColor colorWithRed:34.f/255.f
green:34.f/255.f
blue:34.f/255.f
alpha:1];
}else if ([type isEqualToString:kStyle_Color_文本白]) {
return [UIColor colorWithRed:255.f/255.f
green:255.f/255.f
blue:255.f/255.f
alpha:1];
}else if ([type isEqualToString:kStyle_Color_文本红]) {
return [UIColor colorWithRed:255.f/255.f
green:71.f/255.f
blue:0.0
alpha:1];
}else if ([type isEqualToString:kStyle_Color_文本蓝]) {
return [UIColor colorWithRed:74.f/255.f
green:144.f/255.f
blue:226.f/255.f
alpha:1];
}else if ([type isEqualToString:kStyle_Color_次要文本颜色]) {
return [UIColor colorWithRed:102.f/255.f
green:102.f/255.f
blue:102.f/255.f
alpha:1];
}else if ([type isEqualToString:kStyle_Color_字段颜色]) {
return [UIColor colorWithRed:153.f/255.f
green:153.f/255.f
blue:153.f/255.f
alpha:1];
}else if ([type isEqualToString:kStyle_Color_禁用文本颜色]) {
return [UIColor colorWithRed:204.f/255.f
green:204.f/255.f
blue:204.f/255.f
alpha:1];
}else if ([type isEqualToString:kStyle_Color_线条灰]) {
return [UIColor colorWithRed:235.f/255.f
green:235.f/255.f
blue:235.f/255.f
alpha:1];
}else if ([type isEqualToString:kStyle_Color_背景色]) {
return [UIColor colorWithRed:238.f/255.f
green:238.f/255.f
blue:238.f/255.f
alpha:1];
}
return nil;
}
//字体大小
+(CGFloat)getFont:(NSString*)font{
return 0;
}
@end