diff --git a/PCK-Studio/Extensions/ColorExtensions.cs b/PCK-Studio/Extensions/ColorExtensions.cs index 075aa2fe..8f971123 100644 --- a/PCK-Studio/Extensions/ColorExtensions.cs +++ b/PCK-Studio/Extensions/ColorExtensions.cs @@ -10,19 +10,19 @@ namespace PckStudio.Extensions /// Normalizes the Color between 0.0 - 1.0 /// /// - public static Vector4 Normalize(this Color color) + internal static Vector4 Normalize(this Color color) { return new Vector4(color.R / 255f, color.G / 255f, color.B / 255f, color.A / 255f); } - public static T Clamp(T value, T min, T max) where T : IComparable + internal static T Clamp(T value, T min, T max) where T : IComparable { if (value.CompareTo(min) < 0) return min; if (value.CompareTo(max) > 0) return max; return value; } - public static byte BlendValues(float source, float overlay, BlendMode blendType) + internal static byte BlendValues(float source, float overlay, BlendMode blendType) { source = Clamp(source, 0.0f, 1.0f); overlay = Clamp(overlay, 0.0f, 1.0f); @@ -40,12 +40,13 @@ namespace PckStudio.Extensions return (byte)Clamp(resultValue * 255, 0, 255); } - public static byte Mix(double ratio, byte val1, byte val2) + internal static byte Mix(double ratio, byte val1, byte val2) { + ratio = Clamp(ratio, 0.0, 1.0); return (byte)(ratio * val1 + (1.0 - ratio) * val2); } - public static Color Mix(this Color c1, Color c2, double ratio) + internal static Color Mix(this Color c1, Color c2, double ratio) { ratio = Clamp(ratio, 0.0, 1.0); return Color.FromArgb(c1.A,