Skip to content

Spot

app.activeDocument.spots[index]

A custom color definition contained in a SpotColor object.

If no properties are specified when creating a spot, default values are provided.

However, if specifying the color, you must use the same color space as the document, either CMYK or RGB. Otherwise, an error results.

The new spot is added to the end of the swatches list in the Swatches palette.


app.activeDocument.spots[index].color

The color information for this spot color.

Color


app.activeDocument.spots[index].colorType

The color model for this custom color.

ColorModel


app.activeDocument.spots[index].name

The spot color’s name.

String


app.activeDocument.spots[index].parent

The document that contains this spot color.

Document; read-only.


app.activeDocument.spots[index].spotKind

The kind of spot color (RGB, CMYK or LAB). This is the name of the color kind contained in the spot object.

SpotColorKind; read-only.


app.activeDocument.spots[index].typename

The class name of the referenced object.

String; read-only.


app.activeDocument.spots[index].getInternalColor()

Gets the internal color of a spot.

Color components.


app.activeDocument.spots[index].remove()

Deletes this object.

Nothing.


// Creates a new spot color in the current document, then applies an 80% tint to the color
if ( app.documents.length > 0 ) {
var doc = app.activeDocument;
// Create the new spot
var newSpot = doc.spots.add();
// Define the new color value
var newColor = new CMYKColor();
newColor.cyan = 35;
newColor.magenta = 0;
newColor.yellow = 50;
newColor.black = 0;
// Define a new SpotColor with an 80% tint
// of the new Spot's color. The spot color can then
// be applied to an art item like any other color.
newSpot.name = "Pea-Green";
newSpot.colorType = ColorModel.SPOT;
newSpot.color = newColor;
var newSpotColor = new SpotColor();
newSpotColor.spot = newSpot;
newSpotColor.tint = 80;
}