Microsoft.Maui.Graphics icon indicating copy to clipboard operation
Microsoft.Maui.Graphics copied to clipboard

Color: Add obsolete Xamarin.Forms properties

Open swharden opened this issue 3 years ago • 1 comments

Color Properties

Originally suggested by @davidbritch in #280

This PR adds common properties from Xamarin.Forms.Color (R, G, B, A, Hue, Saturation, Luminosity) to Maui.Graphics.Color to make migration easier.

These properties are marked obsolete with messages indicating their replacements.

Related: #31, #32, #54, #58

Color.FromHtml()

I also added FromHtml() marked obsolete, but depending on feedback I'd really like to remove the obsolete attribute. People with previous System.Drawing experience may reach for this method name recalling ColorTranslator.FromHtml(). If they accidentally find FromHex() this will be bad because it forwards the string to FromArgb whose format is AARRGGBB and not the HMTL format.

https://github.com/dotnet/Microsoft.Maui.Graphics/blob/a8feeb062040911360f922b571cbace57e078117/src/Microsoft.Maui.Graphics/Color.cs#L115

Related: #81

swharden avatar Jan 15 '22 00:01 swharden

I think the first part of your description is going to be implied by the fact that it's marked as obsolete in Visual Studio.

Hi @jfversluis, thanks for your input! I simplified the obsolete messages and agree with you that they read better now.

But this seems good to me otherwise, thanks!

Sure thing! Thanks to you and everyone else who keeps this project moving forward 🚀

swharden avatar Jun 29 '22 23:06 swharden