Refactored before merge

This commit is contained in:
DarthAffe committed 2015-10-09 21:36:12 +02:00
1 parent b977edf1da
commit 920821deee
14 files changed
+61 -35

No files matched your search

+3
View File
@@ -36,6 +36,7 @@ namespace CUE.NET.Helper
private static byte GetIntColorFromFloat(float f)
{
// ReSharper disable once RedundantCast - never trust this ...
float calcF = (float)Math.Max(0f, Math.Min(1f, f));
return (byte)(calcF.Equals(1f) ? 255 : calcF * 256f);
}
@@ -69,7 +70,9 @@ namespace CUE.NET.Helper
int max = Math.Max(color.R, Math.Max(color.G, color.B));
int min = Math.Min(color.R, Math.Min(color.G, color.B));
// ReSharper disable RedundantCast - never trust this ...
return (max == 0) ? 0 : 1f - ((float)min / (float)max);
// ReSharper restore RedundantCast
}
public static float GetHSVValue(this Color color)