wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

[Enhancement/New control] Color picker

Open osrosal opened this issue 3 years ago • 2 comments

Pull request type

Please check the type of change your PR introduces:

  • [ ] Update
  • [ ] Bugfix
  • [x] Feature
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] Documentation content changes

What is the current behavior?

As said in #294, we don't have a built in color picker in WPF, nor this library provides one, so here it is!

What is the new behavior?

A new color picker control, ported from the Microsoft.UI.Xaml repo.

Other information

It is not ready yet, I didn't found some of the resources used by the controls on the original repo and some work is pending:

  • [x] ~~Alpha slider and alpha text input can not be hidden individually (Only by disabling alpha completely).~~
  • [x] Color picker color slider and hex input can not be hidden.
  • [x] Color picker more button does not show.
  • [x] Alpha slider checkered background does not show.
  • [x] Color picker slider vertical orientation adds a spacing both at the top and the bottom of the control.
  • [x] Large increments on color (done by pressing Ctrl+Any arrow key, while the color spectrum is focused) work only in some cases. The problem is located in the ColorHelpers.IncrementColorChannel method.
  • [x] Fix "third dimension slider" and "alpha slider" tooltips.
  • [x] Maybe create new templates for the color picker slider.
  • [ ] Maybe improve the way to obtain the name of a color, currently this method does the job: ColorHelpers.GetNearestNamedColorTuple.
  • [x] Replace hardcoded strings and color names.
  • [x] Maybe other things that I have not tested, and... cleanup, I left some old code commented just in case.

I'll be working on what's left until my vacation ends, after that I will be busy, but hopefully it will be finished by that time

osrosal avatar Jul 24 '22 17:07 osrosal

@pomianowski, I was planning on using your Lepo.i18n library for localization, but it does not have support for .NET Framework 4.6.1, which this library does. Is there any reason to not support that .NET Framework version on that library?

osrosal avatar Jul 27 '22 20:07 osrosal

I am finished for now, there is still some work to do. I used the Lepo.i18n library even if does not have support for .NET Framework 4.6.1, but in a quick test I verified that it could. Also, I just added the localized color names for english (US and GB) and spanish (ES and MX), so there is pending work there, but I am going to take a break on these last few days of my free time. Sorry for no finishing this up and not provide any documentation, but I already spent a great part of my vacation working on another project and this control.

osrosal avatar Jul 30 '22 17:07 osrosal