How to get pixel color of mouse position

Hello, is there a way to get the pixel color of the mouse position in screen?

You can use Robotgo package (GitHub - go-vgo/robotgo: RobotGo, Go Native cross-platform GUI automation @vcaesar)

x, y := robotgo.GetMousePos()
color := robotgo.GetPixelColor(x, y)
fmt.Printf("Color of pixel at (%d, %d) is 0x%s\n", x, y, color)
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.