Skip to main content
New Participant
August 28, 2015
Answered

XY coordinates and color ref

  • August 28, 2015
  • 2 replies
  • 2684 views

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

This topic has been closed for replies.
Correct answer Chuck Uebele

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

2 replies

c.pfaffenbichler
Community Expert
September 5, 2015

paulaSTpaulahave you been able to amend the code to conform to your expectations?

New Participant
September 7, 2015

I asked a friend, she is working on it.

I know what I want but not how to get it.

c.pfaffenbichler
Community Expert
September 10, 2015

If your friend should be stuck on something concerning the Scripting of this task they should post their code here.

c.pfaffenbichler
Community Expert
August 28, 2015

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.

New Participant
September 1, 2015

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.

Chuck Uebele
Chuck UebeleCorrect answer
Community Expert
September 2, 2015

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