Reorganized extension methods class.

This commit is contained in:
Harrison Deng 2020-02-22 00:01:43 -05:00
parent 0a57bf3d14
commit 13108bd089

View File

@ -2,7 +2,7 @@ using System;
using OpenTK.Graphics;
using OpenTK;
namespace RecrownedGTK.Types {
public static class Color4Ext {
public static class Color4Extensions {
public static byte GetRedAsByte(this Color4 color) {
return (byte) (color.R * Byte.MaxValue);
}
@ -25,9 +25,13 @@ namespace RecrownedGTK.Types {
Color4 output = new Color4(color.R * val, color.G * val, color.B * val, color.A * val);
return output;
}
}
public static class Vector4Extensions {
public static void FromNonPremultiplied(ref Vector4 vector) {
//Premultiplied.
vector = new Vector4(vector.W * vector.X, vector.W * vector.Y, vector.W * vector.Z, vector.W);
}
}
}