Skip to content

Instantly share code, notes, and snippets.

@robertmryan
Last active May 24, 2020 04:55
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 robertmryan/865f9c0b3068d8e6c8a2f99a1955ac75 to your computer and use it in GitHub Desktop.
Save robertmryan/865f9c0b3068d8e6c8a2f99a1955ac75 to your computer and use it in GitHub Desktop.
func generateRandomColors() -> [UIColor] {
var randomColors: [UIColor] = Array(repeating: .blue, count: .random(in: 0...10))
randomColors += Array(repeating: .red, count: .random(in: 0...15))
randomColors += Array(repeating: .yellow, count: .random(in: 0...25))
randomColors += Array(repeating: .orange, count: 100 - randomColors.count)
return randomColors.shuffled()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment