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

Glad you we found solution ;) If you will find yourself in a situation where you will have to "pick color" instead of transforming layer here is the script that picks top-left pixel color and sets it as background color sample:


[CODE=javascript]var myDoc = app.activeDocument;


var docWidth = myDoc.width;

var docHeight = myDoc.height;

var xPos = 0;

var yPos = 0;


app.activeDocument.colorSamplers.removeAll();

var target = [UnitValue(0) , UnitValue(0)];

var sample = app.activeDocument.colorSamplers.add(target);


var Color = sample.color;

var R = Math.ceil(Color.rgb.red);

var G = Math.ceil(Color.rgb.green);

var B = Math.ceil(Color.rgb.blue);


app.activeDocument.colorSamplers.removeAll();


var color = app.backgroundColor;

color.rgb.red = R;

color.rgb.green = G;

color.rgb.blue = B;


app.backgroundColor = color;[/CODE]


just paste it in the notepad and save as file with .jsx extension


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