-3

Is there any easy way to achive this?

I need this because i get the CMYK values from a file and i need to use those values in a xhtml file by creating tags like this:

<item style="background-color:rgb(211,199,142);"> some text </item> 
Filburt
  • 17,626
  • 12
  • 64
  • 115
Mihai Ilie
  • 34
  • 7

1 Answers1

2

Yes, using the CMYK to RGB formulae:

double red = 255*(1-cyan)*(1-black);
double green = 255*(1-magenta)*(1-black);
double blue = 255*(1-yellow)*(1-black);

Where CMYK values range from 0 to 1 and RGB values range from 0 to 255.

ostrichofevil
  • 749
  • 7
  • 19
  • 1
    i get a much brighter color – Mihai Ilie Jan 18 '16 at 20:14
  • 1
    That's because CMYK is meant for print, while RGB is meant for the web; CMYK colors are always less vivid onscreen than their RGB counterparts. However, if you print out the CMYK colors, they should look the same as the RGB do in a browser. – ostrichofevil Jan 18 '16 at 20:55