fix: add .NET Standard 2.1 support for Color (#1405)

* Add NETSTANDARD2_1 support for Color

* Remove all conditionals following PR
This commit is contained in:
Patrick Klaeren
2019-10-25 23:38:41 +01:00
committed by Monica S
parent fd204eeb7b
commit 7f0c0c9155

View File

@@ -1,8 +1,6 @@
using System;
using System.Diagnostics;
#if NETSTANDARD2_0 || NET45
using StandardColor = System.Drawing.Color;
#endif
namespace Discord
{
@@ -190,12 +188,10 @@ namespace Discord
public override int GetHashCode() => RawValue.GetHashCode();
#if NETSTANDARD2_0 || NET45
public static implicit operator StandardColor(Color color) =>
StandardColor.FromArgb((int)color.RawValue);
public static explicit operator Color(StandardColor color) =>
new Color((uint)color.ToArgb() << 8 >> 8);
#endif
/// <summary>
/// Gets the hexadecimal representation of the color (e.g. <c>#000ccc</c>).