Gradient

A gradient.

Methods:

duplicate, extractLabel, insertLabel, merge, remove

Objects:

GradientStops, GradientType, Number, Object, String

Hierarchy:

Superclass: Swatch

Class: Gradient

Property Listing

Property

Type

Access

Description

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.

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

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

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.

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.

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

Merge one or more other swatches into this one.

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)

Delete swatch.

Parameter

Type

Description

replacingWith

Swatch

The swatch to apply in place of this one

Object of

GradientStop.parent

Return

Gradients.add()

Gradient.duplicate()