Color with Alpha component
suggest changeYou can set the opacity to a certain UIColor
without creating a new one using the init(red:_,green:_,blue:_,alpha:_)
initializer.
Swift
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];
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents