getting the color of a pixel

Colin Holgate coiin at rcn.com
Sun Mar 16 18:21:00 EDT 2008


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?





More information about the Use-livecode mailing list