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

Out-of-the-box color picker #28587

Closed
michelkaporin opened this issue Jun 13, 2017 · 6 comments
Closed

Out-of-the-box color picker #28587

michelkaporin opened this issue Jun 13, 2017 · 6 comments
Assignees
Labels
plan-item VS Code - planned item for upcoming
Milestone

Comments

@michelkaporin
Copy link
Contributor

To improve user experience when working with styling in CSS files we plan to add a colour picker.

There are current implementations of colour picker in extension marketplace but they are heavy-weight and do not form part of the core code.

@michelkaporin michelkaporin added this to the June 2017 milestone Jun 13, 2017
@michelkaporin michelkaporin self-assigned this Jun 13, 2017
@ajitid
Copy link
Contributor

ajitid commented Jun 20, 2017

With custom color palette and color converter too (RGB(A) <-> HEX <-> HSL and others) please :)

@michelkaporin michelkaporin added the feature-request Request for new features or functionality label Jun 21, 2017
@michelkaporin
Copy link
Contributor Author

michelkaporin commented Jun 21, 2017

The initial plan is to have the following features (which could be extended going further):

  1. Ability to select color, shade and transparency
  2. Ability to switch between CSS Color Module Level 3 standard colours
    • RGB values
    • hexadecimal values
    • HSL values (CSS3)
  3. View and edit current selected color value inside colour picker
  4. View initially selected colour from the editor

Going further we could extend the picker with:

  1. Colour palettes
  2. Showing all the colors of current file to easy pick an existing color
  3. Color eyedropper (not sure how feasible is it at the current stage)

Let me know if you find something else very useful and that it is not on the list.

@ajitid
Copy link
Contributor

ajitid commented Jun 21, 2017

On "going further":

  1. Extending your point 2 by detecting all colors used in the current project and making a color palette out of it.
  2. Naming colors present in the color palette. So one can type something like btn-hover (which is then suggested by Intellisense) and press enter rather than typing #43aaaa to get the color.
  3. Dynamic coloring- A checkbox, when ticked and a color in the palette if changed, all of its occurrence in the project will be changed.

@egamma egamma added plan-item VS Code - planned item for upcoming and removed feature-request Request for new features or functionality labels Jun 21, 2017
@michelkaporin michelkaporin modified the milestones: July 2017, June 2017 Jun 21, 2017
@anseki
Copy link

anseki commented Jul 5, 2017

Hi,
I expect this great feature, and I will do maintenance my "Color Picker" extension until this feature is added to VS Code.

And I hope that the feature supports customizing a format of an output, when picking a color or converting colors.
E.g. it allow us to choose 70% or 0.7. Also, FED or ffeedd, etc.

@dstorey
Copy link
Member

dstorey commented Jul 11, 2017

I like the plan.

Some additional ideas:

  • It would be nice to default to hex shorthand where available (like Extension API: cursor position (determining current location and moving it) #111 rather than Error: Failed to move '*' to the recycle bin. #111111)
  • It would be really cool if VS Code understood your linter rules and defaulted to that format for colours if you have one specified. I could imagine this wouldn't be easy as there are more than one CSS linter.
  • CSS4 extends hex to be able to specify the alpha channel (4 and 8 digit hex). This may be nice to add but as it isn't well supported yet, maybe this would just encourage interop issues.
  • Where you specify both a colour and a background-colour in the same ruleset, it would be really brilliant if the colour picker warned (and maybe clamped the sliders) when the two colours don't meet the two recommended colour contrast ratios. You probably couldn't do it beyond the current ruleset as you don't know outside the browser what will get inherited like you can in F12, but at least it is something.

This was referenced Jul 26, 2017
@isidorn
Copy link
Contributor

isidorn commented Aug 2, 2017

@michelkaporin has delivered color picker to master, you can try it out in vscode insiders.
Closing

@isidorn isidorn closed this as completed Aug 2, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plan-item VS Code - planned item for upcoming
Projects
None yet
Development

No branches or pull requests

6 participants