How the Screen and Image Color Picking Work
AnyTool Color Picker from Screen samples colors two ways, both entirely in the browser. For screen picking it feature-detects the native EyeDropper API ('EyeDropper' in window) and, on Chromium browsers (Chrome, Edge, Opera) in a secure https context, calls new EyeDropper().open() in response to a click; the promise resolves to { sRGBHex } for the single pixel you click anywhere on your screen — including outside the browser — and a thrown AbortError (Esc / dismiss) is handled silently. For the universal fallback it draws an uploaded, dropped or pasted image onto an HTML canvas (with willReadFrequently) and reads pixels with getImageData(); a magnifier loupe redraws the surrounding pixels at high zoom with imageSmoothing disabled so you can target the exact pixel. The temporary object URL is revoked the moment the image is drawn. Every picked color is converted client-side to HEX, RGB, HSL and HSB.
- Screen picking uses the native EyeDropper API → { sRGBHex } for one pixel
- EyeDropper requires Chromium, a secure (https) context and a user gesture
- User cancel throws AbortError and is handled gracefully
- Image fallback reads pixels via canvas getImageData() — works in every browser
- Object URLs are revoked after draw; conversion to HEX/RGB/HSL/HSB is client-side
