Skip to content

Instantly share code, notes, and snippets.

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

This comment has been minimized.

Copy link
Owner Author

@steipete 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