title: How to select a random color in Swift
body: <p>I have this little bit of code in which it selects some colors, I would like to know what if I wanted to select a random color between these ones under the code, how could I do that ?</p>
  
  <pre><code>extension UIColor {
      static var random: UIColor {
          return UIColor(red: .random(in: 0...2), green: .random(in: 0...2), blue: .random(in: 0...2), alpha: 1.0)
      }
  }
  </code></pre>
  
  <p>Colors I would like to pick in my extension</p>
  
  <p><a href="https://i.stack.imgur.com/xUiP5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xUiP5.jpg" alt="enter image description here"></a></p>