阅读254 返回首页    go 阿里云 go 技术社区[云栖]


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

最后更新:2017-04-03 12:56:32

  上一篇:go cocos2d-x读取xml(适用于cocos2d-x 2.0以上版本)
  下一篇:go #pragma用法