title: UIColor CMYK and Lab Values
body: <p>Simple question, more than likely complex answer:</p>
  
  <p>How can I get CMYK and Lab values from a UIColor object (of which I know the RGB values if it helps)?</p>
  
  <p>I have found this regarding getting CMYK values but I can't get any accurate values out of it, despite it being everywhere, I've heard it's not a great snippet.</p>
  
  <pre><code>CGFloat rgbComponents[4];
      [color getRed:&amp;rgbComponents[0] green:&amp;rgbComponents[1] blue:&amp;rgbComponents[2] alpha:&amp;rgbComponents[3]];
  
      CGFloat k = MIN(1-rgbComponents[0], MIN(1-rgbComponents[1], 1-rgbComponents[2]));
      CGFloat c = (1-rgbComponents[0]-k)/(1-k);
      CGFloat m = (1-rgbComponents[1]-k)/(1-k);
      CGFloat y = (1-rgbComponents[2]-k)/(1-k);
  </code></pre>