-
Notifications
You must be signed in to change notification settings - Fork 771
Description
Proposal: Add a ColorPickerButton Control
The color picker is a big help when using WinUI. However, it takes a lot of space. A common design practice is to preview the color in a small button. Pressing the button will open the color picker in a flyout for editing. There are lots of different implementations for this and Microsoft even provides an example here: https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/color-picker#save-the-chosen-color
This concept should be standardized and pulled into WinUI itself for use in all applications. Additional features should be added such as sliders for all color channels and a color palette to select from.
I've already added this control in a PR on the WindowsCommunityToolkit. Once stabilized, I would like to bring it over to WinUI 3.0.
Summary
Add a color picker drop-down button as shown below (example). The name of this control was decided to be 'ColorPickerButton' (technically it should be ColorPicker while the existing one should be ColorCanvas) but some ideas are:
- ColorSwatchPicker
- ColorBox
- ColorPickerButton
- ColorPickerDropDown
- ColorDropDownButton
- ColorPickerDropDownButton (long I know)
The drop down button could look as below:
The button will show a preview of the selected color which also supports transparency on a checkered background. When the drop-down is opened, a color picker is shown in a flyout to change the selected color.
| Spectrum | Palette | Channels |
|---|---|---|
![]() |
![]() |
![]() |
![]() |
Rationale
- Standardize the common 'ColorPickerButton' design principle
- Save application screen space when choosing a color
- Provides an input control to use in forms
- Adds ability to modify a color using channel sliders (with colored slider backgrounds)
- Adds ability to select a color from a palette
Scope
| Capability | Priority |
|---|---|
| Create a new 'ColorPickerButton' | Must |
| Support all color picker properties in the button | Must |
| Support preview of transparent colors on a checkered background | Must |






