Last active
June 1, 2019 21:33
-
-
Save alexpersian/ebaa386f67101e74e4955d6aa2e97c10 to your computer and use it in GitHub Desktop.
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 generateRandomColor() -> UIColor { | |
let hue = CGFloat(arc4random() % 256) / 256 // use 256 to get full range from 0.0 to 1.0 | |
return UIColor(hue: hue, saturation: 1, brightness: 1, alpha: 1) // Max saturation, max brightness | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment