Browse Source

Remove Empty field and IsEmpty property from Color/HsvColor

pull/7724/head
robloo 5 years ago
parent
commit
8cab8af039
  1. 17
      src/Avalonia.Visuals/Media/Color.cs
  2. 17
      src/Avalonia.Visuals/Media/HsvColor.cs

17
src/Avalonia.Visuals/Media/Color.cs

@ -14,11 +14,6 @@ namespace Avalonia.Media
#endif
readonly struct Color : IEquatable<Color>
{
/// <summary>
/// Represents a null <see cref="Color"/> with zero set for all channels.
/// </summary>
public static readonly Color Empty = new Color();
static Color()
{
#if !BUILDTASK
@ -46,18 +41,6 @@ namespace Avalonia.Media
/// </summary>
public byte B { get; }
/// <summary>
/// Gets a value indicating whether this <see cref="Color"/> is uninitialized and
/// considered null.
/// </summary>
public bool IsEmpty
{
get => A == 0 &&
R == 0 &&
G == 0 &&
B == 0;
}
public Color(byte a, byte r, byte g, byte b)
{
A = a;

17
src/Avalonia.Visuals/Media/HsvColor.cs

@ -16,11 +16,6 @@ namespace Avalonia.Media
#endif
readonly struct HsvColor : IEquatable<HsvColor>
{
/// <summary>
/// Represents a null <see cref="HsvColor"/> with zero set for all channels.
/// </summary>
public static readonly HsvColor Empty = new HsvColor();
////////////////////////////////////////////////////////////////////////
// Constructors
////////////////////////////////////////////////////////////////////////
@ -99,18 +94,6 @@ namespace Avalonia.Media
/// </summary>
public double V { get; }
/// <summary>
/// Gets a value indicating whether this <see cref="HsvColor"/> is uninitialized and
/// considered null.
/// </summary>
public bool IsEmpty
{
get => A == 0 &&
H == 0 &&
S == 0 &&
V == 0;
}
////////////////////////////////////////////////////////////////////////
// Methods
////////////////////////////////////////////////////////////////////////

Loading…
Cancel
Save