IOS 16进制颜色转UIColor


//宏定义
#define HexColor(HexValue,alphaValue) [UIColor colorWithRed:((float)((HexValue & 0xFF0000) >> 16))/255.0 green:((float)((HexValue & 0xFF00) >> 8))/255.0 blue:((float)(HexValue & 0xFF))/255.0 alpha:alphaValue]

//使用,前面是十六进制值,后面是透明度(粉嫩色...)
self.view.backgroundColor = HexColor(0xFF335B,1.0f);



你可能感兴趣的:(IOS 16进制颜色转UIColor)