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

来源:互联网 发布:超级课程表软件 编辑:程序博客网 时间:2024/06/17 04:51

#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);


0 0