PriorityColor returns a *color.Color appropriate for the given priority string.
(priority string)
| 48 | |
| 49 | // PriorityColor returns a *color.Color appropriate for the given priority string. |
| 50 | func PriorityColor(priority string) *color.Color { |
| 51 | switch strings.ToLower(priority) { |
| 52 | case "critical", "urgent": |
| 53 | return color.New(color.FgRed, color.Bold) |
| 54 | case "high": |
| 55 | return color.New(color.FgYellow) |
| 56 | case "medium": |
| 57 | return color.New(color.FgWhite) |
| 58 | case "low": |
| 59 | return color.New(color.Faint) |
| 60 | default: |
| 61 | return color.New(color.Reset) |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | // ColorizedStatus returns a status icon + status text with appropriate color. |
| 66 | func ColorizedStatus(status string) string { |
no outgoing calls
no test coverage detected