Skip to main content
Participant
November 4, 2020
Question

Solid Color Layer not Working

  • November 4, 2020
  • 2 replies
  • 3346 views

Hi, Is there anyone that can tell me why all of a sudden i cannot create a solid color layer. It was working fine a couple of days ago. I can add all other layers such a Brightness/contrast layer, a gradient layer and all other layers seem to work except solid color. I seem to have nothing but trouble with this latest version of Photoshop 2021.

This topic has been closed for replies.

2 replies

Stephen Marsh
Community Expert
Community Expert
November 8, 2020
 
 
// Add Solid Fill Layer via Color Picker GUI.jsx

#target photoshop

if (app.documents.length > 0) {

getColorpickerColor();

/* https://community.adobe.com/t5/photoshop/get-photoshop-foreground-color-as-rgb-value/td-p/9402156 */
var fColor = app.foregroundColor;
var R = fColor.rgb.red.toFixed(2);
var G = fColor.rgb.green.toFixed(2);
var B = fColor.rgb.blue.toFixed(2);

/* Clean SL Code for SOLIDFILL layer */
makeFill(R, G, B);
function makeFill(red, Grn, blue) {
var c2t = function (s) {
return app.charIDToTypeID(s);
};

var s2t = function (s) {
return app.stringIDToTypeID(s);
};

var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
var descriptor3 = new ActionDescriptor();
var descriptor4 = new ActionDescriptor();
var reference = new ActionReference();

reference.putClass(s2t("contentLayer"));
descriptor.putReference(c2t("null"), reference);
descriptor4.putDouble(s2t("red"), red);
descriptor4.putDouble(c2t("Grn "), Grn);
descriptor4.putDouble(s2t("blue"), blue);
descriptor3.putObject(s2t("color"), s2t("RGBColor"), descriptor4);
descriptor2.putObject(s2t("type"), s2t("solidColorLayer"), descriptor3);
descriptor.putObject(s2t("using"), s2t("contentLayer"), descriptor2);
executeAction(s2t("make"), descriptor, DialogModes.NO);
}

/* https://graphicdesign.stackexchange.com/questions/125917/how-can-i-get-an-rgb-color-using-photoshops-color-picker-instead-of-systemss */
function getColorpickerColor() {
if (app.showColorPicker()) {
return app.foregroundColor;
}
else {
return false;
}
}

} else {
alert('You must have a document open!');
}

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

NeilinAlberta
Participant
November 7, 2020

I am having the same issue.  It only just started and all other adjustment layers seem to be working fine.