Copy link to clipboard
Copied
How do I convert a grayscale color item to CMYK, with k = 100% with overprint?
Thanks for helping!
Copy link to clipboard
Copied
If you can apply overprint in grayscale mode (k100). It would be helpful!
Copy link to clipboard
Copied
Convert and apply overprint sample:
if (app.selection[0].fillColor.gray===100) {
cmyk = new CMYKColor;
cmyk.cyan = 0;
cmyk.magenta = 0;
cmyk.yellow = 0;
cmyk.black = 100;
app.selection[0].fillColor = cmyk;
app.selection[0].fillOverprint = true;
}
More simple...
if (app.selection[0].fillColor.gray===100) app.selection[0].fillOverprint = true;
Copy link to clipboard
Copied
Thanks so much!
Copy link to clipboard
Copied
function grayToCMYK(color){
if(color.typename !== 'GrayColor') return false;
var CMYK = new CMYKColor(),
convertColor = app.convertSampleColor(ImageColorSpace.GrayScale, [color.gray], ImageColorSpace.CMYK, ColorConvertPurpose.defaultpurpose);
CMYK.cyan = convertColor[0];
CMYK.magenta = convertColor[1];
CMYK.yellow = convertColor[2];
CMYK.black = convertColor[3];
return CMYK;
}
selection[0].fillColor = grayToCMYK( selection[0].fillColor );
alert( 'Color type: ' + selection[0].fillColor.typename + '\nCyan: ' + selection[0].fillColor.cyan + '\nMagenta: ' + selection[0].fillColor.magenta +'\nYellow: ' + selection[0].fillColor.yellow + '\nBlack: ' + selection[0].fillColor.black );
Copy link to clipboard
Copied
More simple:
app.executeMenuCommand("Colors8");
Copy link to clipboard
Copied
Thanks!
Copy link to clipboard
Copied
I am guessing that it will never be this simple, the value could be a stroke or a fill and stroke at the same time, not just a fill only. Then there are tints of gray and not just solids…
Copy link to clipboard
Copied
Ten A's solution will convert all GrayColor objects that are selected to CMYKColor.
this work for fills and strokes.
GrayColor does not have Tint, nor does CMYK. Tint is the domain of Spot colours.
Copy link to clipboard
Copied
Thank you for the clarification Qwertyfly…
Perhaps this is a CS6 thing, however I have found that:
Post #2 from Ten A – “Convert and apply overprint sample” only converts solid 100% fills of grayscale to CMYK, lesser “tints” and or solid strokes are not converted. From the same post “More simple…” single line of code method does not change any value.
I have just tried Post #4 from Ten A – “More simple:” which does work on all selected fills or strokes!
Thanks Ten A and Qwertyfly!
Copy link to clipboard
Copied
I should have clarified,
I was referring to Ten A's "More Simple" post.