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:
committed by
Monica S
parent
fd204eeb7b
commit
7f0c0c9155
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
#if NETSTANDARD2_0 || NET45
|
|
||||||
using StandardColor = System.Drawing.Color;
|
using StandardColor = System.Drawing.Color;
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Discord
|
namespace Discord
|
||||||
{
|
{
|
||||||
@@ -190,12 +188,10 @@ namespace Discord
|
|||||||
|
|
||||||
public override int GetHashCode() => RawValue.GetHashCode();
|
public override int GetHashCode() => RawValue.GetHashCode();
|
||||||
|
|
||||||
#if NETSTANDARD2_0 || NET45
|
|
||||||
public static implicit operator StandardColor(Color color) =>
|
public static implicit operator StandardColor(Color color) =>
|
||||||
StandardColor.FromArgb((int)color.RawValue);
|
StandardColor.FromArgb((int)color.RawValue);
|
||||||
public static explicit operator Color(StandardColor color) =>
|
public static explicit operator Color(StandardColor color) =>
|
||||||
new Color((uint)color.ToArgb() << 8 >> 8);
|
new Color((uint)color.ToArgb() << 8 >> 8);
|
||||||
#endif
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the hexadecimal representation of the color (e.g. <c>#000ccc</c>).
|
/// Gets the hexadecimal representation of the color (e.g. <c>#000ccc</c>).
|
||||||
|
|||||||
Reference in New Issue
Block a user