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

Color: Add obsolete Xamarin.Forms properties #281

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
24 changes: 24 additions & 0 deletions src/Microsoft.Maui.Graphics/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ public class Color
public readonly float Blue;
public readonly float Alpha = 1;

[Obsolete("Use Red instead.")]
public float R => Red;

[Obsolete("Use Green instead.")]
public float G => Green;

[Obsolete("Use Blue instead.")]
public float B => Blue;

[Obsolete("Use Alpha instead.")]
public float A => Alpha;

[Obsolete("Use GetHue() instead.")]
public float Hue => GetHue();

[Obsolete("Use GetLuminosity() instead.")]
public float Luminosity => GetLuminosity();

[Obsolete("Use GetSaturation() instead.")]
public float Saturation => GetSaturation();

public Color()
{
// Default Black
Expand Down Expand Up @@ -114,6 +135,9 @@ public string ToRgbaHex(bool includeAlpha = false)
[Obsolete("Use FromArgb instead.")]
public static Color FromHex(string colorAsArgbHex) => FromArgb(colorAsArgbHex);

[Obsolete("Use Parse instead.")]
public static Color FromHtml(string htmlColor) => Parse(htmlColor);

public Paint AsPaint()
{
return new SolidPaint()
Expand Down