函数UIColor的使用

函数定义

+ (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的使用)