Skip to main content
Participant
Aug 10, 2022 1:46 AM UTC
Question

colorSamplers class shows undefined.

Why colorSampler class shows undefined? I am trying to get RGB color values from a specific pixel of the layer. I found many solutions and most of them are using color sampler. For an example, in one of the solutions I found this >>>

var theSampler = app.activeDocument.colorSamplers.add([0.5,0.5]);

But, colorSampler class shows undefined in my case.
>> app.activeDocument.colorSamplers
undefined
>>app.activeDocument.colorSamplers.length;
(index):1 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at <anonymous>:1:34

    1 reply

    John T Smith
    Community Expert
    Community Expert
    Aug 10, 2022 3:15 AM UTC

    When you post a question you always need to tell the Adobe program you are using
    There are MANY programs in a full subscription, plus other non-subscription programs
    Please post the exact name of the Adobe program you use so a Moderator may move this message to that forum

    Translate