Setting Color differences

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Kukurykus, Tom, xbytor

Posts: 1
Joined: Tue Sep 27, 2016 2:05 pm

Setting Color differences

Post by Mr_Roboto »

Hi, I'm wondering why creating a instance of the variable as seen here, works; I always thought you had to declare constructors differently then just creating a variable and making it an instance ?

Code: Select all

var someclr = new SolidColor(); = 80; = 90; = 50;
But creating it as this, doesn't work ?

Code: Select all = 125, = 90, = 70,

User avatar
Posts: 32
Joined: Mon Oct 03, 2016 4:56 am

Re: Setting Color differences

Post by Dormeur74 »

I think it is useful to create an instance of any object, like in a true object langage. This is not obligatory in PSscripting if your code is very short. But in a 800 lines code using different variables on the same model, you must work with instances.
Just a last word : your second code cannot work as is. That is probably the reason why nobody answered your question.
Excuse my poor English if my words are not clear.