feat: tanks data grid scale added

This commit is contained in:
Mikhail Shabanov committed 2021-07-15 13:57:09 +02:00
1 parent 8b2c0daa27
commit 3093b5ce38
3 files changed
+66 -23

No files matched your search

@@ -1,7 +1,14 @@
namespace WotBlitzStatisticsPro.Blazor.Helpers
using System;
namespace WotBlitzStatisticsPro.Blazor.Helpers
{
public static class ScaleHelper
{
public static string ScaleColor(this decimal winRate)
{
var intWinRate = Convert.ToInt32(winRate);
return intWinRate.ScaleColor();
}
public static string ScaleColor(this int winRate)
{
return winRate switch
@@ -17,5 +24,23 @@
_ => Constants.ScaleSuperUnicumColor
};
}
public static string Wn7ScaleColor(this double wn7)
{
return wn7 switch
{
( > 0 ) and ( < 500) => Constants.ScaleVeryBadColor,
( >= 500) and ( < 700) => Constants.ScaleBadColor,
( >= 700) and ( < 900) => Constants.ScaleBelowAverageColor,
( >= 900) and ( < 1100) => Constants.ScaleAverageColor,
( >= 1100) and ( < 1350) => Constants.ScaleGoodColor,
( >= 1350) and ( < 1550) => Constants.ScaleVeryGoodColor,
( >= 1550) and ( < 1850) => Constants.ScaleGreatColor,
( >= 1850) and ( < 2050) => Constants.ScaleUnicumColor,
_ => Constants.ScaleSuperUnicumColor
};
}
}
}