title: iOS CGColor versus UIColor
body: <p>I am using 2 variations of the same color, a light and dark version, to create a gradient.</p>
  
  <p>Code:</p>
  
  <pre><code>CAGradientLayer *gradient = [CAGradientLayer layer];
  
  UIColor *light = [baseColor lightVersion];
  
  UIColor *dark = [baseColor darkVersion];
  
  gradient.colors = [NSArray arrayWithObjects:(id)[light CGColor], (id)[dark CGColor], nil];
  </code></pre>
  
  <p>The problem is, I noticed that the <code>CGColor</code> version of the original <code>UIColor</code> version is different. Why is that? What is the difference between the <code>UIColor</code> and <code>CGColor</code> and why are they different?</p>