screen.screen.find_color_rgb
Declaration
lua
screen.find_color_rgb(r, g, b [, x1, y1, x2, y2 [, tolerance]])
Description
Find first pixel matching RGB color in region. NEON SIMD accelerated row scanning.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
r | integer | Required | — | Red 0-255 |
g | integer | Required | — | Green 0-255 |
b | integer | Required | — | Blue 0-255 |
x1,y1,x2,y2 | integer | Optional | Full screen | Search region |
tolerance | integer | Optional | 0 | Per-channel tolerance |
Return Values
| Type | Description |
|---|---|
| integer | Found X |
| integer | Found Y |
| nil | Not found |
Example
lua
local x, y = screen.find_color_rgb(255, 0, 0)
local x2, y2 = screen.find_color_rgb(255, 0, 0, 0, 0, 375, 667, 10)