When making a macro it's not a good idea to use exact pixel colours as they quite often change slightly. This script 'decides' if a pixel colour is more red, green or blue and should combat the pixel colour changing issue.
- Code: Select all
^l::
MouseGetPos, x, y
PixelGetColor, c, x, y
b := c >> 16
g := c >> 8 & 0xff
r := c & 0xff
x := max(max(b, g), r)
If x = %b%
MsgBox, more blue at %x%x%y%
Else If x = %g%
MsgBox, more green at %x%x%y%
Else If x = %r%
MsgBox, more red at %x%x%y%
max(a, b) {
Return, a > b ? a : b
}