Fixed colorschemes

This commit is contained in:
Caleb Bassi 2018-02-21 11:15:53 -08:00
parent 88dbb6a453
commit 8531e40b09
5 changed files with 12 additions and 7 deletions

View File

@ -73,7 +73,7 @@ Feel free to add a new one. You can use 256 colors, bold, underline, and reverse
* CPU Usage
- support colors for more CPU cores
* themes
- solarized picture and theme
- solarized picture
- copy over vtop themes
* general
- command line option to set polling interval for CPU and mem

View File

@ -4,6 +4,7 @@ var DefaultCS = Colorscheme{
Name: "Default",
Author: "Caleb Bassi",
Fg: 7,
Bg: -1,
BorderLabel: 7,

View File

@ -20,6 +20,7 @@ type Colorscheme struct {
Name string
Author string
Fg int
Bg int
BorderLabel int
@ -36,6 +37,7 @@ type Colorscheme struct {
DiskBar int
// Temperature colors depending on if it's over a certain threshold
TempLow int
TempHigh int
}

View File

@ -118,10 +118,12 @@ func keyBinds() {
}
func termuiColors() {
ui.Theme.Fg = ui.Color(7)
ui.Theme.Fg = ui.Color(colorscheme.Fg)
ui.Theme.Bg = ui.Color(colorscheme.Bg)
ui.Theme.BorderBg = ui.Color(colorscheme.Bg)
ui.Theme.LabelFg = ui.Color(colorscheme.BorderLabel)
ui.Theme.LabelBg = ui.Color(colorscheme.Bg)
ui.Theme.BorderFg = ui.Color(colorscheme.BorderLine)
ui.Theme.BorderBg = ui.Color(colorscheme.Bg)
ui.Theme.TableCursor = ui.Color(colorscheme.ProcCursor)
ui.Theme.Sparkline = ui.Color(colorscheme.Sparkline)

View File

@ -29,13 +29,13 @@ func (bc *List) Buffer() *Buffer {
if y+1 > bc.Y {
break
}
bg := Theme.TempLow
fg := Theme.TempLow
if bc.Data[y] >= bc.Threshold {
bg = Theme.TempHigh
fg = Theme.TempHigh
}
r := MaxString(text, (bc.X - 4))
buf.SetString(1, y+1, r, Color(7), bc.Bg)
buf.SetString(bc.X-2, y+1, fmt.Sprintf("%dC", bc.Data[y]), bg, bc.Bg)
buf.SetString(1, y+1, r, Theme.Fg, bc.Bg)
buf.SetString(bc.X-2, y+1, fmt.Sprintf("%dC", bc.Data[y]), fg, bc.Bg)
}
return buf