Skip to content

Instantly share code, notes, and snippets.

@mr-fixit
Created November 3, 2016 14:11
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 mr-fixit/681145cfe4c13b5a95adee8de4160c56 to your computer and use it in GitHub Desktop.
Save mr-fixit/681145cfe4c13b5a95adee8de4160c56 to your computer and use it in GitHub Desktop.
func random1() -> CGFloat {
return CGFloat(arc4random()) / CGFloat(UINT32_MAX)
}
extension UIColor {
static func random() -> UIColor {
return UIColor.init(red: random1(), green: random1(), blue: random1(), alpha: 0.1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment