Usage example.
While $t = 0
$coord = PixelSearch($gLeft,$gTop, $gRight, $gBottom, Hex(0x0000FF),10)
If Not @error Then
$colorck = colorzone($coord[0],$coord[1],10,0,2)
If $colorck Then
MsgBox(0, "Yes", "Seems to be the same.")
EndIf
EndIf
Function.
; 5x5 compair(500,500,5,5)
;xxxxx o is center and reading point.
;xxxxx compairing all colors in the radius
;xxoxx if color is in range of 5 offset for none int returns in the radius then return true
;xxxxx try and use even numbers for best result
;xxxxx It will round otherwise
;
Func colorzone($x1, $y1, $square, $offset, $step = 0)
$x2 = $x1 - Int($square / 2)
$y2 = $y1 - Int($square / 2)
$x3 = $x1 + Int($square / 2)
$y4 = $y1 + Int($square / 2)
$var = PixelGetColor($x1, $y1)
$coord = PixelSearch($x2, $y2, $x3, $y4, $var, $offset, $step)
If Not @error Then
Return True
Else
Return False
EndIf
EndFunc ;==>compair
ENJOY!!