ApplesauceOS
Read Markdown ↗Download .md

getColor

Sample one screen pixel.

js
getColor(x, y)

Arguments

ArgumentTypeMeaning
x, ynumberNative screen pixels.

Returns

{red, green, blue, alpha, hex}; channels 0..255 and hex "#RRGGBB". Invalid capture/position gives -1 channels and empty hex.

Example

js
console.log(getColor(100, 100));

Notes

Use current screenshot coordinates; a color match alone does not identify a control.

All JavaScript APIs · Automation playbook