Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scripting colorsamplers to sample only active layer

Community Expert ,
Feb 28, 2013 Feb 28, 2013

In the menu bar of CS6 for the color sampler, it has a feature for sample all layers or current layer.  While this feature allows you to sample forground and background colorrs this way, the info panel still shows the all layers color value.  Is there any way to script the color sampler so that you can read the values of one particular layer without having to turn off visalility on all other layers?

TOPICS
Actions and scripting
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Valorous Hero ,
Feb 28, 2013 Feb 28, 2013

I wonder if you are using the cloud version as I am not seeing this option?

Sampler.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2013 Feb 28, 2013

Paul, I'm not using the cloud, but I did get my terms mixed up.  The sample current layer is on the eye dropper tool and not the color sampler tool.  However, if you can use the eye dropper tool on a selected layer, it seem that you should also be able to use the color sampler.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 28, 2013 Feb 28, 2013

Ah, I suppose the quickest way would be to duplicate the required layer out to it's own document and measure it there?

I have looked at the docs but there isn't any options there Chuck.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2013 Feb 28, 2013

That's what I've been doing, Paul.  Just wondering if I was missing something.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 01, 2013 Mar 01, 2013

Alt clicking on the layer to be sampled visibility toggles off all other layers with visibility on a second alt-click toggles back on the layers that were turned off.  So you can toggle the color sampler value  between the single layer value and the compost view value. Alt+Click Layers Visibility is recordible so Scriptlistener code can be had. However I have no idea as to how you would get the value shown in the info panel for a color sample into a script.

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 01, 2013 Mar 01, 2013
LATEST

Yes, toggling on and off the all the layer's visibility was one way I was thinking about getting around having to use a second document.  I was also thinking about having the sample layer on top then have the script work below that layer.  It would just be nice to be able to specify a particular layer for sampling such as:

var layerSample = docRef.sampleLayer.colorSamplers(pointLocationArray)

Here's a sample of what I'm playing with.  It samples a reference image then randomly draws and places rectangles and applies a gradient based on the color samples of the reference image.  Once the rectangles are drawn, further sampling would capture the retangles, so that's why it would be nice to be able to sample the background layer or some other layer.

http://www.flickr.com/photos/7872516@N05/8519085254/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines