diff --git a/DiscordChatExporter.Domain/Exporting/Writers/JsonMessageWriter.cs b/DiscordChatExporter.Domain/Exporting/Writers/JsonMessageWriter.cs index a9f4e01..de67503 100644 --- a/DiscordChatExporter.Domain/Exporting/Writers/JsonMessageWriter.cs +++ b/DiscordChatExporter.Domain/Exporting/Writers/JsonMessageWriter.cs @@ -1,5 +1,4 @@ -using System.Drawing; -using System.IO; +using System.IO; using System.Text.Json; using System.Threading.Tasks; using DiscordChatExporter.Domain.Discord.Models; @@ -116,7 +115,7 @@ namespace DiscordChatExporter.Domain.Exporting.Writers _writer.WriteString("description", FormatMarkdown(embed.Description)); if (embed.Color != null) - _writer.WriteString("color", ColorTranslator.ToHtml(embed.Color.Value)); + _writer.WriteString("color", embed.Color.Value.ToHex()); if (embed.Author != null) await WriteEmbedAuthorAsync(embed.Author); diff --git a/DiscordChatExporter.Domain/Internal/Extensions/ColorExtensions.cs b/DiscordChatExporter.Domain/Internal/Extensions/ColorExtensions.cs index 53bd71d..c6ed05d 100644 --- a/DiscordChatExporter.Domain/Internal/Extensions/ColorExtensions.cs +++ b/DiscordChatExporter.Domain/Internal/Extensions/ColorExtensions.cs @@ -9,5 +9,7 @@ namespace DiscordChatExporter.Domain.Internal.Extensions public static Color ResetAlpha(this Color color) => color.WithAlpha(255); public static int ToRgb(this Color color) => color.ToArgb() & 0xffffff; + + public static string ToHex(this Color color) => $"#{color.R:X2}{color.G:X2}{color.B:X2}"; } } \ No newline at end of file