Page 1 of 1

pixelgetcolor to variable

Posted: 04 Oct 2019, 06:40
by sumir
I have no clue how to get this to work

²::
var2 = PixelGetColor, color, 900, 400, RGB
if (var1 = "C6C6C6")
{
MsgBox succes
}
else {MsgBox c6 fail}

}

Re: pixelgetcolor to variable

Posted: 04 Oct 2019, 06:57
by Blackholyman
PixelGetColor Is a command not a function

A command like that has the return as the first parameter

So in your posted code the variable color holds the returned color from 900,400

Re: pixelgetcolor to variable

Posted: 04 Oct 2019, 10:23
by gregster
Also, PixelGetColor returns colors in this format: 0xC6C6C6 So you will have check for that.

The line else {MsgBox c6 fail} uses incorrect syntax. Either remove the { } or use them like you did with if.
(Please compare the docs for else and { }-blocks)