GradientColor
GradientColor
Section titled “GradientColor”gradientColor
Description
Section titled “Description”A gradient color specification in a Gradient object. A script can create a new gradient color using a reference to an existing gradient in the document. If no existing gradient object is referenced, a default gradient is supplied.
Properties
Section titled “Properties”GradientColor.angle
Section titled “GradientColor.angle”gradientColor.angle
Description
Section titled “Description”The gradient vector angle in degrees.
Default: 0.0.
Setting the angle does not work. Apparently this is a bug since 2008 that still exists in (at least) 29.3.1.
Number (double).
GradientColor.gradient
Section titled “GradientColor.gradient”gradientColor.gradient
Description
Section titled “Description”Reference to the object defining the gradient.
GradientColor.hiliteAngle
Section titled “GradientColor.hiliteAngle”gradientColor.hiliteAngle
Description
Section titled “Description”The gradient highlight vector angle in degrees.
Number (double).
GradientColor.hiliteLength
Section titled “GradientColor.hiliteLength”gradientColor.hiliteLength
Description
Section titled “Description”The gradient highlight vector length.
Number (double).
GradientColor.length
Section titled “GradientColor.length”gradientColor.length
Description
Section titled “Description”The gradient vector length.
Number (double).
GradientColor.matrix
Section titled “GradientColor.matrix”gradientColor.matrix
Description
Section titled “Description”An additional transformation matrix to manipulate the gradient path.
Matrix.
GradientColor.origin
Section titled “GradientColor.origin”gradientColor.origin
Description
Section titled “Description”The gradient vector origin, the center point of the gradient in this color.
Array of 2 numbers.
GradientColor.typename
Section titled “GradientColor.typename”gradientColor.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Example
Section titled “Example”Changing a gradient stop color
Section titled “Changing a gradient stop color”// Creates a new RGB document, then changes the color of the first gradient stop of an indexed gradientapp.documents.add(DocumentColorSpace.RGB);
// Get a reference to the gradient that you want to changevar gradientRef = app.activeDocument.gradients[1];
// Create the new colorvar startColor = new RGBColor();startColor.red = 255;startColor.green = 238;startColor.blue = 98;
// apply new color to the first gradient stopgradientRef.gradientStops[0].color = startColor;