-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: <input type=color> hint for eyedropper-only #5584
Comments
Cool! Presumably ESC or similar function keys disable the operation? |
cc @whatwg/forms |
Yeah. Details would be up to the UA, but I think that's how they're typically implemented.
Maybe. I definitely agree that the script should not be able see mouse coordinates and color (otherwise it can potentially reconstruct what the user is mousing over). But some native drawing apps with eyedroppers display the current color under the cursor within their "active color" widget, updating it live as the user moves the mouse. If UAs can suspend delivering mouse events to script while in the eyedropper mode then maybe updating the HTMLInputElement's value "live" would not be a privacy concern, and would match native app behavior. I think we should explore this, but I agree the fallback is as you suggest.
Yep, whatever is the latest convention for such things. |
Some folks have put up an explainer for a different API proposal here: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/EyeDropper/explainer.md They request feedback via this link: |
Closing this in favor of https://github.com/wicg/eyedropper-api/ |
Background:
The
<input type=color>
form control allows selecting a color. User agents typically implement this using a pop-up color picker. In some user agents, the picker includes an "eyedropper" control, either implemented by the UA or by the OS-provided picker.Example:
![](https://user-images.githubusercontent.com/771547/83194381-6d51eb80-a0ed-11ea-9860-2d2013739d14.png)
The eyedropper control causes the app to enter a modal state; the cursor changes to an eyedropper; when the cursor is clicked - on any part of the desktop, whether over the page, the UA, or another application - the underlying color is selected.
Feature Request and Use Case:
We've had feature requests against Chrome from numerous developers of web-based design tools. (tracking bug) to provide the ability to show an eyedropper without the pop-up color picker. This would allow such web applications to provide the same functionality as native desktop applications, integrating an eyedropper into the color picker into their UI. Here's the UI for a typical desktop native app (Gimp) showing an eyedropper control:
Proposal
This functionality could be added progressively by adding an attribute to
<input type=color>
that effectively "skips" the popup if supported. For example:<input type=color eyedropper>
<input type=color>
.click()
as is common for other form controls (like<input type=file>
)HTMLInputElement.prototype
.... but other proposals to support the use case are welcome.
Chrome is interesting in implementing support for this use case.
The text was updated successfully, but these errors were encountered: