宏定义如下:
#define HexColor(s) [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0green:(((s &0xFF00) >>8))/255.0blue:((s &0xFF))/255.0alpha:1.0]
使用:
view.backgroundColor = HexColor(0xFFFFFF);
宏定义如下:
#define HexColor(s) [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0green:(((s &0xFF00) >>8))/255.0blue:((s &0xFF))/255.0alpha:1.0]
使用:
view.backgroundColor = HexColor(0xFFFFFF);
本文标题:iOS UIColor 16进制转换
本文链接:https://www.haomeiwen.com/subject/outsxxtx.html
网友评论