microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.22k stars 6.54k forks source link

Color picker: Add a string format without # #12706

Closed fedeberge closed 3 years ago

fedeberge commented 3 years ago

Currently the HEX string includes the number sign. That works great for web design, but creates a lot of problems for pasting the string in other design applications.

Some apps will not recognize the # and create an error or accept only 6 characters and keep the first and remove the last. I.e.: I copy #0D1117 with the color picker, but when I paste on the app it ends up like #0D111 which creates an error.

The fix would be to add a new string format without the pound for design purposes other than CSS. Thanks in advance

franky920920 commented 3 years ago

Maybe this function can be added by using shift + The copy button to copy without #. The copy button I mean is circled below: image

htcfreek commented 3 years ago

@franky920920 , @fedeberge You can select the color code number. The you can copy the selected text by using right click menu.

fedeberge commented 3 years ago

Right now, if you pick a color its HEX number is also copied to the clipboard. A new string format without the # would enable artists and graphic designers to simply paste the code in any app without interacting with Colorpicker's window. Exactly like the snipping tool works

jaimecbernardo commented 3 years ago

This could be solved by adding a new format that's HEX without the sharp sign. A better solution would be to get a way for the user to specify new output formats some way, but I assume there won't be many useful ones.

niels9001 commented 3 years ago

@franky920920 @fedeberge As @htcfreek pointed out, you can click on the color format to select (a part of the text). But I agree, having a format without the # would be nice to have.

This could be solved by adding a new format that's HEX without the sharp sign. A better solution would be to get a way for the user to specify new output formats some way, but I assume there won't be many useful ones.

We are tracking that idea here: https://github.com/microsoft/PowerToys/issues/8305#issue-754506648

Jay-o-Way commented 3 years ago

Honestly, it's a #duplicate of many, many requests. I already mentioned somewhere that having only the "digits" would be ten times easier. I think it's time to get working on #8305 too.

niels9001 commented 3 years ago

I personally run into this issue every other week: copy-ing into tools like PowerApps, Photoshop or other tooling cuts off the latest character because the # is included.

Two options:

  1. We remove the # altogether (very easy fix)
  2. We do 1, and add a HEX2 (?) format that includes the #.

I'm in favor of 1 to reduce complexity of having two very similiar formats, yet different.

@martinchrzan @dedavis6797 @jaimecbernardo @stefansjfw @crutkas Thoughts?

martinchrzan commented 3 years ago

We should push other apps to be more accommodating. Jokes aside, I would go for 2 formats - uppercase HEX without the # (for external tools) lowercase HEX with # (for CSS use - we can call it css hex or so)

Or flip the casing, seems like there are different opinions about upper/lowercase in CSS

Jay-o-Way commented 3 years ago

Yeah, casing is not a priority and is a personal preference. I always use uppercase.

stefansjfw commented 3 years ago

I would also go with 2 formats. Uppercase/lowercase proposal sounds good.

Do application that accept format with # also accept without #? Or it's strict format always? If all of the apps that accept # prefix, also accept format without #, just removing # would be the easiest, straight forward solution..

niels9001 commented 3 years ago

@stefansjw I think most applications will. For example, Adobe XD (PowerPoint does the same thing btw):

ColorPicker Adobe XD

It allows for pasting in a HEX value with # and without # (it will automatically add the # itself).

I'll add an additional, lowercase HEX format and remove the # from the current HEX format (since that's on by default and probably used by most users).

jaimecbernardo commented 3 years ago

I personally run into this issue every other week: copy-ing into tools like PowerApps, Photoshop or other tooling cuts off the latest character because the # is included.

Two options:

  1. We remove the # altogether (very easy fix)
  2. We do 1, and add a HEX2 (?) format that includes the #.

I'm in favor of 1 to reduce complexity of having two very similiar formats, yet different.

@martinchrzan @dedavis6797 @jaimecbernardo @stefansjfw @crutkas Thoughts?

Already started discussing this in the PR, but it seems the discussion here has more participants. Why not let the current format stay the same and add a new one without the #? This way we wouldn't break current behavior for users who have their workflow set up (I imagine css coders, for example).

jaimecbernardo commented 3 years ago

If the reason is related to the formats that are visible by default for new users, that can be replaced here: https://github.com/microsoft/PowerToys/blob/5cfbd72fa81a489d266558f99fbf16f20defea0a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ColorPickerProperties.cs#L21-L23

I just don't see the requirement to change a current format if we're adding a new one anyway.

Jay-o-Way commented 3 years ago

@jaimecbernardo I hear you. Just one question: how would you name both?

jaimecbernardo commented 3 years ago

@jaimecbernardo I hear you. Just one question: how would you name both?

I think HEX could stay for the current one and HEX2 would work for the new one, as suggested by @niels9001

Jay-o-Way commented 3 years ago

@niels9001 now that the GUI is changed, docs need multiple updated images too. Would you like to do that too, or somebody else?

Also, how does the Editor (displaying and send-to-clipboard) deal with recent changes?

niels9001 commented 3 years ago

@jay-o-way I think the changes are minor so updating those images doesn't feel like a big priority imo.

crutkas commented 3 years ago

Wasn't there an open issue to create custom strings? Is the belief no # is more impactful and the custom string is the solution to needing the #?

What does the MacOS color picker do here.

dedavis6797 commented 3 years ago

Resolved with v0.49.0. Thanks @niels9001!

dedavis6797 commented 3 years ago

For reference, https://github.com/microsoft/PowerToys/issues/8305 is the item for custom strings.

On Mac, Digital Color Meter adds the #.