getting the color of a pixel

J. Landman Gay jacque at
Sun Mar 16 22:00:49 EDT 2008

Colin Holgate wrote:
> For something I'm trying, I want to know the color of a specified pixel 
> on the card. I haven't yet found a built in function for that, so I made 
> one:
> function getPixel x,y
>   put the screenMouseLoc into ml
>   set the screenMouseLoc to x+the left of this stack,y+the top of this 
> stack
>   put the mouseColor into mc
>   set the screenMouseLoc to ml
>   return mc
> end getPixel
> It works really well, and quickly, so I can carry on with what I'm 
> trying. Was there a built in way that I should have found in the help?

I asked Scott Raney for a function like that many years ago, and he 
replied that I should do it exactly as you are doing it now. So I guess 
that's the officially sanctioned method.

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the Use-livecode mailing list