-
Notifications
You must be signed in to change notification settings - Fork 63
Color: Add obsolete Xamarin.Forms properties #281
base: main
Are you sure you want to change the base?
Conversation
Add Xamarin.Forms.Color properties to Maui.Graphics.Color (all marked obsolete): R, G, B, A, Hue, Luminosity, and Saturation dotnet#280
Add System.Drawing.ColorTranslator.FromHtml() functionality to Color, marking it obsolete with a message indicating to use Parse() instead
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.
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. But this seems good to me otherwise, thanks!
Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>
Hi @jfversluis, thanks for your input! I simplified the obsolete messages and agree with you that they read better now.
Sure thing! Thanks to you and everyone else who keeps this project moving forward 🚀 |
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.
Oh no, thank you so much for spending your valuable time in making this a better product!
LGTM!
Color Properties
Originally suggested by @davidbritch in #280
This PR adds common properties from
Xamarin.Forms.Color
(R
,G
,B
,A
,Hue
,Saturation
,Luminosity
) toMaui.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 previousSystem.Drawing
experience may reach for this method name recallingColorTranslator.FromHtml()
. If they accidentally findFromHex()
this will be bad because it forwards the string toFromArgb
whose format is AARRGGBB and not the HMTL format.Microsoft.Maui.Graphics/src/Microsoft.Maui.Graphics/Color.cs
Line 115 in a8feeb0
Related: #81