Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
EyeDropper.open() method starts the eyedropper mode, returning a promise which is fulfilled once the user has either selected a color or dismissed the eyedropper mode.
An options object to pass an
AbortSignal. The eyedropper mode will be aborted when the
abort()method is called.
Promise that eventually resolves when the user selects a pixel color from the screen.
The promise resolves to an object with the following property:
A string representing the selected color, in hexadecimal sRGB format (
Exceptions are not thrown but returned when the
Promise is rejected.
The promise is rejected in two cases:
- When the user dismisses the eyedropper mode by pressing the Escape key.
- When the eyedropper mode is aborted by the
AbortControllerpassed as an argument to
|EyeDropper API |
BCD tables only load in the browser
EyeDropperinterface it belongs to.