- Fully support role colors and icons
- Fix #5 - Add SeString debugger window
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user