InDesign Server2025
API 20.5.0.49
Object

Gradient

A gradient.

Swatch Gradient
Hierarchy

Application | Document

Gradient

GradientStop

Properties

NameType AccessDescription
EventListeners<EventListener> readonly A collection of event listeners.
Events<Event> readonly A collection of events.
GradientStops<GradientStop> readonly A collection of gradient stops.
Number readonly The unique ID of the Gradient.
Number readonly The index of the Gradient within its containing object.
Boolean readonly Returns true if the object specifier resolves to valid objects.
String read/write A property that can be set to any string.
String read/write The name of the Gradient.
Application | Document readonly The parent of the Gradient (a Application or Document).
ColorGroup readonly The color group that a swatch belongs to
Object read/write A property that allows setting of several properties at the same time.
GradientType
read/write The gradient type.

Methods

EventListener

Adds an event listener.

eventType String The event type.
handler File | JavaScriptFunction The event handler. Can accept: File or JavaScript Function.
captures? Boolean This parameter is obsolete.
Gradient

Duplicates the Gradient.

String

Gets the label value associated with the specified key.

key String The key.
Gradient[]

Resolves the object specifier, creating an array of object references.

void

Sets the label to the value associated with the specified key.

key String The key.
value String The value.
Swatch

Merges the specified swatches with the swatch.

with Swatches[]<Swatch> | Swatch[] | String[] The swatches to merge. Can accept: Array of Swatches, Swatch or String.
void

Deletes the swatch.

replacingWith? Swatch The swatch to apply in place of the deleted swatch.
Boolean

Removes the event listener.

eventType String The registered event type.
handler File | JavaScriptFunction The registered event handler. Can accept: File or JavaScript Function.
captures? Boolean This parameter is obsolete.
String

Generates a string which, if executed, will return the Gradient.

String

Retrieves the object specifier.

Object of 4

Properties elsewhere that hold a Gradient.

Parameter of 3

Method parameters that accept a Gradient.

Return 15

Methods that return a Gradient.