16进制转化为RGB的宏

来源:互联网 发布:照片十字绣软件 编辑:程序博客网 时间:2024/05/16 12:08


#define HEXCOLOR(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]