From 73377685b4fbd889937386edd8cbb46c1b8fb1b7 Mon Sep 17 00:00:00 2001 From: Anon Date: Wed, 17 Jun 2026 11:04:06 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20restore=20full=20color=20depth=20for=20h?= =?UTF-8?q?ex=20color=20codes=20(=C2=A7#RRGGBB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the dialog system PR (#3143), ResolveHexColors in ClassicConsoleBackend mapped every §#RRGGBB hex color to the nearest of 16 standard Minecraft colors via NearestMcColor. This meant all server-sent hex colors were downgraded to 4-bit ANSI regardless of the user's ConsoleColorMode setting. Replaced the nearest-color lookup with ColorHelper.GetColorEscapeCode, which generates the right output for each mode: 24-bit ANSI in vt100_24bit mode, 8-bit in vt100_8bit, 4-bit in vt100_4bit, ConsoleColor in legacy_4bit. Fixes #3146. --- MinecraftClient/ClassicConsoleBackend.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MinecraftClient/ClassicConsoleBackend.cs b/MinecraftClient/ClassicConsoleBackend.cs index c771d273..38411413 100644 --- a/MinecraftClient/ClassicConsoleBackend.cs +++ b/MinecraftClient/ClassicConsoleBackend.cs @@ -64,7 +64,7 @@ namespace MinecraftClient byte r = (byte)((HexVal(hex[0]) << 4) | HexVal(hex[1])); byte g = (byte)((HexVal(hex[2]) << 4) | HexVal(hex[3])); byte b = (byte)((HexVal(hex[4]) << 4) | HexVal(hex[5])); - return $"§{NearestMcColor(r, g, b)}"; + return ColorHelper.GetColorEscapeCode(r, g, b, foreground: true); }); }