I draw a yellow square (C=0, M=0, Y=100, K=0) in an empty document, how to define only this color into the variable (cyan=false, magenta=false, yellow=true, black=false) ?
C# code, cmyk based color value 0 to 100, argb based color value 0 to 255
Shape s = corelApp.ActiveSelection; Color color = s.Fill.UniformColor; if (color.IsCMYK) { int c = color.CMYKCyan; int m = color.CMYKMagenta; int y = color.CMYKYellow; int k = color.CMYKBlack; System.Windows.MessageBox.Show(y.ToString()); }
Thanks for the answer, but I mean the definition of color separation in the whole document (As well as "File -> Print -> Color -> Print Separations"), let's say I have 5 yellow squares and 4 magenta squares in my document, how can I find what colors are used in the whole document and write finding color into the variables (cyan=false, magenta=true, yellow=true, black=false) without sorting of all shapes?
try use the class "PrintSeparationClass"
I use this code:
for (int i = 1; i <= Corel.ActiveDocument.PrintSettings.Separations.Plates.Count; i++){ bool plates = Corel.ActiveDocument.PrintSettings.Separations.Plates[i].Enabled; MessageBox.Show(Convert.ToString(plates));}
but all plates have a "true" status, regardless of what is drawn on the document.
Maybe there is still some way?
i test your code in API 17 and works fine, true to yellow and false for anothers.