standards-positions icon indicating copy to clipboard operation
standards-positions copied to clipboard

Eyedropper API

Open smfr opened this issue 3 years ago • 7 comments

Request for position on an emerging web specification

  • WebKittens who can provide input: @pxlcoder

Information about the spec

  • Spec Title: Eyedropper API
  • Spec URL: https://wicg.github.io/eyedropper-api/

Design reviews and vendor positions

  • TAG Design Review: https://github.com/w3ctag/design-reviews/issues/587
  • Mozilla standards-positions issue: https://github.com/mozilla/standards-positions/issues/557

Bugs tracking this feature

  • WebKit Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=229755
  • Radar: rdar://problem/82862438

Brief summary of the issue or the subject of the spec. API that allows users to choose colors from anywhere on the screen

smfr avatar Jul 06 '22 18:07 smfr

I feel like the name for this is less than ideal. Why not something more specific like ColorSampler or ColorSelection (to match ColorSelectionOptions) or something? EyeDropper seems it requires prior knowledge in order to be understood (i.e. the only reason I understand what EyeDropper means is because I've seen UI in the past that uses a pipette symbol/icon to toggle this functionality, but IMO that's kinda an arbitrary decision that someone made and is not necessarily something that everyone would understand).

part of me is also concerned with the subtleties of only changing the cursor into a zoomed color picker selection circle thingy, as i'm not sure it'd be entirely clear to the user what that means (again, unless they've had prior experience with a similar UI) and therefore would somewhat heavily rely on the page itself to convey that "hey I'm gonna show you a color picker now, so the next click will only select a color and nothing more". perhaps when the page is in "eyedropper mode" there should be a requirement for some UI to be shown somewhere indicating this so that there's less reliance on the page (and therefore less ways to abuse this)? or maybe a "Do you want to allow this page to select colors from the screen?" prompt?

dcrousso avatar Jul 06 '22 18:07 dcrousso

This should support all of the color spaces that CSS supports. Not a much older subset.

jensimmons avatar Jul 06 '22 18:07 jensimmons

There should also be consistency between <input type="color"> and this API in terms of support for color spaces and alpha.

smfr avatar Jul 06 '22 19:07 smfr

Link to Microsoft's original request for position: https://lists.webkit.org/pipermail/webkit-dev/2021-July/031929.html

miketaylr avatar Jul 07 '22 14:07 miketaylr

I have a concern with the shape of this API: https://github.com/WICG/eyedropper-api/issues/18. Probably not a hill worth dying on, but would be good to fix nonetheless.

With regards to earlier comments, it currently seems aligned with <input type=color>, but that indeed does not have support for anything beyond HTML's simple color concept. I suspect the latter would require some kind of opt-in to fix. For this API you could maybe expose the "real" color as well as the sRGB approximation.

annevk avatar Sep 02 '22 09:09 annevk