The EyeDropper API, available in Chromium 95+, lets websites allow users to pick colors from anywhere on their screen with just a few lines of JavaScript. The API exposes a global `EyeDropper` object with an `open()` method that returns a promise resolving to a `ColorSelectionResult` containing the picked color as an sRGB hex value. Key constraints include requiring a user-initiated event to open the picker (for security), and colors being captured as a static screenshot rather than live screen data. Current limitations include no live color preview while hovering, colors restricted to the sRGB color model (no wide-gamut P3 support), and no native multi-color selection. The API is not yet supported in Firefox or Safari, and the author encourages developers to upvote the relevant browser issues.

6m read timeFrom polypane.app
Post cover image
Table of contents
Try it outHow to use the EyeDropper APIThings to keep in mind when using the EyeDropper APIFeatures we want to see addedOther browsers