pythonpyautogui

Pyautogui not showing correct pixel color on Mac


I am trying to get the pixel color of where the mouse is, and the RGB value is not even close to what it is supposed to be. Here is an example. I am using some basic code:

import pyautogui
import time

while True:
     x, y = pyautogui.position()
     print(pyautogui.pixel(x, y))
     time.sleep(1)

I have no clue what to do and any advice would be appreciated!


Solution

  • We conclude that the code works fine on a windows 10 with vscode and python 3.10.

    It appears as though this is might be a Mac specific issue.