English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Like, the color at point x,y on yahoo.com is red. Is this possible with Javascript?

2007-03-13 19:25:51 · 2 answers · asked by noodlesandbeef 1 in Computers & Internet Programming & Design

2 answers

you can figure out where you are, and what you are pointing at.... but you can't see into an img to see what color it is!

there are tricks though!

if you do an ajax call to the server you can pass along the location and which img it's over, a program in another language (c or java or perl) can figure it out!

If you know the image , and can compute the color because it is geometrically simple (a square, a bunch of lines or an evenly shaded image), you can know the color without have to look into the img.

if it's in the html, you can check the css elements' style's color and background-color.

I've seen some pretty cool things on the net, done by professionals with too much time on their hands!
http://acko.net/dev/farbtastic is one that give the html/css color from a point within an image.

2007-03-13 19:41:43 · answer #1 · answered by jake cigar™ is retired 7 · 0 0

If the color is specific in HTML/CSS you probably can. If it's an imagemap or plugin object, then not.

2007-03-13 19:28:52 · answer #2 · answered by wigginsray 7 · 0 0

fedest.com, questions and answers