Created
March 13, 2019 12:34
-
-
Save yuraist/5d49abbf249bf2ebb2d3084339a48492 to your computer and use it in GitHub Desktop.
UIColor extension for simple rgb(red:green:blue) method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIColor { | |
static func rgb(red: CGFloat, green: CGFloat, blue: CGFloat) -> UIColor { | |
return UIColor(red: red/255, green: green/255, blue: blue/255, alpha: 1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example of use