screen.screen.find_all_color
Declaration
lua
screen.find_all_color(r, g, b [, x1, y1, x2, y2 [, tolerance [, limit]]])
Description
Find ALL pixels matching RGB color. Returns array of coordinates.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
r | integer | Required | — | Red |
g | integer | Required | — | Green |
b | integer | Required | — | Blue |
x1,y1,x2,y2 | integer | Optional | Full screen | Region |
tolerance | integer | Optional | 0 | |
limit | integer | Optional | 100 | Max results (min 1) |
Return Values
| Type | Description |
|---|---|
| table | Array of {x, y} tables (always returns table, may be empty) |
Example
lua
local pts = screen.find_all_color(255, 0, 0, 0, 0, 750, 1334, 10, 50)