A SERVICE OF

logo

Photoshop CS3
Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 51
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
solidColorRef.cmyk.magenta = 90
solidColorRef.cmyk.yellow = 50
solidColorRef.cmyk.black = 50
foregroundColor = solidColorRef
Solid Color Classes
The solid color classes available in Photoshop CS3 are illustrated below.
Using Hex Values for RGB Color
You can express RGB colors as hex (or hexadecimal) values. A hex value contains three pairs of numbers
which represent red, blue and green (in that order).
In AppleScript, the hex value is represented by the
hex value string property in class RGB hex color, and
you use the
convert color command described below to retrieve the hex value.
In VBScript and JavaScript, the
RGBColor object has a string property called HexValue/hexValue.
Getting and Converting Colors
The following examples convert an RGB color to its CMYK equivalent.
RGB
Color
CMYK
Color
Gray
Color
HSB
Color
Lab
Color
No
Color
Solid
Color
Color Classes