MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / GetUsageColor

Function GetUsageColor

internal/ui/theme/theme.go:164–175  ·  view source on GitHub ↗

GetUsageColor returns the appropriate color for resource usage percentage.

(percentage float64)

Source from the content-addressed store, hash-verified

162
163// GetUsageColor returns the appropriate color for resource usage percentage.
164func GetUsageColor(percentage float64) tcell.Color {
165 switch {
166 case percentage < 50:
167 return Colors.UsageLow
168 case percentage < 75:
169 return Colors.UsageMedium
170 case percentage < 90:
171 return Colors.UsageHigh
172 default:
173 return Colors.UsageCritical
174 }
175}
176
177// IsDarkTheme returns true if the current terminal appears to be using a dark theme.
178// This is a simple heuristic based on the background color.

Callers 4

UpdateMethod · 0.92
UpdateMethod · 0.92
UpdateMethod · 0.92
populateTableMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected