Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

JavaScript,sampling,RGB COLOR

New Here ,
Jul 30, 2011 Jul 30, 2011

How to get the coordinates of one pixel of the sampling point RGB color?


Example, the figure for the RGB value sampling tool:

a.JPG

TOPICS
Actions and scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Jul 30, 2011 Jul 30, 2011

#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 );

Translate
Adobe
Guru ,
Jul 30, 2011 Jul 30, 2011
LATEST

#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 );

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines