eyedropper-api icon indicating copy to clipboard operation
eyedropper-api copied to clipboard

live feedback is needed

Open Kilian opened this issue 4 years ago • 5 comments

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 avatar Aug 12 '21 13:08 Kilian

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.

Kilian avatar Aug 12 '21 13:08 Kilian

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

vladshcherbin avatar Aug 15 '21 14:08 vladshcherbin

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!

maltenuhn avatar Aug 16 '21 11:08 maltenuhn

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

DenverTK avatar Mar 26 '22 08:03 DenverTK

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.

ericuldall avatar Apr 12 '22 22:04 ericuldall