Skip to content

Commit

Permalink
feat: allow theme to set whether the foreground should be bold or not
Browse files Browse the repository at this point in the history
  • Loading branch information
justjanne committed Apr 21, 2022
1 parent 4d30cbe commit e952b09
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion powerline.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ func (p *powerline) color(prefix string, code uint8) string {
}

func (p *powerline) fgColor(code uint8) string {
return p.color("1;38", code)
if p.theme.BoldForeground {
return p.color("1;38", code)
} else {
return p.color("38", code)
}
}

func (p *powerline) bgColor(code uint8) string {
Expand Down
2 changes: 2 additions & 0 deletions themes.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type SymbolTemplate struct {

// Theme definitions
type Theme struct {
BoldForeground bool

Reset uint8

DefaultFg uint8
Expand Down
1 change: 1 addition & 0 deletions themes/default.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"BoldForeground": false,
"Reset": 255,
"UsernameFg": 250,
"UsernameBg": 240,
Expand Down

0 comments on commit e952b09

Please sign in to comment.