1. RGB颜色 + A透明度
/** RGB颜色 + A透明度 */
#define HQRGBAColor(r, g, b, a) [UIColor colorWithRed:(r) / 255.0 green:(g) / 255.0 blue:(b) / 255.0 alpha:(a)]
2. RGB颜色
/** RGB颜色 */
#define HQRGBColor(r, g, b) HQRGBAColor(r, g, b, 1.0)
3. 随机色
/**
* 随机色
* 注意下面是(256),(0 ~ 255)一共256种颜色
* 如果写成(255)就失去了(r:255, g:255, b:255)这个最纯洁的白色
*/
#define HQRandomColor [UIColor colorWithRed:arc4random_uniform(256) / 255.0 green:arc4random_uniform(256) / 255.0 blue:arc4random_uniform(256) / 255.0 alpha:1.0]
网友评论