iOS 项目中宏定义RGB颜色

项目中label、Text文本或许是IconFont配色都要一一调换,可以再PCH文件中写宏来定义

//
//  PrefixHeader.pch
//  TeddyBear
//
//  Created by 纵昂 on 2019/9/11.
//  Copyright © 2019年 纵昂. All rights reserved.
//

#ifndef PrefixHeader_pch
#define PrefixHeader_pch

//--------------------- 配色方案设定 --------------------------//
#define SDColor(a,b,c,d) [UIColor colorWithRed:a/255.0 green:b/255.0 blue:c/255.0 alpha:d]
// App icon color App 图标颜色 iconfont 图标
#define IconFont_Color   (SDColor(238, 130, 238, 1)) //   紫罗兰   238,130,238
#define IconFont_ColorOne   (SDColor(128, 128, 128, 1)) // 灰色 状态  128,128,128
#define IconFont_Transparent   (SDColor(0, 0, 0, 0)) //透明色

//The text color App中文字颜色
#define Text_Color   (SDColor(139, 0, 139, 1)) //   深洋红色 139,0,139  黑色  0,0,0
// Suggestive text color 提示性文字
#define Suggestive_Color   (SDColor(128, 128, 128, 1)) //灰色   128,128,128

#endif /* PrefixHeader_pch */
// 说明:
如果是IconFont图标的话,颜色红要标注好IconFont_Color
例如:好比五星好评:实芯和空心状态标注好即可,正常的log可以统一配色

接下来拿来使用

// An highlighted block
_ImageView.image = [UIImage iconWithInfo:TBCityIconInfoMake(@"\U0000e623", 30, IconFont_Color)]; // 

这个方法使用起来很方便!!

我创建的微信技术交流群–软件技术交流微信群

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值