Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
I wonder if you are using the cloud version as I am not seeing this option?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
That's what I've been doing, Paul. Just wondering if I was missing something.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now