Pyautogui not showing correct pixel color on Mac

Question:

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!

Asked By: ZackDaQuack

||

Answers:

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.

Answered By: D.L
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.