-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add new ColorSlider & ColorPreviewer Primitives #8050
Conversation
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
This standardizes with ColorSlider (which requires three states) but so far isn't needed in the templates.
…namespace This better hides these special-purpose converters
These will be needed for future controls
You can test this PR using the following package version. |
You can test this PR using the following package version. |
@maxkatz6 This is also ready for review. I know you all are busy but if this is merged soon I can get started on the final PR for the full color-picker. That should actually not be too difficult compared to what is already done. The final PR can also be lower priority as it isn't blocking anything. |
You can test this PR using the following package version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. ColorSlider is definitely way more useful here comparing with one in WinUI implementation.
You can test this PR using the following package version. |
What does the pull request do?
Adds two new
ColorSlider
andColorPreviewer
control primitives (in the Avalonia.Controls.Primitives namespace). These are stand-alone controls not based on WinUI code. This relates to #4179.These are the second and third major controls towards implementing the ColorPicker and the last primitives.
What is the current behavior?
Only the
ColorSpectrum
primitive exists so far for implementing a ColorPicker.What is the updated/expected behavior with this PR?
Two additional primitives for the ColorPicker are added:
ColorSlider
andColorPreviewer
. These composable primitives allow making a nearly fully-functional color picker.Video.mp4
How was the solution implemented (if it's not obvious)?
ColorSlider
andColorPreviewer
are brand-new controls and not based on WinUI code. They share some code with an internal implementation andColorPreviewer
is currently in a PR updating the UWP (now Windows) community toolkit: ColorPicker Updates CommunityToolkit/WindowsCommunityToolkit#4502.ColorSlider
has been heavily updated improving upon past implementations. It is now a fully stand-alone primitive that can render itself and in no way depends on other higher-level controls. (The WinUI ColorPickerSlider cannot be used independently and earlier ColorPickerSlider implementations by myself were not this advanced).ColorSpectrum
,ColorSlider
andColorPreviewer
) can be two-way bound together through the HsvColor property which supports a lot of the color picker functionality already.ToDisplayName
was implemented for the English language using a new algorithm andKnownColor
enum. The algorithm is not open source so a best-guess was done. This enables the color name tooltips in the spectrum now.Checklist
Breaking changes
None
Obsoletions / Deprecations
None
Fixed issues
Relates to #4179.