MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / StatusColor

Function StatusColor

internal/cli/format.go:28–47  ·  view source on GitHub ↗

StatusColor returns a *color.Color appropriate for the given status string.

(status string)

Source from the content-addressed store, hash-verified

26
27// StatusColor returns a *color.Color appropriate for the given status string.
28func 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.
50func PriorityColor(priority string) *color.Color {

Callers 4

statusCmdFunction · 0.92
ColorizedStatusFunction · 0.85
FormatFieldSummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected