陈斌彬的技术博客

Stay foolish,stay hungry

iOS中关于颜色常用的宏

// @{  
// @name 颜色相关  
//! 参数格式为:0xFFFFFF  
#define kColorWithRGB(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]  
//! 参数格式为:222,222,222  
#define kColorWithRGB(r, g, b) [UIColor colorWithRed:(r) / 255.f green:(g) / 255.f blue:(b) / 255.f alpha:1.f]  
// @end