GetUsageColor returns the appropriate color for resource usage percentage.
(percentage float64)
| 162 | |
| 163 | // GetUsageColor returns the appropriate color for resource usage percentage. |
| 164 | func 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. |
no outgoing calls
no test coverage detected