Copy link to clipboard
Copied
How to get the coordinates of one pixel of the sampling point RGB color?
Example, the figure for the RGB value sampling tool:
#target photoshop var doc = app.activeDocument, samps = doc.colorSamplers; for ( var i = 0; i < samps.length; i++ ) { var r = Math.round( samps.color.rgb.red ), g = Math.round( samps.color.rgb.green ), b = Math.round( samps.color.rgb.blue ); alert( 'R'+r+' G'+g+' B'+b ); } alert ( samps[1].position );
Copy link to clipboard
Copied
#target photoshop var doc = app.activeDocument, samps = doc.colorSamplers; for ( var i = 0; i < samps.length; i++ ) { var r = Math.round( samps.color.rgb.red ), g = Math.round( samps.color.rgb.green ), b = Math.round( samps.color.rgb.blue ); alert( 'R'+r+' G'+g+' B'+b ); } alert ( samps[1].position );
Find more inspiration, events, and resources on the new Adobe Community
Explore Now