pixelgetcolor to variable

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sumir
Posts: 1
Joined: 04 Oct 2019, 06:32

pixelgetcolor to variable

04 Oct 2019, 06:40

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}

}
User avatar
Blackholyman
Posts: 1293
Joined: 29 Sep 2013, 22:57
Location: Denmark
Contact:

Re: pixelgetcolor to variable

04 Oct 2019, 06:57

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
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:
gregster
Posts: 9020
Joined: 30 Sep 2013, 06:48

Re: pixelgetcolor to variable

04 Oct 2019, 10:23

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)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, Rohwedder and 315 guests