Skip to content

Commit

Permalink
Fix the color display in wezterm (#767)
Browse files Browse the repository at this point in the history
Fix color in wezterm

Signed-off-by: nullday <aseaday@hotmail.com>

Signed-off-by: nullday <aseaday@hotmail.com>
  • Loading branch information
aseaday authored Aug 12, 2022
1 parent 590b4c0 commit 542c7cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/metrics/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func NewNameCol(name string) *WidgetCol {
w := widgets.NewParagraph()
w.Text = name
w.Border = false
w.TextStyle.Fg = ui.ColorClear
return &WidgetCol{
widget: w,
Height: defaultRowHeight,
Expand All @@ -86,6 +87,7 @@ func NewCPUCol(metChan <-chan Metrics) *WidgetCol {
val := ms.CPUUtil
w.BarColor = colorScale(val)
w.Label = fmt.Sprintf("%d%%", val)
w.LabelStyle.Fg = ui.ColorClear
if val > 100 {
val = 100
}
Expand All @@ -108,6 +110,7 @@ func NewMEMCol(metChan <-chan Metrics) *WidgetCol {
ms := <-metChan
mPercent := ms.MemPercent
w.BarColor = colorScale(mPercent)
w.LabelStyle.Fg = ui.ColorClear
w.Label = fmt.Sprintf("%s / %s", cwidgets.ByteFormat64Short(ms.MemUsage), cwidgets.ByteFormat64Short(ms.MemLimit))
w.Percent = mPercent
}
Expand Down

0 comments on commit 542c7cb

Please sign in to comment.