robotgo/examples/color-picker/main.go
2018-10-21 12:48:34 -04:00

25 lines
335 B
Go

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()
}