mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-17 06:11:53 +00:00
Made ColorExtension functions internal
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user