Channel
Represents a channel in a Photoshop document. You can access instances of channels using one of these methods:
Copied to your clipboard1// An array of composite channels in the document2const compositeChannels = app.activeDocument.compositeChannels34// An array of active (selected) channels in the document5const activeChannels = app.activeDocument.activeChannels67// Reference a document's Red channel8const redChannel = app.activeDocument.channels[0]
Properties#
Name | Type | Access | Description |
---|---|---|---|
color | SolidColor | Read-write | The color of the channel. |
histogram | number[] | Read-only | A histogram containing the number of pixels at each color intensity level for this channel. The array contains 256 members. The target channel must be visible. |
kind | ChannelType | Read-write | The type or kind of the channel. |
name | string | Read-write | The color of the channel. |
opacity | number | Read-write | The opacity or solidity of the channel. |
parent | Document | Read-only | The containing document. |
visible | boolean | Read-write | The visibility of the channel |
Methods#
duplicate#
async : Promise<void>
Duplicates the channel to the parent document, or a target document if specified.
Copied to your clipboard1// duplicate the channel2await channel.duplicate()34// duplicate to a different, compatible document5const newDoc = psApp.documents[1]6await channel.duplicate(newDoc)
Parameters#
Name | Type | Description |
---|---|---|
targetDocument? | Document | if specified, duplicate to a different document target. |
merge#
Promise<void>
Merges a Spot Color channel into the component channels.
remove#
Promise<void>
Deletes the channel.