I'm not sure what you're looking for exactly, but maybe something like this:
Code: Select all
target = thisComp.layer("Color_gradient");
s = target.sampleImage(target.fromWorld(toWorld(anchorPoint)), [0.5,0.5], true, time);
Math.round(s[0]*255) + ", " + Math.round(s[1]*255) + ", " + Math.round(s[2]*255)