By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,495 Members | 1,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,495 IT Pros & Developers. It's quick & easy.

Javascript "Eyedropper" (pulls color of a pixel off a page)

P: n/a
Is there any way to use javascript to pull the color of the pixel under
the mouse pointer off the page?

Thanks,

Weston
~==~
http://weston.canncentral.org/
weston8[at]cann8central.org
(remove eights to email me)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Weston C wrote:
Is there any way to use javascript to pull the color of
the pixel under the mouse pointer off the page?


Not really. You, with more or less ease, could work out which element
the mouse was over, and then, on browsers providing a computed style
interface, determine the text, background and border colours of that
element. But telling whether the pointer was over text or the background
or a border would not be easy (and borders may still be inset, outset,
etc and so not necessarily the declared colour under the pointer). And
there would be no chance with images (including background images).

Richard.
Jul 23 '05 #2

P: n/a
In <ci*******************@news.demon.co.uk> Richard Cornford wrote:
Weston C wrote:
Is there any way to use javascript to pull the color of
the pixel under the mouse pointer off the page?


Not really. You, with more or less ease, could work out which element

<snip>

Absolutely none, particularly off the page. You can try to do what
Richard says, except that will not allow for shadows, anti-aliasing, etc.
and even if you could do it, it will not work off the page since your
document must be inside a window.

You can do it with a Java applet maybe, but this is not the place to ask
such things.
Jul 23 '05 #3

P: n/a
On 15 Sep 2004 08:00:01 GMT, Fred Oz wrote:
You can do it with a Java applet maybe, ..


<caveat>
Only if it were a signed applet that
the user accepted and allowed to run.
</caveat>

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.