Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 870959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:33:53+00:00 2026-05-15T10:33:53+00:00

I have RGB values that I need to convert into CMYK values. I’m using

  • 0

I have RGB values that I need to convert into CMYK values. I’m using the iPhone SDK to try and do this.

I have tried a couple of things, but cannot either get the values to be anything other than 0 or 1, or the K element is completely wrong (showing up as a negative number).

Any help would be a life saver!

Sorry, code:

float k = MIN(1-red,MIN(1-green,1-blue));
float c = (1-red-k)/(1-k);
float m = (1-green-k)/(1-k);
float y = (1-blue-k)/(1-k);

NSLog(@"%d %d %d %d",c,m,y,k);

With the following values for red, green and blue:

93, 37 and 27 I get the following values back:

0 0 1073741824 1071858897

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:33:54+00:00Added an answer on May 15, 2026 at 10:33 am

    Your formula expects values in the range of 0 to 1, but you’re feeding it the more common range of 0 to 255.

    float k = MIN(255-red,MIN(255-green,255-blue));
    float c = 255*(255-red-k)/(255-k); 
    float m = 255*(255-green-k)/(255-k); 
    float y = 255*(255-blue-k)/(255-k); 
    

    You’ll also need a special case when k==255, otherwise you’ll get a divide by zero.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array of RGB values, whose size I can guarantee to match
Have you managed to get Aptana Studio debugging to work? I tried following this,
Based on this original idea, that many of you have probably seen before: http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/
So I have a color picker. Users can pick colors using RGB or HSB.
Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have a color and I want get a tint of that color by
I have some colors that seem to come from a Delphi TColor variable (e.g
If I have a PDF file with objects (text, line-art) in a specific RGB
How can I convert an RGB integer to the corresponding RGB tuple (R,G,B) ?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.