cpu color: check lower values first

this is simpler to understand and faster for usual containers
This commit is contained in:
Sergey Ponomarev 2020-11-24 00:22:25 +02:00
parent 117c3bc7b5
commit 7632420ecc
1 changed files with 4 additions and 4 deletions

View File

@ -100,11 +100,11 @@ func (w *GaugeCol) UnHighlight() {
}
func colorScale(n int) ui.Attribute {
if n > 70 {
return ui.ThemeAttr("status.danger")
if n <= 30 {
return ui.ThemeAttr("status.ok")
}
if n > 30 {
if n <= 70 {
return ui.ThemeAttr("status.warn")
}
return ui.ThemeAttr("status.ok")
return ui.ThemeAttr("status.danger")
}