美文网首页
[OC]十六进制颜色宏定义

[OC]十六进制颜色宏定义

作者: 鄒賢 | 来源:发表于2016-10-21 13:42 被阅读0次
    #define UIColorFromRGB(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]
    

    使用方法

    view.backgroundColor = UIColorFromRGB(0xFF0000);
    

    相关文章

      网友评论

          本文标题:[OC]十六进制颜色宏定义

          本文链接:https://www.haomeiwen.com/subject/kpxcuttx.html