函數(shù)定義
+ (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的方式設(shè)置控件顏色,一直以為alpha值修改的是對(duì)象的透明度,今天測(cè)試才發(fā)現(xiàn) alpha 實(shí)際是修改的是顏色的透明度,The opacity value of the color object, specified as a value from 0.0 to 1.0. 在此做個(gè)標(biāo)記