Skip to content

Instantly share code, notes, and snippets.

@SwiftSIQI
Created September 19, 2022 07:20
Show Gist options
  • Select an option

  • Save SwiftSIQI/4a6c00dcb035a3539d98fa4e03f9e4af to your computer and use it in GitHub Desktop.

Select an option

Save SwiftSIQI/4a6c00dcb035a3539d98fa4e03f9e4af to your computer and use it in GitHub Desktop.
class func randomColor() -> UIColor {
let red = CGFloat(arc4random_uniform(255))/CGFloat(255.0)
let green = CGFloat( arc4random_uniform(255))/CGFloat(255.0)
let blue = CGFloat(arc4random_uniform(255))/CGFloat(255.0)
return UIColor(red: red, green: green, blue: blue, alpha: 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment