mirror of https://github.com/bcicen/ctop.git
cpu color: check lower values first
this is simpler to understand and faster for usual containers
This commit is contained in:
parent
117c3bc7b5
commit
7632420ecc
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue