I am trying to find a way to go from some proportion of cyan, magenta and yellow where:

cyan: 33 % + magenta : 33% + yellow : 33% = 100% black

so each is represented as a percentage of the sum total. mixing 50% magenta and 50 % yellow should result in red. Mixing some colour with its complement would in effect mix some proportion of all three primaries and result in some amount of black and pulling it further towards one of the primaries, so mixing red and blue would mix cmy in some proportion which would result in some amount of black and a balance of the other two primaries so it would just change chroma.

Any help is appreciated. I know that the gamuts of devices and colour models vary so it doesn't need to be perfect, it just needs to be intuitive for someone familiar with the cmy colour wheel to be able to use.

The desired output is an rgb colour code or a cmyk that could then be converted to rgb.

There is no white so you're limited to the hues and shades that can be formed from the three primaries. I'm okay with that.

Hey guys, I'm still trying to find a solution to this. If anyone could help it would be great.

This is for a game, the input is derived from some time value that represents a proportion of primary paints. Sort of.

I realize that in cmyk k stands for key and is a black dye that is purer than the black that can be obtained from mixing the primaries. In my game cmyk is unimportant, only that I can mix three primary colours cyan, magenta and yellow to mix the colour wheel.

It is unlikely that black will even be required, but the chroma effect of mixing some proportion of all three primaries together is required as I would want more than just the hues. I appreciate that lightness of the hues is not possible without white but that is also fine.

I want it so that given some floating point value for representing some proportion of each primary, I can calculate that as percentages and then resolve that to an rgb colour code. It need not be a perfect conversion as only the rgb colour will be displayed, the cmy will just be for the calculation. A close approximation will suffice.

I don't need an especially wide gamut. I just need to be able to mix some proportion of the paints to mix a colour palette. If the player mixes equal parts of each primary then it would be black, if they keep mixing in magenta then it will become more and more magenta again as the volume of magenta dwarfs the volume of black.

If you mix red and blue you're mixing magenta and yellow with magenta and cyan.

I hope that clarifies some of the questions. The goal is to take the intuitive representation expressed to the player, three primary colours, and resolve that to a colour code that can be used to actually render to the screen.

The player will be able to clear the colour so they can then return to a pure primary colour. But to mix any particular colour they will do so by mixing the primary colours. Hue, chroma and brightness should be possible though lightness isn't possible without white as this is subtractive.

  • 3
    $\begingroup$ What output are you looking for? You say you're going from some proportions of subtractive primaries, but what colour space are you trying to convert it to? And if the proportions have to add to 100%, how do you express the lightness of the colour? $\endgroup$
    – Dan Hulme
    Jun 3, 2017 at 10:44
  • $\begingroup$ It can not work. Because that would mean tye primaries are not pure. Although mathematically you could have some fudge factor but no ink can actually work like this. $\endgroup$
    – joojaa
    Jun 5, 2017 at 15:14
  • $\begingroup$ What do you mean it can't work? If you take magenta paint, cyan paint and yellow paint, you can mix the colour wheel. This is exactly what I'm talking about, you take some proportion of primary colours and mix them together. one part yellow to 1 part magenta and you get red and so on $\endgroup$ Jun 5, 2017 at 15:40
  • $\begingroup$ It wont work because to make red you need 100% cyan + 100% yellow. Otherwise you get a red otherwise your formula no longer adds up on any other concentrations. As that would mean you would need a darker mixture for red than from black. So best not think percentages but parts of color mixture. $\endgroup$
    – joojaa
    Jun 5, 2017 at 17:18
  • $\begingroup$ That would be true if it was represented in cmyk, but I'm not in the colour model cmyk, I need to take some ratio of primary paints and return some rgb colour code. The cmyk colour model as an intermediary seems unwise given that it is 0-100% for each component c m y and k and goes from white to pure , and i have no white. What I want is a colour wheel that covers hues and chroma. If you want red you mix an equal proportion of magenta and yellow to get secondary colour red. if you mix blue and red you're mixing all 3 cmy in some proportion, that's the definition of a primary. $\endgroup$ Jun 5, 2017 at 17:22

1 Answer 1


First off, the CMYK model includes black as its own channel, so you typically don't mix a combo of cyan, magenta & yellow to get black, you add black directly as its own independent element. There are a number of reasons for using black directly & without knowing your context, it's difficult to advise you on how to get by without it. What kind of black should I use when designing for CMYK print? on the graphic design SE has some in depth answers regarding use of black by itself & as a mixture (sometimes called composite black).

Second, CMYK is a subtractive model for mixing inks based on the notion of reducing brightness. RGB is an additive model based on mixing lights. Because they use different models & are both context dependent, there isn't a generalized conversion formula. The RGB to CMYK and back algorithm question on SO has a number of in depth answers regarding possible conversion algorithms. Again, it's hard to know what to suggest when you haven't clarified what you're using the colors for.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.