您的位置:首页 > 编程语言

十六位颜色代码转换成RGB,进行宏定义

2016-12-29 11:22 120 查看
#define ColorRGB(rgbValue, alphaValue) [UIColor \

colorWithRed:((float)((rgbValue & 0xFF0000) >>
16))/255.0 \

green:((float)((rgbValue & 0x00FF00) >>
8))/255.0 \

blue:((float)(rgbValue & 0x0000FF))/255.0 \

alpha:alphaValue]

#define ColorFromRGB(rgbValue) ColorRGB(rgbValue, 1.0)

self.view.backgroundColor =
ColorFromRGB(0x2294ff);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息