首页 > 代码库 > 关于项目颜色和字体的宏定义

关于项目颜色和字体的宏定义

我们项目的使用方法如下:
 
#define Near_Final_Color_C1  @"#ffffff"
#define Near_Final_Color_C2  @
"#e9e9e9"
#define Near_Final_Color_C3  @
"#333333"
#define Near_Final_Color_C4  @
"#999999"
#define Near_Final_Color_C6  @
"#248aca"
#define Near_Final_Color_C7  @
"#efefef"
#define Near_Final_Color_C8  @
"#dddddd"
#define Near_Final_Color_C9  @
"#cccccc"
#define Near_Final_Color_C10  @
"#666666"
#define Near_Final_Color_C11  @
"#fff2ce"
#define Near_Final_Color_C12  @
"#ff8542"
#define Near_Final_Color_C13  @
"#ffbca9"
#define Near_Final_Color_C14  @
"#fafafa"
#define Near_Final_Color_C15  @
"#f9f9f9"
#define Near_Final_Color_C16  @
"#eaeaea"
#define Near_Final_Color_C17  @
"#ff9a00"
#define Near_Final_Color_C18  @
"#a800ff"
#define Near_Final_Color_C19  @
"#ef5e4d"
#define Near_Final_Color_C20  @
"#f5f4ef"
#define Near_Final_Color_C21  @
"#93cb54"
#define Near_Final_Color_C22  @
"#f77721"
#define Near_Final_Color_C23  @
"#f3cb3a"
#define Near_Final_Color_C24  @
"#9697ad"
#define Near_Final_Color_C25  @
"#000000"
#define Near_Final_Color_C26  @
"#61cef1"
#define Near_Final_Color_C27  @
"#66d0ff"
#define Near_Final_Color_C28  @
"#a8d8f9"
#define Near_Final_Color_warnColor  @
"#77bfdf"
#define Near_Final_Color_roombackground  @
"#2a2c38"
#define Near_Final_Color_icondefine  @
"#40424f"

//主色调
#define Near_Final_Color_Main Near_Final_Color_C19

#define NF_Color_C1     [ColorUtil cl_colorWithHexString: Near_Final_Color_C1]
#define NF_Color_C2     [ColorUtil cl_colorWithHexString: Near_Final_Color_C2]
#define NF_Color_C3     [ColorUtil cl_colorWithHexString: Near_Final_Color_C3]
#define NF_Color_C4     [ColorUtil cl_colorWithHexString: Near_Final_Color_C4]
#define NF_Color_C6     [ColorUtil cl_colorWithHexString: Near_Final_Color_C6]
#define NF_Color_C7     [ColorUtil cl_colorWithHexString: Near_Final_Color_C7]
#define NF_Color_C8     [ColorUtil cl_colorWithHexString: Near_Final_Color_C8]
#define NF_Color_C9     [ColorUtil cl_colorWithHexString: Near_Final_Color_C9]
#define NF_Color_C10    [ColorUtil cl_colorWithHexString: Near_Final_Color_C10]
#define NF_Color_C11    [ColorUtil cl_colorWithHexString: Near_Final_Color_C11]
#define NF_Color_C12    [ColorUtil cl_colorWithHexString: Near_Final_Color_C12]
#define NF_Color_C13    [ColorUtil cl_colorWithHexString: Near_Final_Color_C13]
#define NF_Color_C14    [ColorUtil cl_colorWithHexString: Near_Final_Color_C14]
#define NF_Color_C15    [ColorUtil cl_colorWithHexString: Near_Final_Color_C15]
#define NF_Color_C16    [ColorUtil cl_colorWithHexString: Near_Final_Color_C16]
#define NF_Color_C17    [ColorUtil cl_colorWithHexString: Near_Final_Color_C17]
#define NF_Color_C18    [ColorUtil cl_colorWithHexString: Near_Final_Color_C18]
#define NF_Color_C19    [ColorUtil cl_colorWithHexString: Near_Final_Color_C19]
#define NF_Color_C20    [ColorUtil cl_colorWithHexString: Near_Final_Color_C20]
#define NF_Color_C21    [ColorUtil cl_colorWithHexString: Near_Final_Color_C21]
#define NF_Color_C22    [ColorUtil cl_colorWithHexString: Near_Final_Color_C22]
#define NF_Color_C23    [ColorUtil cl_colorWithHexString: Near_Final_Color_C23]
#define NF_Color_C24    [ColorUtil cl_colorWithHexString: Near_Final_Color_C24]
#define NF_Color_C25    [ColorUtil cl_colorWithHexString: Near_Final_Color_C25]
#define NF_Color_C26    [ColorUtil cl_colorWithHexString: Near_Final_Color_C26]
#define NF_Color_C27    [ColorUtil cl_colorWithHexString: Near_Final_Color_C27]
#define NF_Color_C28    [ColorUtil cl_colorWithHexString: Near_Final_Color_C28]

#define NF_Color_SplitLine    [ColorUtil cl_colorWithHexString:Near_Final_Color_C7]
#define NF_Color_Main         [ColorUtil cl_colorWithHexString:Near_Final_Color_Main]

#define Near_Final_Font_T1   (18 / 2)
#define Near_Final_Font_T2   (
20 / 2)
#define Near_Final_Font_T3   (
24 / 2)
#define Near_Final_Font_T4   (
28 / 2)
#define Near_Final_Font_T5   (
30 / 2)
#define Near_Final_Font_T6   (
32 / 2)
#define Near_Final_Font_T7   (
36 / 2)
#define Near_Final_Font_T8   (
42 / 2)
#define Near_Final_Font_T9   (
26 / 2)
#define Near_Final_Font_T10  (
22 / 2)
#define Near_Final_Font_T11  (
34 / 2)
#define Near_Final_Font_T12  (
16 / 2)
#define Near_Final_Font_T13  (
40 / 2)

 
 技术分享
 
 
 技术分享
 
 
使用例子方法:
 
_roomId = [[UILabelalloc] init];
_roomId.font = [UIFontsystemFontOfSize:Near_Final_Font_T2];
_roomId.textColor = NF_Color_C1;
 
_gameIcon = [[UIImageViewalloc] initWithFrame:CGRectMake(10, 23, 45, 45)];
_gameIcon.image = [UIImageimageNamed:@"app_icon"];
_gameIcon.layer.masksToBounds = YES;
_gameIcon.layer.borderWidth = 1.0f;
_gameIcon.layer.borderColor = NF_Color_C9.CGColor;
_gameIcon.layer.cornerRadius = _gameIcon.bounds.size.width/2;

 
 
思考与行动:
 
1.这样宏定义的好处在哪里?
 
2. Near_Final_Color_C1 和  NF_Color_C1  有啥区别?
 

关于项目颜色和字体的宏定义