Filling a channel results in incorrect color
This is a question pertaining to automation with JavaScript, however I have noticed this problem also shows up when using actions within photoshop as well. I am simply trying to automate the process of filling a channel with a color. For some reason, when you automate the fill command on a channel, the result is not the color you specified. For example, running the following code will fill the channel "Alpha 1" with 149,149,149 rather than 128, 128, 128. Is this just a bug, or am I missing something?
#target photoshop
app.bringToFront();
app.activeDocument.selection.selectAll();
// Make "Alpha 1" the active channel
app.activeDocument.activeChannels = [app.activeDocument.channels.getByName("Alpha 1")];
// Create a color to fill the "Alpha 1" channel with.
var fillColor = new SolidColor();
fillColor.rgb.red = 128;
fillColor.rgb.green = 128;
fillColor.rgb.blue = 128;
app.activeDocument.selection.fill(fillColor);
