
Adobe Photoshop CS3
JavaScript Scripting Reference
JavaScript Object Reference 72
Channel
Object that stores information about a color element in the image, analogous to a plate in the printing
process that applies a single color. The document’s color mode determines the number of default
channels; for example, an RGB document has four default channels:
●
A composite channel: RGB
●
Three component channels: red, green, blue
A channel can also be an alpha channel, which stores selections as masks, or a spot channel, which stores
spot colors.
Note:
Most likely, you will use variables to refer to
Channel
objects in your script. However, if you choose
not to use a variable, be aware that, because the
Channel
class is a property of the
Document
object, you use the property name,
channel
, rather than the class name,
Channel
, in your code.
The following example uses correct syntax to refer to a
Channel
object by name and then assign its
opacity
property value:
documents(0).channel(“my channelr”).opacity = 22
The following example, which uses an upper case
C
in the object name, is incorrect:
documents(0).Channel(“my channelr”).opacity = 22
Properties
Property
Value Type
What it is
color
SolidColor
Read-write. The color of the channel.
Note:
Not valid when
type = ChannelType.COMPONENT
.
histogram
array of 256 numbers
(long)
Read-only. A histogram of the color of the channel.
Note:
Not valid when
type = ChannelType.COMPONENT
. For
component channel histogram values, use the
histogram
property of the
Document
object
instead.
kind
ChannelType
Read-write. The channel type.
name
string
Read-write. The channel's name.
opacity
number (double)
Read-write. The opacity to use for alpha channels or the
solidity to use for spot channels (0 - 100).
Note:
Valid only when
type = ChannelType.MASKEDAREA
or
type = ChannelType.SELECTEDAREA
.
parent
object (
Document
)
Read-only. The object's container.