Merge pull request #114 from khionu/patch-1

Added ToString and DebuggerDisplay
This commit is contained in:
RogueException
2016-07-13 14:04:16 -03:00
committed by GitHub

View File

@@ -1,5 +1,9 @@
using System;
using System.Diagnostics;
namespace Discord
{
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct Color
{
/// <summary> Gets the default user color value. </summary>
@@ -32,6 +36,11 @@
((uint)(r * 255.0f) << 16) |
((uint)(g * 255.0f) << 8) |
(uint)(b * 255.0f);
}
}
public override string ToString() =>
$"#{Convert.ToString(RawValue, 16)}";
private string DebuggerDisplay() =>
$"#{Convert.ToString(RawValue, 16)} ({RawValue})";
}
}