Set default Pending color to calming darkorange

mine
Richard Whitehead 2020-05-23 21:09:13 -07:00
parent 9f9812b897
commit 237d97e6cb
2 changed files with 15 additions and 21 deletions

View File

@ -259,7 +259,7 @@ func newStatus() Status {
NewColor: "lightskyblue", NewColor: "lightskyblue",
ModifyColor: "greenyellow", ModifyColor: "greenyellow",
AddColor: "dodgerblue", AddColor: "dodgerblue",
PendingColor: "orangered", PendingColor: "darkorange",
ErrorColor: "orangered", ErrorColor: "orangered",
HighlightColor: "aqua", HighlightColor: "aqua",
KillColor: "mediumpurple", KillColor: "mediumpurple",

View File

@ -37,25 +37,6 @@ type ContainerWithMetrics interface {
// Container renders a K8s Container to screen. // Container renders a K8s Container to screen.
type Container struct{} type Container struct{}
// ColorGet returns a color for a state
func ColorGet(s string,ns string, h Header, re RowEvent) tcell.Color {
switch s {
case Pending:
return PendingColor
case ContainerCreating, PodInitializing:
return AddColor
case Terminating, Initialized:
return HighlightColor
case Completed:
return CompletedColor
case Running:
return DefaultColorer(ns, h, re)
default:
return ErrColor
}
}
// ColorerFunc colors a resource row. // ColorerFunc colors a resource row.
func (c Container) ColorerFunc() ColorerFunc { func (c Container) ColorerFunc() ColorerFunc {
return func(ns string, h Header, re RowEvent) tcell.Color { return func(ns string, h Header, re RowEvent) tcell.Color {
@ -67,7 +48,20 @@ func (c Container) ColorerFunc() ColorerFunc {
if stateCol == -1 { if stateCol == -1 {
return DefaultColorer(ns, h, re) return DefaultColorer(ns, h, re)
} }
return ColorGet(strings.TrimSpace(re.Row.Fields[stateCol]), ns, h, re) switch strings.TrimSpace(re.Row.Fields[stateCol]) {
case Pending:
return PendingColor
case ContainerCreating, PodInitializing:
return AddColor
case Terminating, Initialized:
return HighlightColor
case Completed:
return CompletedColor
case Running:
return DefaultColorer(ns, h, re)
default:
return ErrColor
}
} }
} }