Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Color class lacks Hue, Saturation, and Luminosity properties. #280

Open
davidbritch opened this issue Jan 14, 2022 · 2 comments
Open

Color class lacks Hue, Saturation, and Luminosity properties. #280

davidbritch opened this issue Jan 14, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@davidbritch
Copy link

davidbritch commented Jan 14, 2022

The Xamarin.Forms Color struct has Hue, Saturation, and Luminosity properties. The Maui.Graphics Color class does not. This makes the upgrade path from Forms to MAUI that more frustrating.

I get that converting a Color to HSL every time the Color changes isn't efficient (which is what Forms did, IIRC), when the chances are that most users aren't interested in HSL. But for anyone who did use them, well, their apps are now broken until they rewrite to call GetSaturation() etc., and restructure their code to avoid keep calling GetSaturation() etc (which recalculates the value each time) rather than just accessing a property.

At the very least, I'd have hoped for Hue, Saturation, and Luminosity properties that are marked as obsolete for the first release. It's a bit annoying having to rewrite data binding code that bound to properties that no longer exist.

@swharden

This comment has been minimized.

@swharden
Copy link
Contributor

swharden commented Jan 14, 2022

I implemented this suggestion in PR #281

swharden added a commit to swharden/Microsoft.Maui.Graphics that referenced this issue Jan 15, 2022
Add Xamarin.Forms.Color properties to Maui.Graphics.Color (all marked obsolete): R, G, B, A, Hue, Luminosity, and Saturation dotnet#280
@Redth Redth added the bug Something isn't working label Jan 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants