Colour detection in an area

Is there a function that will return a list of detected colours for a given search rectangle?

many thanks

Something like this would work:

SetOption remoteWorkInterval, .001

put (625,613,860,843) into myRectangle

put item 1 of myRectangle into myLeft
put item 2 of myRectangle into myTop
put item 3 of myRectangle into myRight
put item 4 of myRectangle into myBottom

put myRight - myLeft into myNumberOfColumns
put myBottom - myTop into myNumberOfRows

repeat myNumberOfRows times
	put the repeatindex  + myTop into y1
	repeat myNumberOfColumns times
		put the repeatindex + myLeft into x1
		put ColorAtLocation(x1,y1)
	end repeat
end repeat

Hope this helps,

1 Like

HI Dave

Thanks for this sample - what is the reasoning behind the 0.001 work interval? Is this purely because there is no actual mouse / key interaction with the SUT?

Iā€™m guessing this is a substantially lower setting than default and shoudl be returned to normal for other script ececution?

many thanks


Hi Paul,

You are correct on both accounts: the RemoteWorkInterval which governs the time between steps that require SUT interaction, is .07 seconds by default. Because in my case the SUT is static (I used a screenshot connection), I used an extremely short RWI.

Be well,