GrayColor
GrayColor
Section titled “GrayColor”new GrayColor()
Description
Section titled “Description”A grayscale color specification, used where a Color object is required.
Properties
Section titled “Properties”GrayColor.gray
Section titled “GrayColor.gray”grayColor.gray
Description
Section titled “Description”The tint of the gray.
Range: 0.0 to 100.0, where 0.0 is black and 100.0 is white.
Number (double).
GrayColor.typename
Section titled “GrayColor.typename”grayColor.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Example
Section titled “Example”Changing a color to gray
Section titled “Changing a color to gray”// Sets the color of the first word in the active document to a shade of gray
if (app.documents.length > 0 && app.activeDocument.textFrames.length > 0) { var text = app.activeDocument.textFrames[0].textRange; var firstWord = text.words[0];
// Create the new color var textColor = new GrayColor(); textColor.gray = 45;
firstWord.filled = true; firstWord.fillColor = textColor;}