美文网首页
函数UIColor的使用

函数UIColor的使用

作者: zjunchao | 来源:发表于2016-01-08 11:11 被阅读18次

    函数定义

    + (UIColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha
    

    Description

    Creates and returns a color object using the specified opacity and RGB component values.
    The color object. The color information represented by this object is in the device RGB colorspace.
    Parameters
    red
    The red component of the color object, specified as a value from 0.0 to 1.0.
    green
    The green component of the color object, specified as a value from 0.0 to 1.0.
    blue
    The blue component of the color object, specified as a value from 0.0 to 1.0.
    alpha
    The opacity value of the color object, specified as a value from 0.0 to 1.0.

    使用疑惑

    通过RGB的方式设置控件颜色,一直以为alpha值修改的是对象的透明度,今天测试才发现 alpha 实际是修改的是颜色的透明度,The opacity value of the color object, specified as a value from 0.0 to 1.0. 在此做个标记

    相关文章

      网友评论

          本文标题:函数UIColor的使用

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