Created
November 18, 2018 18:54
-
-
Save devmjun/03842cf75629892da3dbc93459396157 to your computer and use it in GitHub Desktop.
Random Color
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 randomColor() -> UIColor { | |
return UIColor(red: CGFloat(arc4random()) / CGFloat(UInt32.max), | |
green: CGFloat(arc4random()) / CGFloat(UInt32.max), | |
blue: CGFloat(arc4random()) / CGFloat(UInt32.max), | |
alpha: 1.0) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment