Skip to main content
Inspiring
August 8, 2024
Answered

convert swatches color to CMYK

  • August 8, 2024
  • 1 reply
  • 324 views

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 has been closed for replies.
Correct answer rui huang

@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
August 9, 2024

@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