Comparing Colors; Getting A Web-Safe Color; Working With Filters - Adobe 65014912 Manual

Photoshop cs4 extended
Table of Contents

Advertisement

C
3: Scripting Photoshop
HAPTER
Look up the following in the Adobe Photoshop CS4 Visual Basic Scripting Reference, or in the Visual Basic
Object Browser:
model
JS
This example uses the
be converted. The
way to access the cmyk equivalent of the rgb color.
var someColor = foregroundColor.cmyk
Look up the following in the Adobe Photoshop CS4 JavaScript Scripting Reference, or in the ExtendScript
Object Model Viewer:
cmyk
foregroundColor

Comparing colors

Using the
statements return
AS:
VBS:
JS:

Getting a Web-safe color

To convert a color to a web safe color use the
NearestWebColor/nearestWebColor
AS
set myWebSafeColor to web safe color for foreground color
VBS
Dim myWebSafeColor
Set myWebSafeColor = appRef.ForegroundColor.NearestWebColor
JS
var webSafeColor = new RGBColor()
webSafeColor = app.foregroundColor.nearestWebColor

Working with Filters

To apply a filter in AppleScript, you use the
options
filter, you use the
ArtLayer
N
: Please refer to Photoshop Help for information about the effects produced by individual filter types.
OTE
The following examples apply the Gaussian blur filter to the active layer.
and
as properties of the
cmyk
foregroundColor
property of the
cmyk
as a property of the
SolidColor
as a property of the
equal colors (IsEqual/isEqual)
if the foreground color is visually equal to background color.
true
if equal colors foreground color with background color then
If (appRef.ForegroundColor.IsEqual(appRef.BackgroundColor)) Then
if (app.foregroundColor.isEqual(backgroundColor))
. In VBScript and JavaScript, you use a specific filter method. For example, to apply a Gaussian blur
ApplyGaussianBlur/applyGaussianBlur()
object.
object
SolidColor
property of the
Application
object that
SolidColor
object
object
Application
command, you can compare colors. The following
web safe color
property of the
SolidColor
command with an option from the class
filter
Working with Filters 53
object to get the original color to
refers to provides a
foregroundColor
command on AppleScript and the
object for VBScript and JavaScript.
method. All filter methods belong to the
filter

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents