WICG / eyedropper-api

Other
69 stars 7 forks source link

live feedback is needed #6

Open Kilian opened 3 years ago

Kilian commented 3 years ago

Copied and lightly edited from this thread.

Use case: I would like to show a visual + textual preview of the selected color in my own UI as people mouse over the screen.

Right now we only get the color on click. When you look at browser extensions (and native color pickers) many have this 'live view' functionality in some way or form. It seems, seeing the color in a larger area than a (zoomed in) single pixel, along with the textual representation is a big part of many color pickers:

All of these provide a live preview of the currently focused color, both visually and in text and that means none of these extensions would work with the proposed API.

I'm sure there are many more extensions that do this, not to mention native color pickers like those found in design tools and standalone applications providing similar live feedback.

It seems to me like, to provide an Eyedropper API that can replace the many flawed canvas-based solutions out there right now, this functionality is a must.

Security implications In terms of security, all this "live" api would have to give back is the color under the cursor. This circumvents security issues with tracking both the color and mouse position.

Kilian commented 3 years ago

Carrying over feedback by @ipopescu93 from the linked thread:

One of our goals is to allow browser implementors the freedom to implement eyedropper pixel selection UI that best fits their platform and browser. Note that in the future, the API may be extended to afford web developers more control over that UI.

vladshcherbin commented 3 years ago

Coming from exactly same extension research about using native browser eye dropper. Live code value in API would be really nice.

maltenuhn commented 3 years ago

Same here - our product (https://github.com/concrete-utopia/utopia) will have to continue hand-rolling an eye dropper until live preview and zoom are either shipped by at least one major browser vendor, or the API extended to allow customisation. That said, the current efforts here are obviously a pre-requisite, and we're excited to see them land!

DenverTK commented 2 years ago

This API is very much needed since some non Chromium browser doesn't show an eyedropper. Firefox is one major one

ericuldall commented 2 years ago

In terms of security, all this "live" api would have to give back is the color under the cursor. This circumvents security issues with tracking both the color and mouse position.

Simply not returning the mouse position would not make this feature secure. You would also have to disable mousemove events as well. Otherwise the script could simply track both events simultaneously and reconstruct your screen.