website icon indicating copy to clipboard operation
website copied to clipboard

Clicking on a single color in the palette should copy the hsl value

Open Deep-Codes opened this issue 2 years ago • 8 comments

Feature request

Overview

1st of all amazing color system

Would be really great if I am able to copy HSL values of color palettes.

On the index page

Screenshot 2021-07-13 at 6 31 15 PM

Copy function is there in this page

But it copies the entire object which is cool in that use case.

Screenshot 2021-07-13 at 6 35 00 PM

Examples in other libraries or sites

Vercel Design System has this taping on var(--color-code) copies it.

Who does this impact? Who is this for?

Developers/Designers who want to quickly copy and try it out.

Deep-Codes avatar Jul 13 '21 13:07 Deep-Codes

@Deep-Codes Can I work on this?

akshitarora921 avatar Oct 27 '21 08:10 akshitarora921

Ah, this has actually been fixed already.

peduarte avatar Oct 27 '21 08:10 peduarte

@peduarte It copies the entire row colors not that clicked color

akshitarora921 avatar Oct 27 '21 08:10 akshitarora921

Ah yeah, sorry, I got confused with another issue 😮‍💨

So what is being proposed here? That each individual color can be clickable, and if so, the HSL value is copied to the clipboard?

peduarte avatar Oct 27 '21 08:10 peduarte

yes, No problem :)

akshitarora921 avatar Oct 27 '21 09:10 akshitarora921

Ah yeah, sorry, I got confused with another issue 😮‍💨

So what is being proposed here? That each individual color can be clickable, and if so, the HSL value is copied to the clipboard?

I am in love with Radix Colors

many times I don't need the entire palette I just handful of them.

an example from Vercel's Geist

geist

Deep-Codes avatar Oct 27 '21 10:10 Deep-Codes

I see, but which value should it copy?

The radix colors were designed to be used together, as a scale, so I think we'd like to guide users towards that, and not single colors.

As you know, the scale can be copied in various formats. If we allow a single color to be copied, I think we should also offer all formats, instead of picking one (like hsla).

Have you thought about the UI for this?

peduarte avatar Nov 02 '21 07:11 peduarte

+1 for this feature. Have had to go into dev tools to copy the background color many times.

I disagree with not being able to copy individual colors. I understand they're meant to be used together, and it's pretty clear from the website that they are. Often times, you don't need all 12 colors though, if, for example, I want a basic foreground and background color for prototyping.

I think hexcode is fine for copying...if its really a problem, then right click can open a context menu "copy as rgb, copy as hex, copy as hsla".

For interaction, I think left click can copy rgb, with a temporary toast/popover shown under the box. I'm not sure if there's a radix component for this. The closest seems to be popover: https://www.radix-ui.com/docs/primitives/components/popover except that this toast will go away after a short delay (1-2s).

If supporting multiple color formats is important, then the right click context menu can be implemented instead or in addition.

tanishqkancharla avatar Jan 31 '22 00:01 tanishqkancharla

This is now available from color palette dialogs

vladmoroz avatar Feb 28 '24 16:02 vladmoroz