title: Strange Custom Background Color on UIPickerView Swift
body: <p>I'm getting strange colors when assigning a custom UIColor to the background of UIPickerViews. I have created a color for textViews and pickerViews as follows:</p>
  
  <pre><code>let myTextViewBackgroundColor = UIColor(red: 192.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 0.35)
  </code></pre>
  
  <p>And I assign it as:</p>
  
  <pre><code>myTextView.backgroundColor = myTextViewBackgroundColor
  keywordPicker.backgroundColor = myTextViewBackgroundColor
  </code></pre>
  
  <p>Here's what it looks like:
  <a href="https://i.stack.imgur.com/Sy3MJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sy3MJ.png" alt="enter image description here"></a>
  As you can see, the color of the textViews and the color of the picker are different. The difference seems more pronounced on a device than in this snapshot, but the custom color looks muddy, almost like it is mixed with a default gray background.</p>
  
  <p>If I comment out the pickerView color item above, I get a gray color background:
  <a href="https://i.stack.imgur.com/jFZ1O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jFZ1O.png" alt="enter image description here"></a>
  If I choose a standard UIColor, it appears to work correctly. UIColor.yellowColor in this instance. If I choose white, that looks good, too.
  <a href="https://i.stack.imgur.com/KcVbD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KcVbD.png" alt="enter image description here"></a>
  I create the pickerView in code and assign it to a textField which has no background color assigned.</p>
  
  <pre><code>var keywordPicker : UIPickerView?
  
  keywordPicker = UIPickerView()
  keywordPicker?.delegate = self
  keywordPicker?.dataSource = self
  
  keywordsForItemTextField.inputView = keywordPicker
  keywordPicker.backgroundColor = myTextViewBackgroundColor
  </code></pre>
  
  <p>And for what it's worth, I have a date picker that I created as a modal screen with it's own view controller. In that case, the picker is created on the storyboard. I still assign my background color with code and that picker shows the correct color.</p>