As you have noticed, the robot is getting the colour of the G1ANT.Robot window and not the desktop. According to the manual:
The color command retrieves the red, green and blue (RGB) color values of the pixel at the specified coordinates
And about the relative argument:
position needs a value representing pixel coordinates and
relative defines if these coordinates are relative to the upper left
corner of the active window (by default) or absolute on the screen
(also measured from its upper left corner).
So absolute
position means that wherever the window is, the colour will be get relative to the top left corner of the screen. relative
position means that the colour will be get relative to the top left corner of the active window.
In your example it doesn't matter if your desktop is red because, I assume, G1ANT.Robot is focused when you launch your script.
You can either:
- Use the
WIN+D
shortcut which will minimize all opened windows (show desktop):
color position 762⫽485 relative false
keyboard ⋘WIN+D⋙
dialog ♥result
- Leave the script as it is but move the G1ANT.Robot window to some position where it doesn't cover the
762⫽485
position that you want to get the colour from.