feat: add vector to bytecolor func

This commit is contained in:
kalilistic 2023-02-26 14:03:02 -05:00
parent 644380815f
commit 39ca25bbb2

View file

@ -1,5 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using FFXIVClientStructs.FFXIV.Client.Graphics;
namespace Dalamud.Utility.Numerics;
@ -53,4 +54,9 @@ public static class VectorExtensions
{
return new Vector2(v.X, y);
}
public static ByteColor ToByteColor(this Vector4 value)
{
return new ByteColor { A = (byte)(value.W * 255), R = (byte)(value.X * 255), G = (byte)(value.Y * 255), B = (byte)(value.Z * 255) };
}
}