I'm looking for the color under the cursor, but not just one pixel. It would need to be, say, 5 pixels in all 4 directions outwards from the cursor tip. So in other words, PixelGetColor searches a single pixel under the cursor (as far as I know), so I would need it to instead search all 5 pixels to the left of the cursor, 5 to the right, 5 up and 5 down, including the 1 center pixel under the cursor tip. So in other words, a very small cube.
Imagine a small 10x10 cube centered under and following the mouse cursor and whenever it detects the color in *all* 100 pixels (or is it 104, I don't know) within that cube, it sends a messagebox or something. Here's an idea I've come up with:
Code: Select all
CoordMode pixel, screen
coordmode, mouse, screen
loop
{
MouseGetPos, x1, y1
NORTH:=(y1-5)
SOUTH:=(y1+5)
EAST:=(x1+5)
WEST:=(x1-5)
y_TOTAL:=(NORTH+SOUTH)
x_TOTAL:=(EAST+WEST)
PixelGetColor, Color, %x_TOTAL%, %y_TOTAL%, RGB
tooltip, color is %Color%
}
Return
I suppose PixelGetColor would need to be something more like RegionGetColor or something, if tha makes sense. It would need to search the x,y of the upper-left-hand-corner of the box, down to the lower-right-hand-corner x,y coordinates of the box... so double the amount of co-ordinates that PixelgetColor searches for.
Any tips would be great, sorry that I come up with all these crazy questions lately lol