title: How to create a UIImage RGB gradient with a portion of black programmatically
body: <p>I'm wanting to generate a UIImage that's a RGB gradient that also has a portion of black on the left side. I would like to do this programmatically, instead of having to make the image in Photoshop and using it as an asset in the app.</p>
  
  <p>I've searched on here and have seen the generation of iOS color wheels before, but nothing like a rectangle below which I mocked in Photoshop:</p>
  
  <p>This will be for letting users change text color as they touch inside of the UIImage.</p>
  
  <p>I'm not really sure where to begin however, and would appreciate some pointers.</p>
  
  <p><img src="https://i.stack.imgur.com/bMs75.png" alt="color"></p>