Removed equals-check in percentage->byte conversion

This commit is contained in:
DarthAffe committed 2019-02-24 11:50:49 +01:00
1 parent 2cb4bbdc83
commit e70c1c6bb0
1 file changed
+3 -3
+3 -3
View File
@@ -68,16 +68,16 @@ namespace RGB.NET.Core
return value;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static byte GetByteValueFromPercentage(this double percentage)
{
if (double.IsNaN(percentage)) return 0;
percentage = percentage.Clamp(0, 1.0);
return (byte)(percentage.Equals(1.0) ? 255 : percentage * 256.0);
return (byte)(percentage >= 1.0 ? 255 : percentage * 256.0);
}
#endregion
}
}