I built a similar tool for this purpose recently. It uses Canvas, but falls back to Flash if Canvas is not supported. Here's an example - hover and click the image - http://www.imagecolorpalette.com/image/40
Why does it turn magenta when you double-click (on two distinct pixels specifically)?
That's just the highlight color. Assuming you're using Chrome, it's pretty eager about highlighting random stuff; other browsers may be similar. Try selecting some text.