CMYKColor
CMYKColor
Section titled “CMYKColor”new cmykColor()
Description
Section titled “Description”A CMYK color specification, used where a Color object is required.
If the color space of a document is RGB
and you specify the color value for a page item in that document using CMYK, Illustrator will translate the CMYK color specification into an RGB color specification. The same thing happens if the document’s color space is CMYK and you specify colors using RGB.
Since this translation can lose information, you should specify colors using the class that matches the document’s actual color space.
Properties
Section titled “Properties”CMYKColor.black
Section titled “CMYKColor.black”cmykColor.black
Description
Section titled “Description”The black color value. Range 0.0-100.0.
Default: 0.0
Number (double)
CMYKColor.cyan
Section titled “CMYKColor.cyan”cmykColor.cyan
Description
Section titled “Description”The cyan color value. Range 0.0-100.0.
Default: 0.0
Number (double)
CMYKColor.magenta
Section titled “CMYKColor.magenta”cmykColor.magenta
Description
Section titled “Description”The magenta color value. Range 0.0-100.0.
Default: 0.0
Number (double)
CMYKColor.typename
Section titled “CMYKColor.typename”cmykColor.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
CMYKColor.yellow
Section titled “CMYKColor.yellow”cmykColor.yellow
Description
Section titled “Description”The yellow color value. Range 0.0-100.0.
Default: 0.0
Number (double)
Example
Section titled “Example”Setting a CMYK color
Section titled “Setting a CMYK color”// Sets the fill color of the frontmost path item in// the current document to a light purple CMYK color
if (app.documents.length > 0 && app.activeDocument.pathItems.length > 0) { var frontPath = app.activeDocument.pathItems[0];
// Set color values for the CMYK object var newCMYKColor = new cmykColor(); newCMYKColor.black = 0; newCMYKColor.cyan = 30.4; newCMYKColor.magenta = 32; newCMYKColor.yellow = 0;
// Use the color object in the path item frontPath.filled = true; frontPath.fillColor = newCMYKColor;}