Edit in GitHubLog an issue

Channel

Represents a channel in a Photoshop document. You can access instances of channels using one of these methods:

Copied to your clipboard
1// An array of composite channels in the document
2const compositeChannels = app.activeDocument.compositeChannels
3
4// An array of active (selected) channels in the document
5const activeChannels = app.activeDocument.activeChannels
6
7// Reference a document's Red channel
8const redChannel = app.activeDocument.channels[0]

Properties

名称类型访问最低版本描述
colorSolidColorR W23.0The color of the channel.
histogramnumber[]R23.0A 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.
kindChannelTypeR W23.0The type or kind of the channel.
namestringR W23.0The color of the channel.
opacitynumberR W23.0The opacity or solidity of the channel.
parentDocumentR23.0The containing document.
visiblebooleanR W23.0The visibility of the channel.

Methods

duplicate

23.0

async : Promise<void>

Duplicates the channel to the parent document, or a target document if specified.

Copied to your clipboard
1// duplicate the channel
2await channel.duplicate()
3
4// duplicate to a different, compatible document
5const newDoc = psApp.documents[1]
6await channel.duplicate(newDoc)

Parameters

名称类型描述
targetDocument?Documentif specified, duplicate to a different document target.

merge

23.0

Promise<void>

Merges a Spot Color channel into the component channels.


remove

23.0

Promise<void>

Deletes the channel.

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.