Difference between revisions of "Lua:getPixel"
Jump to navigation
Jump to search
m (moved getPixel to Lua:getPixel) |
|||
| Line 1: | Line 1: | ||
[[Category:Lua]] | [[Category:Lua]] | ||
| − | '''function''' getPixel(''x'', ''y'') | + | {{CodeBox|'''function''' getPixel(''x'', ''y'') ''':''' integer}} |
| − | Returns the RGB value of the | + | Returns the RGB value of the pixel at the specified screen coordinate. |
===Function Parameters=== | ===Function Parameters=== | ||
| − | {|width="85%" cellpadding="10 | + | {|width="85%" cellpadding="10%" cellspacing="0" border="0" |
!align="left"|Parameter | !align="left"|Parameter | ||
!align="left"|Type | !align="left"|Type | ||
| Line 12: | Line 12: | ||
|x | |x | ||
|Integer | |Integer | ||
| − | |The | + | |The X coordinate of the screen pixel. |
|- | |- | ||
|y | |y | ||
|Integer | |Integer | ||
| − | |The | + | |The Y coordinate of the screen pixel. |
|} | |} | ||
| + | ===Returns=== | ||
| + | integer — The RGB value of the pixel at the specified screen coordinate. | ||
| + | |||
| + | ===Examples=== | ||
| + | |||
| + | <pre> | ||
| + | local color = getPixel(100, 100) | ||
| + | print(string.format("Pixel color: #%X", color)) | ||
| + | </pre> | ||
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
Revision as of 03:54, 21 June 2026
Returns the RGB value of the pixel at the specified screen coordinate.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| x | Integer | The X coordinate of the screen pixel. |
| y | Integer | The Y coordinate of the screen pixel. |
Returns
integer — The RGB value of the pixel at the specified screen coordinate.
Examples
local color = getPixel(100, 100)
print(string.format("Pixel color: #%X", color))