StatusColor returns a *color.Color appropriate for the given status string.
(status string)
| 26 | |
| 27 | // StatusColor returns a *color.Color appropriate for the given status string. |
| 28 | func StatusColor(status string) *color.Color { |
| 29 | s := strings.ToLower(strings.ReplaceAll(status, "_", "-")) |
| 30 | switch s { |
| 31 | case "done", "completed", "fixed", "implemented", "resolved", "accepted": |
| 32 | return color.New(color.FgGreen) |
| 33 | case "in-progress", "in_progress", "exploring", "fixing", "building", |
| 34 | "researching", "planning", "triaged", "in-sprint", "in_sprint", "paused": |
| 35 | return color.New(color.FgYellow) |
| 36 | case "open", "new", "draft", "todo", "planned", "proposed", "raw", "ready": |
| 37 | return color.New(color.FgBlue) |
| 38 | case "cancelled", "rejected", "wontfix": |
| 39 | return color.New(color.FgRed) |
| 40 | case "active", "published": |
| 41 | return color.New(color.FgCyan) |
| 42 | case "archived", "disabled": |
| 43 | return color.New(color.Faint) |
| 44 | default: |
| 45 | return color.New(color.Reset) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | // PriorityColor returns a *color.Color appropriate for the given priority string. |
| 50 | func PriorityColor(priority string) *color.Color { |
no outgoing calls
no test coverage detected