This copies the hex code of the pixel the mouse is pointing at whenever a key combination (shift+z+x) is pressed.
pynput, PIL, pyperclip, pyautogui
- Listens for keyboard input.
- When shift+z+x key combination is detected, takes a screenshot of the screen and stores mouse pointer coordinates.
- Takes the rgb value of the pixel at those coordinates in the screenshot.
- Converts rgb value to hex code.
- Copies hex code to clipboard.
- The key combination can be changed from COMBINATIONS variable within the main() function.
- The program exits when it scans a white pixel (hex code #ffffff). This can be turned off as instructed in the beginning of program.
The part inside the main funtion is copied from a website. Will be happy to mention it here but not able to find it again.