screen.screen.is_color
Declaration
lua
screen.is_color(x, y, r, g, b [, tolerance])
Description
Check if pixel at (x,y) matches target RGB within tolerance.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
x | integer | Required | — | X |
y | integer | Required | — | Y |
r | integer | Required | — | Red 0-255 |
g | integer | Required | — | Green 0-255 |
b | integer | Required | — | Blue 0-255 |
tolerance | integer | Optional | 0 | Per-channel tolerance |
Return Values
| Type | Description |
|---|---|
| boolean | true if color matches |
Example
lua
if screen.is_color(100, 200, 255, 0, 0) then sys.log("Red!") end