16进制转UIColor

作者: 蜗蜗牛在奔跑 | 来源:发表于2016-08-26 17:22 被阅读26次

    #define UIColorFromRGBA(rgbValue, alphaValue) \

    [UIColor \

    colorWithRed:((float)((rgbValue &0xFF0000) >>16))/255.0\

    green:((float)((rgbValue &0x00FF00) >>8))/255.0\

    blue:((float)(rgbValue &0x0000FF))/255.0\

    alpha:alphaValue]

    2.随时随地使用

    UICorlor *color =UIColorFromRGBA(0xFF0000,.75);

    相关文章

      网友评论

        本文标题:16进制转UIColor

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