Photoshop CS2
Adobe Photoshop CS2 Scripting Guide
Scripting Photoshop CS2 64
solidColorRef.cmyk.magenta = 90
solidColorRef.cmyk.yellow = 50
solidColorRef.cmyk.black = 50
foregroundColor = solidColorRef
Solid Color Classes
The solid color classes available in Photoshop CS2 are illustrated below.
Using Hex Values
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.
AS
The following script, which assumes an RGB color model, gets the foreground color and then uses the
convert
command of the
color
class to convert the color to its CMYK equivalent.
get foreground color
convert color foreground color to CMYK
Look up the following in the
Adobe Photoshop CS2 AppleScript Scripting Reference
:
●
In the “Objects” chapter, the
foreground color
property of the
Class application
●
In the “Commands” chapter,
convert
VBS
The following script uses an
If Then
statement and the
model
property of the
SolidColor
object to
determine the color model in use. The
If Then
statement returns a
SolidColor
object; if it returns an
RGB
object, the
cmyk
property of the
SolidColor
object then converts the color to its CMYK equivalent.
Dim someColor
If (someColor.model = 2) Then
RGB
Color
CMYK
Color
Gray
Color
HSB
Color
Lab
Color
No
Color
Solid
Color
Color Classes
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...