InDesign Server2025
API 20.5.0.49
Collection of Color

Colors

A collection of colors.

Properties

NameType AccessDescription
Number readonly The number of objects in the collection.

Methods

Color

Returns the Color with the specified index.

index Number The index.
Color

Creates a new Color.

withProperties? Object Initial values for properties of the new Color
Color

Returns any Color in the collection.

Number

Displays the number of elements in the Color.

Color[]

Returns every Color in the collection.

Color

Returns the first Color in the collection.

Color

Returns the Color with the specified index or name.

index LongInteger | String The index or name. Can accept: Long Integer or String.
Color

Returns the Color with the specified ID.

id Number The ID.
Color

Returns the Color with the specified name.

name String The name.
Color[]

Returns the Colors within the specified range.

from Color | LongInteger | String The Color, index, or name at the beginning of the range. Can accept: Color, Long Integer or String.
to Color | LongInteger | String The Color, index, or name at the end of the range. Can accept: Color, Long Integer or String.
Color

Returns the last Color in the collection.

Color

Returns the middle Color in the collection.

Color

Returns the Color whose index follows the specified Color in the collection.

obj Color The Color whose index comes before the desired Color.
Color

Returns the Color with the index previous to the specified index.

obj Color The index of the Color that follows the desired Color.
String

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

Object of 2

Properties elsewhere that hold a Colors.