Spot
app.activeDocument.spots[index]
Description
Section titled “Description”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.
Properties
Section titled “Properties”Spot.color
Section titled “Spot.color”app.activeDocument.spots[index].color
Description
Section titled “Description”The color information for this spot color.
Spot.colorType
Section titled “Spot.colorType”app.activeDocument.spots[index].colorType
Description
Section titled “Description”The color model for this custom color.
Spot.name
Section titled “Spot.name”app.activeDocument.spots[index].name
Description
Section titled “Description”The spot color’s name.
String
Spot.parent
Section titled “Spot.parent”app.activeDocument.spots[index].parent
Description
Section titled “Description”The document that contains this spot color.
Document; read-only.
Spot.spotKind
Section titled “Spot.spotKind”app.activeDocument.spots[index].spotKind
Description
Section titled “Description”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.
Spot.typename
Section titled “Spot.typename”app.activeDocument.spots[index].typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Methods
Section titled “Methods”Spot.getInternalColor()
Section titled “Spot.getInternalColor()”app.activeDocument.spots[index].getInternalColor()
Description
Section titled “Description”Gets the internal color of a spot.
Returns
Section titled “Returns”Color components.
Spot.remove()
Section titled “Spot.remove()”app.activeDocument.spots[index].remove()
Description
Section titled “Description”Deletes this object.
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Creating a new spot color
Section titled “Creating a new spot color”// Creates a new spot color in the current document, then applies an 80% tint to the colorif ( 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;}