Gradient

A gradient.

Methods:

addEventListener, duplicate, extractLabel, getElements, insertLabel, merge, remove, removeEventListener, toSource, toSpecifier

Objects:

Boolean, ColorGroup, EventListeners, Events, GradientStops, GradientType, Number, Object, String

Hierarchy:

Superclass: Swatch

Class: Gradient

Property Listing

Property

Type

Access

Description

eventListeners

EventListeners EventListener

readonly

A collection of event listeners.

events

Events Event

readonly

A collection of events.

gradientStops

GradientStops GradientStop

readonly

A collection of gradient stops.

id

Number

readonly

The unique ID of the Gradient.

index

Number

readonly

The index of the Gradient within its containing object.

isValid

Boolean

readonly

Returns true if the object specifier resolves to valid objects.

label

String

read/write

A property that can be set to any string.

name

String

read/write

The name of the Gradient.

parent

Application

Document

readonly

The parent of the Gradient (a Application or Document).

parentColorGroup

ColorGroup

readonly

The color group that a swatch belongs to

properties

Object

read/write

A property that allows setting of several properties at the same time.

type

GradientType

GradientType.LINEAR

GradientType.RADIAL

read/write

The gradient type.

Method Listing

EventListener addEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Adds an event listener.

Parameter

Type

Description

eventType

String

The event type.

handler

File

JavaScriptFunction

The event handler. Can accept: File or JavaScript Function.

captures

Boolean

This parameter is obsolete. (Optional)

(default: false)

Gradient duplicate ()

Duplicates the Gradient.

String extractLabel (key:String)

Gets the label value associated with the specified key.

Parameter

Type

Description

key

String

The key.

Gradient getElements ()

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

undefined insertLabel (key:String, value:String)

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

Parameter

Type

Description

key

String

The key.

value

String

The value.

Swatch merge (with:Array of Varies Swatches Swatch String)

Merges the specified swatches with the swatch.

Parameter

Type

Description

with

Array of Swatches

Swatch

String

The swatches to merge. Can accept: Array of Swatches, Swatch or String.

undefined remove (replacingWith:Swatch)

Deletes the swatch.

Parameter

Type

Description

replacingWith

Swatch

The swatch to apply in place of the deleted swatch. (Optional)

Boolean removeEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Removes the event listener.

Parameter

Type

Description

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. (Optional)

(default: false)

String toSource ()

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

String toSpecifier ()

Retrieves the object specifier.

Object of

Event.parent

EventListener.parent

GradientStop.parent

MutationEvent.parent

Return

Gradients.add()

Gradient.duplicate()

Gradient.getElements()

Gradients.anyItem()

Gradients.everyItem()

Gradients.nextItem()

Gradients.previousItem()

Gradients.itemByID()

Gradients.item()

Gradients.[]()

Gradients.itemByName()

Gradients.itemByRange()

Gradients.firstItem()

Gradients.lastItem()

Gradients.middleItem()