Skip to content

[Feature] ColorPickerButton Updates #3643

Open

Description

Describe the problem this feature would solve

Roll-up of all feature additions and changes needed for the next version of the ColorPickerButton.

Original PR #3379
Original Issue #3363

Features / Refactoring

  1. [Cancelled] Add a recent colors palette / list
    • It may make sense to show this in place of the accent colors and the preview color (there isn't space for both). The recent color list will always show the currently selected color first anyway. At this point an enum for preview display modes may make more sense than a lot of mutually exclusive properties: 1. PreviewColor, 2. PreviewAndAccentColors 3. RecentColors
  2. [Cancelled] Add an Eyedropper button to select an existing color in the app. Integrate with the recent colors list. Follow ColorPickerUX
    • The recent colors will likely be horizontal instead of vertical and replacing the standard preview and accent colors
    • The eyedropper will be shown to the left of the recent colors list (nearest the currently selected color)
  3. Add property to hide the accent colors to show only the preview color
  4. [Cancelled] Address todo items from initial PR here:
    • The mini selected color palette may follow the Windows accent color lighter/darker shades algorithm. However, the implementation of this algorithm is currently unknown. This algorithm may be in the XAML fluent theme editor: https://github.com/microsoft/fluent-xaml-theme-editor Algorithm is unknown and likely will never be public. I'm dropping this change from consideration until/if the situation changes.
    • Move localizable strings into resources
    • Treat negative/zero numbers in CustomPaletteColumnCount as 'auto' and automatically calculate a good column count to keep rows/columns even (square root rounded up to the nearest int). Set the default of this property to 0 'auto'.
  5. [Cancelled] Complete the ColorPickerSlider as a stand-alone control. Use binding to link it with the ColorPicker/ColorPickerButton. This simplifies the template and removes the remaining unwanted template parts.
  6. Combine all property changed callbacks into one to simplify things [From discord discussion] Closed in Color picker fixes #4134
  7. Use a corner radius of 4 to match WinUI 2.6 styles
  8. Switch to using NumberBox for color channel inputs
  9. Add back drop shadow behind preview color
  10. Make accent colors work in HSV to avoid colors getting stuck in black/white. Will fix ColorPicker Bottom Shade Adjuster Resets Color to White #4208.

Bugs

  1. There seems to be a visual bug in slider background rendering in some edge cases. This is a result of fixing some components to max in cases they probably shouldn't be.
  2. Set default Brush values in the XAML default style instead of when registering the DP. This is necessary to ensure a reference isn't shared across instances or threads. [From discord discussion] Closed in Color picker fixes #4134
  3. DPI changes do not trigger redrawing checkered background or slider gradients. This causes them to be blurry. Must listen for DPI changes and then re-render the backgrounds. [From discord discussion]

If I missed anything feel free to add in the comments below!

Additional context & Screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions