add color picker and get mouse pos example

This commit is contained in:
vcaesar 2018-10-21 12:48:34 -04:00
parent e2fd078da8
commit 83845a8488

View File

@ -0,0 +1,24 @@
package main
import (
"fmt"
"github.com/go-vgo/robotgo"
)
func colorPicker() {
m := robotgo.AddEvent("mleft")
if m == 0 {
x, y := robotgo.GetMousePos()
fmt.Println("mouse pos: ", x, y)
clo := robotgo.GetPixelColor(x, y)
fmt.Println("color: #", clo)
}
}
func main() {
fmt.Println("color picker...")
colorPicker()
}