mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 01:58:30 +00:00
Changed internal MathHelper-method to public
This commit is contained in:
parent
2a3c13ef87
commit
5a0d5ff104
@ -68,20 +68,16 @@ namespace RGB.NET.Core
|
|||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Internal
|
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
internal static byte GetByteValueFromPercentage(this double percentage)
|
public static byte GetByteValueFromPercentage(this double percentage)
|
||||||
{
|
{
|
||||||
if (double.IsNaN(percentage)) return 0;
|
if (double.IsNaN(percentage)) return 0;
|
||||||
|
|
||||||
percentage = percentage.Clamp(0, 1.0);
|
percentage = percentage.Clamp(0, 1.0);
|
||||||
return (byte)(percentage.Equals(1.0) ? 255 : percentage * 256.0);
|
return (byte)(percentage.Equals(1.0) ? 255 : percentage * 256.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user