473,395 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
3 6206
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Neraph | last post by:
Sorry, I'm somewhat of a newbie at this. I'm looking for a method of grabbing the color of a pixel when clicking on an image (obviously, using javascript). Google searching hasn't returned...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.