Color detection
Instead of searching for a complex image template, Color detection looks for a single specific pixel color on the screen.
Color detection uses the same base settings as Image detection, including Search regions, Timeout, Scan rate, Behaviors, Loops, and Nested Actions.
However, instead of a template, it uses:
- Hex Color (#RRGGBB): The exact color you are looking for, written as
#RRGGBB. Or use Pick Color from Screen to read the real pixel. - Saved Colors: Once you have a colour you like, Save Current keeps it in a small palette you can reuse in other detections instead of picking it again each time. Remove takes one back out.
Code Equivalent
In GScript, pass a hex colour instead of a template name:
// Find the color #FF0000 within a specific region
let region = new Region(100, 100, 500, 500);
let redColor = Color.fromHex("#FF0000");
let match = region.find(redColor.toHex(), { timeout: 5000, minScore: 0.8 });
if (match) {
// Click the color if found within 5 seconds
match.click();
}