※スポットカラー(特色)とは、印刷業界で用いられる用語で、CMYK(シアン、マゼンタ、イエロー、ブラック)の4色以外の特殊な色を指します
/**********************************************************
ADOBE SYSTEMS INCORPORATED
Copyright 2005-2010 Adobe Systems Incorporated
All Rights Reserved
NOTICE: Adobe permits you to use, modify, and
distribute this file in accordance with the terms
of the Adobe license agreement accompanying it.
If you have received this file from a source
other than Adobe, then your use, modification,
or distribution of it requires the prior
written permission of Adobe.
*********************************************************/
/**********************************************************
CreateSpotSwatch.jsx
DESCRIPTION
Create a new spot color swatch in the general swatch group
and apply a tint of the new spot swatch to a new path item.
一般スウォッチグループに新しいスポットカラースウォッチを作成し、
新しいパスアイテムに新しいスポットスウォッチの色合いを適用します。
**********************************************************/
var docRef = app.documents.add(DocumentColorSpace.CMYK);
var spotName = "CreateSpotSwatch";
// Create CMYKColor
var cmykColor = new CMYKColor();
cmykColor.cyan = 10;
cmykColor.magenta = 35;
cmykColor.yellow = 50;
cmykColor.black = 5;
// Create Spot
var spot = docRef.spots.add();
spot.color = cmykColor;
spot.colorType = ColorModel.SPOT;
spot.name = spotName;
// Create new SpotColor using Spot created above and apply a 50% tint
var spotColor = new SpotColor();
spotColor.tint = 50; // 50% tint
spotColor.spot = spot;
// Apply the tinted spot swatch to a new path item
var pathRef = docRef.pathItems.rectangle (400, 200, 200, 100, false);
pathRef.filled = true;
pathRef.fillColor = spotColor;
pathRef.stroked = true;