🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.photoshop.scripting
Article #1855

Re: Eyedropper tool doesn't seem to be working

#1855
From: Ari_Valen_Levinson
Date: Sat, 17 Jul 2004 21:48
15 lines
1591 bytes
My appologies, I found my mistake. I'm sure I'll have pleanty of legitimate questions about scripting in the future, but this isn't one of them. The script that I was using actually defined the eyeDropper script internally, but I assumed that it was a "built-in" function. Their eyeDropper script is as follows.

function eyeDropper(x,y) { // --------------------------------------------------------eyeDropper---

// This function returns the three values for the RGB colours of any given pixel

	var x2 = x + 1;
	var y2 = y + 1;
	var out = new Array(3);
	docRef.selection.select([[x,y], [x2,y], [x2,y2], [x, y2]], SelectionType.REPLACE, 0, false);
	for(ch in list = ["Red", "Green", "Blue"]) {
	histogram = docRef.channels[list[ch]].histogram;
		for (i = 0; i <= 255; i++) { 			if (histogram[i]) { 				out[ch] = i; 				break; 			} 		} // end for 	} // end for return out;

} // end function eyeDropper
Technical Details
Message-ID: <3bb514ac.1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.agarik.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx
References: <3bb514ac.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,75581e08ae676cf2
X-Google-Attributes: gidf5839,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Ari_Valen_Levinson@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.agarik.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.photoshop.scripting
Subject: Re: Eyedropper tool doesn't seem to be working
Message-ID: <3bb514ac.1@webx.la2eafNXanI>
Date: Sat, 17 Jul 2004 14:48:02 -0700
References: <3bb514ac.-1@webx.la2eafNXanI>
Lines: 29
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit