Skip to content
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

Components: Support the EyeDropper API in ColorPicker #34487

Open
4 tasks
Tracked by #34284
ciampo opened this issue Sep 2, 2021 · 11 comments
Open
4 tasks
Tracked by #34284

Components: Support the EyeDropper API in ColorPicker #34487

ciampo opened this issue Sep 2, 2021 · 11 comments
Labels
[Feature] Component System WordPress component system Needs Design Needs design efforts. [Package] Components /packages/components [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@ciampo
Copy link
Contributor

ciampo commented Sep 2, 2021

Why

Adding an Eye Dropper tool to the ColorPicker would enhance its UX and features set

What

We should embed an Eye Dropper tool following the EyeDropper APIs:

Note: this API are not stable yet and, at the time of writing, is only supported in Chrome >= 95

A/C

  • Get the updated designs including the EyeDropper button
  • Show the EyeDropper button only when supported is detected
  • Implement the EyeDropper functionality (assign the color picked with the Eye Dropper tool to the currently opened ColorPicker)
  • Edge case: make sure that the Eye Dropper tool is closed (canceled) if for any reason the ColorPicker is dimissed
@ciampo ciampo mentioned this issue Sep 2, 2021
31 tasks
@ciampo ciampo changed the title Add support for the EyeDropper API Components: Add support for the EyeDropper API to the ColorPicker Sep 2, 2021
@ciampo ciampo changed the title Components: Add support for the EyeDropper API to the ColorPicker Components: Support the EyeDropper API in ColorPicker Sep 2, 2021
@ciampo ciampo added [Feature] Component System WordPress component system [Package] Components /packages/components [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. labels Sep 2, 2021
@javierarce
Copy link
Contributor

javierarce commented Oct 8, 2021

Here's a proposal for the eyedropper:

image

  • I placed the tool inside of a new header. This header could contain a title and also allow users to drag the popover and move it around.
  • For the zoom element I followed Chrome's idea of replacing the cursor with the picker. The zoom would follow the cursor around.
  • The RGB code uses a monospaced font, so its width is always the same.
  • I think we don't currently have an eyedropper icon, so we'll need to create one (the one I used on the design is just for reference)

Figma file

@ciampo
Copy link
Contributor Author

ciampo commented Oct 8, 2021

cc'ing @mtias @pablohoneyhoney and @jasmussen regarding the potential UX around an eyedropper tool in the `ColorPicker.

(example codepen: https://codepen.io/matanbobi/pen/GREoZvo)

@pablohoneyhoney
Copy link

Nice!

For some reason I'm not able to see the codepen EyeDropper API is not supported on this platform in any browser and would love to.

Not sure if we want this right away and that's why it wasn't explored initially. If we do, there are cases where the color picker doesn't have a header or it isn't clear if we do need that header all times.

Screen Shot 2021-10-08 at 5 11 09 PM

It might work with the RGBA codes but perhaps the eyedropper could live alongside the control icon if we don't need to label?

Screen Shot 2021-10-08 at 5 14 08 PM

@javierarce
Copy link
Contributor

If we do, there are cases where the color picker doesn't have a header or it isn't clear if we do need that header all times.

In that case we could go for a placement similar to Figma's color picker:

image

@pablohoneyhoney
Copy link

It does unbalance the UI heavily, no?
Is there perhaps a different way to display the RGBA codes so it could live on the left of the controls icon? For example.

@javierarce
Copy link
Contributor

Is there perhaps a different way to display the RGBA codes so it could live on the left of the controls icon? For example.

I'll think about alternative ways to display the color, but I think we could pull that off by just slightly increasing the width of the component and reducing the space between the color parts:

Quick test:

image

Question: the blue color implies that the RGBA are links, right? What happens when the user clicks them?

@ciampo
Copy link
Contributor Author

ciampo commented Oct 9, 2021

For some reason I'm not able to see the codepen EyeDropper API is not supported on this platform in any browser and would love to.

I am able to run the codepen on the latest stable Chrome for MacOS (Version 94.0.4606.81)

@javierarce
Copy link
Contributor

I'm also on that version, but it didn't work for me I had to install Chrome Canary.

@jasmussen
Copy link
Contributor

This is a sweet feature. Because it's such an advanced browser feature that it's barely rolled out to Chrome yet, though, I would echo Pablo that it seems worth it to restrict the button to exist in context of other advanced configuration tools for the time being. Then as browser support becomes wider, the button could literally graduate in the UI.

That said, it could be nice to include a small enhancement for power-users, such as allowing people to press the i key to invoke the eye-dropper when the color picker is open.

It seems important to change the cursor also, though, when the tool is selected. Ideally we create an entirely custom cursor, pending browsers adding a system-level eye-dropper cursor. Altenately, the crosshair cursor might hold us over.

@jorgefilipecosta
Copy link
Member

Should we implement this feature now (with a check and if not supported we don't render anything)? Or it is something for the future when browser support increases?

@ciampo
Copy link
Contributor Author

ciampo commented Feb 7, 2022

Personally, I think this would a nice-to-have feature with (at the moment) a low priority. We could probably use our resources for higher-priority issue and come back to this once browser support looks a bit better.

@jorgefilipecosta jorgefilipecosta added the [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later label Feb 14, 2022
@mtias mtias added [Type] Task Issues or PRs that have been broken down into an individual action to take and removed [Type] Enhancement A suggestion for improvement. labels Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Component System WordPress component system Needs Design Needs design efforts. [Package] Components /packages/components [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

6 participants