- Fully support role colors and icons

- Fix #5
- Add SeString debugger window
This commit is contained in:
Infi
2024-04-09 15:58:53 +02:00
parent fed420901c
commit 5da271e0c2
10 changed files with 611 additions and 117 deletions
+9 -2
View File
@@ -12,8 +12,8 @@ internal static class ColourUtil {
}
internal static uint RgbaToAbgr(uint rgba) {
var (r, g, b, a) = RgbaToComponents(rgba);
return (uint) ((a << 24) | (b << 16) | (g << 8) | r);
var tmp = ((rgba << 8) & 0xFF00FF00) | ((rgba >> 8) & 0xFF00FF);
return (tmp << 16) | (tmp >> 16);
}
internal static Vector3 RgbaToVector3(uint rgba) {
@@ -38,6 +38,13 @@ internal static class ColourUtil {
));
}
public static unsafe uint ArgbToRgba(uint x)
{
var buf = (byte*)&x;
(buf[1], buf[2], buf[3], buf[0]) = (buf[0], buf[1], buf[2], buf[3]);
return x;
}
internal static uint ComponentsToRgba(byte red, byte green, byte blue, byte alpha = 0xFF) => alpha
| (uint) (red << 24)
| (uint) (green << 16)