Browse Source

Fix #1327 Color.ToString returns wrong value (#1328)

* Match debugger display value

https://github.com/discord-net/Discord.Net/issues/1327

* Use string.format to convert raw value to hex

* Remove nested string.format
tags/2.2.0
Passive Monica S 5 years ago
parent
commit
1e8aa080ab
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Discord.Net.Core/Entities/Roles/Color.cs

+ 2
- 2
src/Discord.Net.Core/Entities/Roles/Color.cs View File

@@ -204,8 +204,8 @@ namespace Discord
/// A hexadecimal string of the color.
/// </returns>
public override string ToString() =>
$"#{Convert.ToString(RawValue, 16)}";
string.Format("#{0:X6}", RawValue);
private string DebuggerDisplay =>
$"#{Convert.ToString(RawValue, 16)} ({RawValue})";
string.Format("#{0:X6} ({0})", RawValue);
}
}

Loading…
Cancel
Save