Skip to content

Instantly share code, notes, and snippets.

@steipete
Created April 6, 2021 17:20
  • Star 36 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Random Color for SwiftUI
extension Color {
/// Return a random color
static var random: Color {
return Color(
red: .random(in: 0...1),
green: .random(in: 0...1),
blue: .random(in: 0...1)
)
}
}
@steipete
Copy link
Author

steipete commented Apr 6, 2021

MIT or Public Domain licensed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment