Adobe 23101335 - Photoshop - PC Manual page 78

Scripting guide
Hide thumbs Also See for 23101335 - Photoshop - PC:
Table of Contents

Advertisement

solidColor.CMYK.Black = 50
JS:
var solidColor = new SolidColor();
solidColor.cmyk.cyan = 20;
solidColor.cmyk.magenta = 90;
solidColor.cmyk.yellow = 50;
solidColor.cmyk.black = 50;
Hex values
An RGB color can also be represented as a hex value. The hexadecimal value is used to
represent the three colors of the RGB model. The hexadecimal value contains three pairs of
numbers which when read from left to right, represent the red, blue and green colors.
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 Visual Basic and JavaScript, the RGBColor object has a string property called
HexValue/hexValue .
3.14.2 Getting and converting colors
Here's how to get the foreground color in AppleScript.
get foreground color
This may return an RGB color and in some cases you may want the CMYK equivalent. To
convert an RGB color to CMYK in AppleScript you would write:
convert color foreground color to CMYK
VB/JS:
The foreground color returns a SolidColor object. You should use its model property to
determine the color model.
If (someColor.model = ColorModel.RGB) Then
End If
You can also ask the SolidColor object to convert its color to any of the supported models.
For example, writing:
someColor.cmyk
will return a CMYKColor object representing the CMYK version of the color in someColor
regardless of the color model of someColor.
Photoshop 7.0 Scripting Guide
alert("It's an RGB color")
Scripting Photoshop
Color objects
3
78

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop 7.0

Table of Contents