Skip to content

Instantly share code, notes, and snippets.

@devmjun
Created November 18, 2018 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devmjun/03842cf75629892da3dbc93459396157 to your computer and use it in GitHub Desktop.
Save devmjun/03842cf75629892da3dbc93459396157 to your computer and use it in GitHub Desktop.
Random Color
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