Getting And Converting Colors - Adobe 23102480 - Photoshop CS3 - PC Programming Manual

Scripting guide
Table of Contents

Advertisement

Adobe Photoshop CS3 Scripting Guide
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.
Color Classes
RGB
Color
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
you use the
In VBScript and JavaScript, the

Getting and Converting Colors

The following examples convert an RGB color to its CMYK equivalent.
CMYK
Color
command described below to retrieve the hex value.
convert color
RGBColor
Photoshop CS3
Solid
Color
Gray
HSB
Color
Color
string property in class
hex value
object has a string property called
Scripting Photoshop CS3
No
Lab
Color
Color
RGB hex color
.
HexValue/hexValue
51
, and

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 23102480 - Photoshop CS3 - PC and is the answer not in the manual?

This manual is also suitable for:

13102498 - photoshop cs3 - macPhotoshop cs3

Table of Contents