Proposal: Add HsvColor Struct and HsvColor Property to ColorPicker
See original GitHub issueProposal: Add HsvColor Struct and HsvColor Property to ColorPicker
Summary
- Add a new HsvColor struct to WinUI. The struct should support the properties below. The design is based on the Windows Community Toolkit implementation.
// The hue channel 0..359
public double H { get; }
// The saturation channel 0..1 (a percentage)
public double S { get; }
// The value channel 0..1 (a percentage)
public double V { get; }
// The alpha channel 0..1 (a percentage)
public double A { get; }
- Add an HsvColor property to the ColorPicker itself
- Switch the ColorSpectrum HsvColor property to use the HsvColor struct instead of Vector4
Rationale
The color picker internally works in HSV. If applications require high color precision they cannot be converting to/from RGB and HSV repeatedly or the values will drift.
It also makes sense to expose the HSV color to clean-up internal ColorPicker code that shares the value between components.
Scope
Capability | Priority |
---|---|
Add a new HsvColor struct | Must |
Expose the internal HsvColor in the ColorPicker | Must |
Expose conversion methods from RGB <-> HSV | Must |
Rework internal ColorPicker/ColorSpectrum code to use HsvColor instead of Vector4 | Should |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Two new color spaces for color picking - Okhsv and Okhsl
Okhsv and Okhsl Two new color spaces for color picking This post has an accompanying interactive comparison of color pickers. I would...
Read more >Building a Color Picker with GDI+ in Visual Basic .NET or ...
Coincidentally, I ran across an application using a dialog box that allows users to select colors using the HSV color scheme (much like...
Read more >My Version of the Ubiquitous Color Picker
An article describing a color picker with independent control of seven variables and dynamically updating slider backgrounds.
Read more >VR Color Picker
ABSTRACT In this paper, we propose a 3D color picker for virtual reality (VR) systems. Using the proposed color picker, the RGB and...
Read more >New alternatives to HSL and HSV that better match color ...
I like using perceptual spaces because they are self-evidently a “neater” starting point for colour work than something artificially distorted ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh I see, that would also work. Maybe that would be a
must
then, after all we are already adding a separate API here for the ColorPicker and introducing just the HSV struct without any conversion helpers seems a bit lacking.The proposal does not require it, but I think it would make sense to provide it. Maybe it should be required, having to implement the conversion yourself doesn’t sound like a great experience.