Skip to main content
Inspiring
Aug 8, 2024 7:32 AM UTC
Answered

convert swatches color to CMYK

Hello , everyone.
I want to change the color of the text to CMYK with convert swatch color, but it fails.

when I manually convert it and GLOBAL option is checked, that's successful.

but below script did not make GLOBAL option checked.

Is it possible?

 

 


var newColor = new CMYKColor();
newColor.black = 100;
newColor.cyan = 0;
newColor.magenta = 0;
newColor.yellow = 0;

var ignoreColors = ['[None]', '[Registration]'];
var doc = activeDocument;
var swatches = doc.swatches;
for (var i = 0; i < swatches.length; i++) {
var shouldIgnore = false;
for (var j = 0; j < ignoreColors.length; j++) {
if (swatches[i].name === ignoreColors[j]) {
shouldIgnore = true;
break;
}
}
if (!shouldIgnore) {
alert(swatches[i].name);
swatches[i].color = newColor;
}
}

This topic is closed to new replies. Start a new post to keep the conversation going.
rui huangCorrect answer
Inspiring
Aug 9, 2024 3:13 AM UTC

@Charu Rajput , Thanks for sharing how to change fill and stroke color by directly replacing the color, solved my problem.


https://community.adobe.com/t5/illustrator-discussions/change-color-swatch-to-other-color-swatch/m-p/13487155

1 reply

rui huangAuthorCorrect answer
Inspiring
Aug 9, 2024 3:13 AM UTC

@Charu Rajput , Thanks for sharing how to change fill and stroke color by directly replacing the color, solved my problem.


https://community.adobe.com/t5/illustrator-discussions/change-color-swatch-to-other-color-swatch/m-p/13487155

Translate