Skip to main content
Inspiring
Nov 23, 2024 9:20 AM UTC
Question

GrayColor

What's the weird logic in ExtendScript's GrayColor definition? 
JavaScript Object Reference grayColor.gray description: “The tint of the gray. Range: 0.0 to 100.0, where 0.0 is black and 100.0 is white.”
We know that in Illustrator grayscale 0 is white and vice versa. 

If you want to create white fill: 

 

point.fillColor = new GrayColor();
point.fillColor.gray = 0;

 

 

 

 

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

CarlosCanto
Community Expert
Community Expert
Nov 23, 2024 6:48 PM UTC

it's an error, 0 should read "White" as you pointed out

Translate
m1b
Community Expert
Community Expert
Nov 23, 2024 9:45 AM UTC

Hi @andyf65867865, where does it say that? It is definitely wrong, as you noticed. Color.gray: 100 is black.

Translate
Inspiring
Nov 23, 2024 9:49 AM UTC

Hi @m1b 
ADOBE ILLUSTRATOR SCRIPTING REFERENCE: JAVASCRIPT

also you could find it in the Illustrator Scripting Guide Release 0.0.1

Translate