What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Reply to thread

Here is the script that gets actual foreground Color and ads + 1 to each until 255 (just paste it into notepad and save as jsx file):

[CODE=javascript]

#target photoshop


var Color = app.foregroundColor;


var newR = Math.round(foregroundColor.rgb.red) + 1;

var newG = Math.round(foregroundColor.rgb.green) + 1;

var newB = Math.round(foregroundColor.rgb.blue) + 1;


if(newR > 255){

    newR = 255;

}


if(newG > 255){

    newG = 255;

}


if(newB > 255){

    newB = 255;

}



Color.rgb.red = newR;

Color.rgb.green = newG;

Color.rgb.blue = newB;


app.foregroundColor = Color;

[/CODE]


and here is version for subtracting by 1 until 0:


[CODE=javascript]#target photoshop


var Color = app.foregroundColor;


var newR = Math.round(foregroundColor.rgb.red) - 1;

var newG = Math.round(foregroundColor.rgb.green) - 1;

var newB = Math.round(foregroundColor.rgb.blue) - 1;


if(newR < 0){

    newR = 0;

}


if(newG < 0){

    newG = 0;

}


if(newB < 0){

    newB = 0;

}



Color.rgb.red = newR;

Color.rgb.green = newG;

Color.rgb.blue = newB;


app.foregroundColor = Color;

[/CODE]


hope that helps ;)


What is our favorite program/app? (Hint - it begins and ends with the letter P)
Back
Top