mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
Removed unnecessary in GetByteValueFromPercentage
This commit is contained in:
parent
f21acbd767
commit
6f0711564c
@ -91,9 +91,8 @@ public static class FloatExtensions
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static byte GetByteValueFromPercentage(this float percentage)
|
||||
{
|
||||
if (float.IsNaN(percentage)) return 0;
|
||||
if (float.IsNaN(percentage) || (percentage <= 0)) return 0;
|
||||
|
||||
percentage = percentage.Clamp(0, 1.0f);
|
||||
return (byte)(percentage >= 1.0f ? 255 : percentage * 256.0f);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user