Photoshop Javascript change layer color
Hello I am writing scripts to automate Adobe Photoshop process. I am using JavaScript as my scripting language.
I've never used JavaScript in photoshop environment and i was wondering if someone could offer me some advice.
Here is a high level overview of what i am trying to accomplish.
1) Get a data set from a JSON file
2) Loop through the JSON file and pull data which will then be passed into the image layers
3) Apply patterns and colors to each layer
4) Save file
The first 2 steps are relatively simple (basic javascript patterns) How ever where i start to run into trouble is when i am actually trying to manipulate the image in the photoshop.
How would I change the color of a layer ?
Here is my code snippet that is NOT working
function changeColor(){
var class2hex = app.activeDocument.artLayers.getByName("CLASS2HEX");
alert(class2hex.kind) // LayerKind.SOLIDFLL
var Color = new SolidColor();
Color.rgb.hexValue = 'a5142f'';
// HOW DO I APPLY THE COLOR TO THE LAYER?
// ALSO how would i change the layer pattern in a similar fashion ?
Thank you!
