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

Discussion in 'Javascript' started by Weston C, Sep 15, 2004.

  1. Weston C

    Weston C Guest

    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!
    Weston C, Sep 15, 2004
    #1
    1. Advertising

  2. 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.
    Richard Cornford, Sep 15, 2004
    #2
    1. Advertising

  3. Weston C

    Fred Oz Guest

    In <ci8oqb$7v2$1$> 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.
    Fred Oz, Sep 15, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. André Wagner

    Fastest pixel by pixel operation

    André Wagner, Mar 17, 2008, in forum: Java
    Replies:
    12
    Views:
    1,030
    Larry A Barowski
    Mar 19, 2008
  2. Jack
    Replies:
    2
    Views:
    139
  3. Billy
    Replies:
    3
    Views:
    103
    Billy
    Jan 26, 2007
  4. Kamaljeet Saini
    Replies:
    0
    Views:
    391
    Kamaljeet Saini
    Feb 13, 2009
  5. Lynn McGuire
    Replies:
    7
    Views:
    150
    Ken Brody
    Nov 18, 2013
Loading...

Share This Page