This commit is contained in:
TinyHerm committed 2026-11-24 23:40:08 +03:00
commit 1c7a8cf25f
579 files changed
+83196

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
using System;
namespace VibranceHud.Monitors;
public readonly record struct PanelRange(int Min, int Current, int Max)
{
public bool IsUsable
{
get
{
if (Max > Min && Current >= Min)
{
return Current <= Max;
}
return false;
}
}
public int FromPercent(int percent)
{
return Min + (int)Math.Round((double)((Max - Min) * Math.Clamp(percent, 0, 100)) / 100.0);
}
public int ToPercent(int raw)
{
if (Max <= Min)
{
return 0;
}
return Math.Clamp((int)Math.Round((double)(raw - Min) * 100.0 / (double)(Max - Min)), 0, 100);
}
}