Hi there,
is it possible to pick the color of a pixel in my document using JavaScript?
For example:
app.activeDocument.pixel.getColor(x,y);
I know this wouldn't work, but is there a chance to do something like this?
I tried to use ScriptingListenerJS Plugin and got the following JavaScript but I don't find any place to give this code the exact pixel I wan't.
var id143 = charIDToTypeID( "setd" );
var desc26 = new ActionDescriptor();
var id144 = charIDToTypeID( "null" );
var ref12 = new ActionReference();
var id145 = charIDToTypeID( "Clr " );
var id146 = charIDToTypeID( "FrgC" );
ref12.putProperty( id145, id146 );
desc26.putReference( id144, ref12 );
var id147 = charIDToTypeID( "T " );
var desc27 = new ActionDescriptor();
var id148 = charIDToTypeID( "Rd " );
desc27.putDouble( id148, 22.000000 );
var id149 = charIDToTypeID( "Grn " );
desc27.putDouble( id149, 117.003891 );
var id150 = charIDToTypeID( "Bl " );
desc27.putDouble( id150, 189.996109 );
var id151 = charIDToTypeID( "RGBC" );
desc26.putObject( id147, id151, desc27 );
executeAction( id143, desc26, DialogModes.NO );
Perhaps someone can help me?
BR
Andreas
is it possible to pick the color of a pixel in my document using JavaScript?
For example:
app.activeDocument.pixel.getColor(x,y);
I know this wouldn't work, but is there a chance to do something like this?
I tried to use ScriptingListenerJS Plugin and got the following JavaScript but I don't find any place to give this code the exact pixel I wan't.
var id143 = charIDToTypeID( "setd" );
var desc26 = new ActionDescriptor();
var id144 = charIDToTypeID( "null" );
var ref12 = new ActionReference();
var id145 = charIDToTypeID( "Clr " );
var id146 = charIDToTypeID( "FrgC" );
ref12.putProperty( id145, id146 );
desc26.putReference( id144, ref12 );
var id147 = charIDToTypeID( "T " );
var desc27 = new ActionDescriptor();
var id148 = charIDToTypeID( "Rd " );
desc27.putDouble( id148, 22.000000 );
var id149 = charIDToTypeID( "Grn " );
desc27.putDouble( id149, 117.003891 );
var id150 = charIDToTypeID( "Bl " );
desc27.putDouble( id150, 189.996109 );
var id151 = charIDToTypeID( "RGBC" );
desc26.putObject( id147, id151, desc27 );
executeAction( id143, desc26, DialogModes.NO );
Perhaps someone can help me?
BR
Andreas