mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
feat: add vector to bytecolor func
This commit is contained in:
parent
644380815f
commit
39ca25bbb2
1 changed files with 6 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using FFXIVClientStructs.FFXIV.Client.Graphics;
|
||||||
|
|
||||||
namespace Dalamud.Utility.Numerics;
|
namespace Dalamud.Utility.Numerics;
|
||||||
|
|
||||||
|
|
@ -53,4 +54,9 @@ public static class VectorExtensions
|
||||||
{
|
{
|
||||||
return new Vector2(v.X, y);
|
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) };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue