Difference between revisions of "Lua:getPixel"
Jump to navigation
Jump to search
m (Syntax Highlighting.) |
|||
| Line 24: | Line 24: | ||
===Examples=== | ===Examples=== | ||
| − | < | + | <syntaxhighlight lang="lua" line> |
local color = getPixel(100, 100) | local color = getPixel(100, 100) | ||
print(string.format("Pixel color: #%X", color)) | print(string.format("Pixel color: #%X", color)) | ||
| − | </ | + | </syntaxhighlight> |
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
Latest revision as of 20:29, 25 June 2026
Returns the RGB value of the pixel at the specified screen coordinate.
Function Parameters[edit]
| Parameter | Type | Description |
|---|---|---|
| x | Integer | The X coordinate of the screen pixel. |
| y | Integer | The Y coordinate of the screen pixel. |
Returns[edit]
integer — The RGB value of the pixel at the specified screen coordinate.
Examples[edit]
1 local color = getPixel(100, 100)
2 print(string.format("Pixel color: #%X", color))