Copy link to clipboard
Copied
Hi,
First of all i want to say i'm not a IT so i just try to do the best of me.
I’m working on a script to obtain a .csv document with the information about the colour RGB/CMYK and the XY coordinates for this colour to update in a BBDD.
I have a problem, i found a script that only shows one colour that I pick up with the eyedropper tool (Photoshop).
How can I pick different colours? how can I integrated the XY ref.?
Thanks in advance
Paula
By whatever means, get the x & y values for the location of the color sample. The below show how to get the different color values. You don't need to change the document color space to get these different values. I don't know about getting Panetone values.
...#target photoshop
var doc = activeDocument
x=200
y=150
doc.colorSamplers.removeAll();
var cS = doc.colorSamplers.add([x,y])
var cR = cS.color.rgb.red;
var cG = cS.color.rgb.green;
var cBl = cS.color.rgb.blue;
var cC = cS.color.cmyk.cyan
var c
Copy link to clipboard
Copied
Could you please post a sketch/mock-up or screenshots to clarify what you are trying to achieve?
The Color Sampler Tool can be used to create measurements for several locations.
Copy link to clipboard
Copied
This is my demo picture.
I open Photoshop and I convert the workplace to CMYK. I need to get the color code of a series of pixels (that i whant to select with the eyedropper tool).
Then I want to obtain the position of the pixel (XY) with the CMYK, RGB and LAB values for every pixel that i select and save theses values in a .txt document or excel.
If is it possible, i would like to obtain at the same time the Pantone but if is not possible, i can save the color like a new swatches and then, export the swatches fil and cross the to files to obtain the complete reference of color/pixel.
Copy link to clipboard
Copied
By whatever means, get the x & y values for the location of the color sample. The below show how to get the different color values. You don't need to change the document color space to get these different values. I don't know about getting Panetone values.
#target photoshop
var doc = activeDocument
x=200
y=150
doc.colorSamplers.removeAll();
var cS = doc.colorSamplers.add([x,y])
var cR = cS.color.rgb.red;
var cG = cS.color.rgb.green;
var cBl = cS.color.rgb.blue;
var cC = cS.color.cmyk.cyan
var cM = cS.color.cmyk.magenta
var cY = cS.color.cmyk.yellow
var cK = cS.color.cmyk.black
var cL = cS.color.lab.l
var cA = cS.color.lab.a
var cB = cS.color.lab.b
Copy link to clipboard
Copied
Hi Chuck,
I tried the script and it doesn’t work. Or I made a mistake running the script.
I tried in the CS6 version and it works but only create a document with X=200 Y=150 values, no mine colour selection. I tried as well in the last PS version (trial version from adobe website) and appear the messages “Make doesn’t exist”.
Can you revise please? I want to obtain the X Y reference for 10 different colour sampler with the different colour values.
Grateful
Paula
Copy link to clipboard
Copied
I want to obtain the X Y reference for 10 different colour sampler
Then use a for-clause to work through those and amend the line
var cS = doc.colorSamplers.add([x,y])
accordingly.
Copy link to clipboard
Copied
Yes, as c.pfaffenbichler pointed out, you need to add your own code to find the X & Y locations you want to sample. The code I posted was just to show you how to get the values. Use my code to plug into your code just to get the various color values you want.
Copy link to clipboard
Copied
paulaSTpaulahave you been able to amend the code to conform to your expectations?
Copy link to clipboard
Copied
I asked a friend, she is working on it.
I know what I want but not how to get it.
Copy link to clipboard
Copied
If your friend should be stuck on something concerning the Scripting of this task they should post their code here.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now