Skip to content

Instantly share code, notes, and snippets.

@steipete
Created April 6, 2021 17:20
Show Gist options
  • Star 38 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steipete/579edd8bd8b25dc8a89b546b54d9222f to your computer and use it in GitHub Desktop.
Save steipete/579edd8bd8b25dc8a89b546b54d9222f to your computer and use it in GitHub Desktop.
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