Skip to content

GrayColor

new GrayColor()

A grayscale color specification, used where a Color object is required.


grayColor.gray

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

The class name of the referenced object.

String; read-only.


// 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;
}