Working With Color Objects - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
JS
//line #1--it's a straight line so the coordinates for anchor, left, and //right
//for each point have the same coordinates
var lineArray = new Array()
lineArray[0] = new PathPointInfo
lineArray[0].kind = PointKind.CORNERPOINT
lineArray[0].anchor = Array(100, 100)
lineArray[0].leftDirection = lineArray[0].anchor
lineArray[0].rightDirection = lineArray[0].anchor
lineArray[1] = new PathPointInfo
lineArray[1].kind = PointKind.CORNERPOINT
lineArray[1].anchor = Array(150, 200)
lineArray[1].leftDirection = lineArray[1].anchor
lineArray[1].rightDirection = lineArray[1].anchor
var lineSubPathArray = new Array()
lineSubPathArray[0] = new SubPathInfo()
lineSubPathArray[0].operation = ShapeOperation.SHAPEXOR
lineSubPathArray[0].closed = false
lineSubPathArray[0].entireSubPath = lineArray

Working with Color Objects

Your scripts can use the same range of colors that are available from the Photoshop CS2 user interface.
Each color model has its own set of properties. For example, the
properties: red, blue and green. To set a color in this class, you indicate values for each of the three
properties.
In VBScript and JavaScript, the
object, you first create an instance of a
the object. Once a color model has been assigned to a
be reassigned to a different color model.
The following examples demonstrate how to set a color using the
AS
set foreground color to {class:CMYK color, cyan:20.0, ¬
magenta:90.0, yellow:50.0, black:50.0}
VBS
'create a solidColor array
Dim solidColorRef
Set solidColorRef = CreateObject("Photoshop.SolidColor")
solidColorRef. CMYK.Cyan = 20
solidColorRef.CMYK.Magenta = 90
solidColorRef.CMYK.Yellow = 50
solidColorRef.CMYK.Black = 50
appRef.ForegroundColor = solidColorRef
JS
//create a solid color array
var solidColorRef = new SolidColor()
solidColorRef.cmyk.cyan = 20
Photoshop CS2
class contains a property for each color model. To use this
SolidColor
object, then set appropriate color model properties for
SolidColor
class contains three
RGB color
object, the
SolidColor
CMYK color
Scripting Photoshop CS2
object cannot
SolidColor
class.
63

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents