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 } }