Pyautogui is good library for GUI operations its having position() and i used screenshot() and then get color of given pixel, this is something i have tried, you can check it out by this below code,
Before go with code, install package by using
python -m pip install pyautogui
Code:
import pyautogui
try:
while True:
x, y = pyautogui.position()
pixelColor = pyautogui.screenshot().getpixel((x, y))
screenShot = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
screenShot += ' RGB: (' + str(pixelColor[0]).rjust(3)
screenShot += ', ' + str(pixelColor[1]).rjust(3)
screenShot += ', ' + str(pixelColor[2]).rjust(3) + ')'
print(screenShot)
except KeyboardInterrupt:
print("\nDone...")