Color

A color swatch.

Methods:

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

Objects:

Boolean, ColorGroup, ColorModel, ColorSpace, EventListeners, Events, Number, Object, String

Hierarchy:

Superclass: Swatch

Class: Color

Subclasses: Tint

Property Listing

Property

Type

Access

Description

colorValue

Array of Number (range 0 - 100)

read/write

The ink values that create the color, specified as a percentage for each ink. Note: The number of values required and the range depends on the color space. For RGB, specify three values, with each value in the range 0 to 255; for CMYK, specify four values representing C, M, Y, and K, with each value in the range 0 to 100; for LAB, specify three values representing L (Range: 0 to 100), A (Range: -128 to 127), and B (Range: -128 to 127); for mixed ink, specify values for each ink in the ink list, with each value in the range 0 to 100.

eventListeners

EventListeners EventListener

readonly

A collection of event listeners.

events

Events Event

readonly

A collection of events.

id

Number

readonly

The unique ID of the Color.

index

Number

readonly

The index of the Color 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.

model

ColorModel

ColorModel.MIXEDINKMODEL

ColorModel.PROCESS

ColorModel.REGISTRATION

ColorModel.SPOT

read/write

The color model.

name

String

read/write

The name of the Color.

parent

Application

Document

readonly

The parent of the Color (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.

space

ColorSpace

ColorSpace.CMYK

ColorSpace.HSB

ColorSpace.LAB

ColorSpace.MIXEDINK

ColorSpace.RGB

read/write

The color space.

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)

Color duplicate ()

Duplicates the Color.

String extractLabel (key:String)

Gets the label value associated with the specified key.

Parameter

Type

Description

key

String

The key.

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

String toSpecifier ()

Retrieves the object specifier.

Object of

Tint.baseColor

Event.parent

EventListener.parent

MutationEvent.parent

GradientStop.stopColor

Return

Colors.add()

Color.duplicate()

Application.importAdobeSwatchbookProcessColor()

Document.importAdobeSwatchbookProcessColor()

Application.importAdobeSwatchbookSpotColor()

Document.importAdobeSwatchbookSpotColor()

Color.getElements()

Colors.anyItem()

Colors.everyItem()

Colors.nextItem()

Colors.previousItem()

Colors.itemByID()

Colors.item()

Colors.[]()

Colors.itemByName()

Colors.itemByRange()

Colors.firstItem()

Colors.lastItem()

Colors.middleItem()