Skip to content

Instantly share code, notes, and snippets.

@steipete
Created April 6, 2021 17:20
Show Gist options
  • Save steipete/579edd8bd8b25dc8a89b546b54d9222f to your computer and use it in GitHub Desktop.
Save steipete/579edd8bd8b25dc8a89b546b54d9222f to your computer and use it in GitHub Desktop.

Revisions

  1. steipete created this gist Apr 6, 2021.
    10 changes: 10 additions & 0 deletions RandomColor.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    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)
    )
    }
    }