screen.screen.color_count
Declaration
lua
screen.color_count(r, g, b [, x1, y1, x2, y2 [, tolerance]])
Description
Count pixels matching RGB color. NEON SIMD accelerated.
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 |
Return Values
| Type | Description |
|---|---|
| integer | Count of matching pixels |
Example
lua
local n = screen.color_count(255, 255, 255, 0, 0, 750, 100)