iOS RGB色值宏定义设置

#define RGBA(r,g,b,a) [UIColor colorWithRed:r/ 255.0f green:g/ 255.0f blue:b/ 255.0f alpha:a]
#define RGB(r,g,b) RGBA(r,g,b, 1.0f )

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

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

你可能感兴趣的:(RGB的宏定义)