专色
app.activeDocument.spots[index]
包含在 SpotColor 对象中的自定义颜色定义。
如果在创建专色时未指定属性,则会提供默认值。
但是,如果指定颜色,则必须使用与文档相同的颜色空间,即 CMYK 或 RGB。否则会导致错误。
新的专色将添加到色板面板中的色板列表末尾。
Spot.color
Section titled “Spot.color”app.activeDocument.spots[index].color
此专色的颜色信息。
Spot.colorType
Section titled “Spot.colorType”app.activeDocument.spots[index].colorType
此自定义颜色的颜色模型。
Spot.name
Section titled “Spot.name”app.activeDocument.spots[index].name
专色的名称。
字符串
Spot.parent
Section titled “Spot.parent”app.activeDocument.spots[index].parent
包含此专色的文档。
Document; 只读。
Spot.spotKind
Section titled “Spot.spotKind”app.activeDocument.spots[index].spotKind
专色的类型(RGB、CMYK 或 LAB)。这是专色对象中包含的颜色类型的名称。
SpotColorKind; 只读。
Spot.typename
Section titled “Spot.typename”app.activeDocument.spots[index].typename
引用对象的类名。
字符串; 只读。
Spot.getInternalColor()
Section titled “Spot.getInternalColor()”app.activeDocument.spots[index].getInternalColor()
获取专色的内部颜色。
颜色分量。
Spot.remove()
Section titled “Spot.remove()”app.activeDocument.spots[index].remove()
删除此对象。
无。
创建新的专色
Section titled “创建新的专色”// 在当前文档中创建一个新的专色,然后将 80% 的色调应用于该颜色if ( app.documents.length > 0 ) { var doc = app.activeDocument;
// 创建新的专色 var newSpot = doc.spots.add();
// 定义新的颜色值 var newColor = new CMYKColor(); newColor.cyan = 35; newColor.magenta = 0; newColor.yellow = 50; newColor.black = 0;
// 定义一个新的 SpotColor,使用新专色的 80% 色调 // 该专色可以像其他颜色一样应用于艺术项目。 newSpot.name = "豌豆绿"; newSpot.colorType = ColorModel.SPOT; newSpot.color = newColor;
var newSpotColor = new SpotColor(); newSpotColor.spot = newSpot; newSpotColor.tint = 80;}