Alpha 组件的颜色
你可以使用 init(red:_,green:_,blue:_,alpha:_) 初始化程序将不透明度设置为某个 UIColor 而不创建新的 UIColor。
迅速
let colorWithAlpha = UIColor.redColor().colorWithAlphaComponent(0.1)
Swift 3
//In Swift Latest Version
_ colorWithAlpha = UIColor.red.withAlphaComponent(0.1)
Objective-C
UIColor * colorWithAlpha = [[UIColor redColor] colorWithAlphaComponent:0.1];