diff --git a/HellionChat/Util/ColourUtil.cs b/HellionChat/Util/ColourUtil.cs index d888e09..7d01903 100755 --- a/HellionChat/Util/ColourUtil.cs +++ b/HellionChat/Util/ColourUtil.cs @@ -66,8 +66,23 @@ internal static class ColourUtil ); } + // --------------------------------------------------------------- + // Cherry-picked from ChatTwo upstream a51789b + 5b58513 (Infiziert90, + // 2026-06-12). Both guards belong together -- a51789b alone turns a zero + // colour into opaque black, which then slips past the invisible-text + // guard in ChunkUtil and paints over the inherited colour. + // TEST-MIRROR: ../../../Hellion Build test/Util/ColourUtilTests.cs + // --------------------------------------------------------------- public static unsafe uint ArgbToRgba(uint x) { + if (x == 0) + return 0; + + // The game omits the alpha byte on some GlobalValue colours, and the + // swap below would leave alpha at 0 -- invisible text. + if (x <= 0x00FFFFFFu) + x |= 0xFF000000u; + var buf = (byte*)&x; (buf[1], buf[2], buf[3], buf[0]) = (buf[0], buf[1], buf[2], buf[3]); return x;