mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
fix: restore full color depth for hex color codes (§#RRGGBB)
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.
This commit is contained in:
parent
31876d485a
commit
73377685b4
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue