mirror of
https://github.com/DarthAffe/HPPH.git
synced 2026-11-09 18:36:34 +00:00
Fixed some code issues
This commit is contained in:
1 parent
3ccb62538d
commit
9c67e49293
6 files changed
+10
-21
No files matched your search
@@ -1,14 +0,0 @@
|
||||
namespace HPPH.Reference;
|
||||
|
||||
internal static class HPPHExtensions
|
||||
{
|
||||
public static byte GetByteValueFromPercentage(this float percentage)
|
||||
{
|
||||
if (float.IsNaN(percentage) || (percentage < 0)) return 0;
|
||||
|
||||
return (byte)(percentage >= 1.0f ? 255 : percentage * 256.0f);
|
||||
}
|
||||
|
||||
public static float GetPercentageFromByteValue(this byte value)
|
||||
=> value == 255 ? 1.0f : (value / 256.0f);
|
||||
}
|
||||
Reference in new issue
Block a user