Made ColorExtension functions internal

This commit is contained in:
miku-666
2023-05-13 18:54:02 +02:00
parent 9349b7d435
commit 7943b97459

View File

@@ -10,19 +10,19 @@ namespace PckStudio.Extensions
/// Normalizes the Color between 0.0 - 1.0
/// </summary>
/// <returns></returns>
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>(T value, T min, T max) where T : IComparable<T>
internal static T Clamp<T>(T value, T min, T max) where T : IComparable<T>
{
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,