Created
August 12, 2015 14:38
-
-
Save skreutzberger/32be80e2ebef71dfb793 to your computer and use it in GitHub Desktop.
generate random color in Swift
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
// returns a random color | |
func randomColor() -> UIColor{ | |
let red = CGFloat(drand48()) | |
let green = CGFloat(drand48()) | |
let blue = CGFloat(drand48()) | |
return UIColor(red: red, green: green, blue: blue, alpha: 1.0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ddytert yeah it will be easy to use that using extension.