title: Trying to use CMYK values in swift
body: <p>I am trying to use 4 UISliders to change the values of the CMYK and then display the color in a view but I have tried with different formulas and still I don't get the right values, So I found this <a href="https://stackoverflow.com/questions/3315439/how-to-use-use-cmyk-color-codes-in-android">answer</a> in stack overflow but is for android (Java), but I don't get the code, this is what I have written:</p>
  
  <pre><code>let cyan = Float( 1 - (cyanSlider.value / 255))
  let magenta = Float(1 - (magentaSlider.value / 255))
  let yellow = Float(1 - (yellowSlider.value / 255))
  
  cyanValue.text = String(stringInterpolationSegment: cyan)
  magentaValue.text = String(stringInterpolationSegment: magenta)
  yellowValue.text = String(stringInterpolationSegment: yellow) 
  </code></pre>
  
  <p>And in the answer is: </p>
  
  <pre><code>int r,g,b,c,m,y,k;
  int computedC,computedM,computedY;
  int minCMY;
  
  if(r==0 &amp;&amp; g==0 &amp;&amp; b==0) return {0,0,0,1}
  
  computedC = 1 - (r/255);
  computedM = 1 - (g/255);
  computedY = 1 - (b/255);
  
  minCMY = Math.min(computedC,Math.min(computedM,computedY));
  
  computedC = (computedC - minCMY) / (1 - minCMY) ;
  computedM = (computedM - minCMY) / (1 - minCMY) ;
  computedY = (computedY - minCMY) / (1 - minCMY) ;
  
  return {computedC,computedM,computedY,minCMY};
  </code></pre>
  
  <p>I don't get this part of the code: </p>
  
  <pre><code> minCMY = Math.min(computedC,Math.min(computedM,computedY));
  </code></pre>
  
  <p>How would I write this on swift? or maybe objective -c and I will try to understand the objective-c code, but preferably swift please.</p>
  
  <p>Thanks, I am very new to swift :(</p>