mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Colour percentages the right way round.
This commit is contained in:
parent
f61c6ae212
commit
86ebd2fed4
@ -131,6 +131,6 @@ export function lerpColor(color1, color2, weight) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function formatPercent(percent, digits=0) {
|
export function formatPercent(percent, digits=0) {
|
||||||
let color = lerpGreenToRedViaOrange(percent, 100);
|
let color = lerpGreenToRedViaOrange(100-Math.min(100,percent), 100);
|
||||||
return "<span style='color: " + color + "'>" + percent.toFixed(digits) + "%</span>";
|
return "<span style='color: " + color + "'>" + percent.toFixed(digits) + "%</span>";
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user