# Function Reference

PixelGetColor

Returns a pixel color according to x,y pixel coordinates.

PixelGetColor ( x , y )

Parameters

x | x coordinate of pixel.
y | y coordinate of pixel.

Return Value

Success: | Returns decimal value of pixel's color.
Failure: | Returns -1 if invalid coordinates.

Remarks

Earlier versions of AutoIt (prior to v3.0.102) used the BGR format for defining color - newer versions use RGB by default but this can be changed using the ColorMode option.

Related

ColorMode (Option), PixelSearch, PixelCoordMode (Option), MouseGetPos

Example

$var = PixelGetColor( 10 , 100 )
MsgBox(0,"The decmial color is", $var)
MsgBox(0,"The hex color is", Hex($var, 6))