I'm about to converting RGB color to CMYK for printing purpose.
scale of this conversion is Adobe Photoshop ( Image -> Mode -> CMYK color )
I tried 2 solution , but none of them return the right value :
Solution 1 - Using .NET Framework
At first , I followed by these steps
Download ICC profiles (windows version) from Adobe
Convert the
#colorto CMYKused
System.Windows.Media.Color.FromValues // return ColorMSDNstring convretedColor = string.Format("#{0:X2}{1:X2}{2:X2}", _color.R, _color.G, _color.B)
here is the result :
profile :
CoatedFOGRA27.iccOriginal Color :
#2f00ffConverted Color :
#3b4996Result of conversion With Adobe Photoshop (same profile) :
#3b4996not even close!
Solution 2 - Using Windows Color System ( WCS )
I also tried the Codo's solution with same procedure
here is the result :
Profile :
CoatedFOGRA27.iccOriginal Color :
#2f00ffConverted Color :
#2032FFPhotoshop :
#3b4996
EDIT
According to Codo's Comments, I think, I have some fundamental problems of understanding colors concept !! ( please correct me if I'm wrong )
For any color, we have different color models , RGB , CMYK, ...
RGB shows the combination of (Red Green Blue) to generate color and CMYK as well (Cyan Magenta Yellow * ). the values of these models can easily convert to each-other.
RGB HEX :
#2F00FFRGB :
47 - 0 - 255CMYK :
0,816 - 1,000 - 0,000 - 0,000
Almost, all monitors use RGB to shows the colors.the printed color (because of using Ink instead of LED o ...) is totally different from the color that you see on monitor/
For this issue, Image Editors like Photoshop use CMYK **MODE**.In this mode , if you select the RGB color, the editor convert it to color that you see after printing and shows that to screen.this conversion is absolutely depend on color Profiles ( here ICC )
EDIT 2

As I see the theory…
The gamut of CMYK by itself is slightly smaller than RGB, so the difference after straight RGB->CMYK conversion will be easy visible. In order to compensate that diff Color Profiles are used. Color Profile inside is actually a set of color transforms which allows to enlarge the gamut. In this case image source is just a source for these transforms.
CMYK is almost always used with Color Profiles (I mean correct use cases) otherwise color loss will be significant.
In Photoshop try to convert here: Edit -> Convert to Profile. The main difference from your way - you can choose destination CMYK profile and color managment engine including Microsoft ICM, which could give you different results.
Here is a good article about CMYK: http://www.northlight-images.co.uk/article_pages/colour_management/cmyk_for_photographers.html
As for programming...
Maybe it will be easier to use some specialized image processing SDK. Color Management is a basic feature of any of them and should be available even for free.
If you need to estimate how your RGB color will be actually printed you need to use feature called “soft proofing”. This is RGB -> CMYK (with printer profile) -> RGB conversion. In Photoshop you can check it here: View -> Proof Color. You can do the same thing with SDKs.