Fixed some code issues

This commit is contained in:
DarthAffe committed 2024-07-06 19:50:47 +02:00
1 parent 3ccb62538d
commit 9c67e49293
6 files changed
+10 -21

No files matched your search

-14
View File
@@ -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);
}