From e952b09f549cd5a2738fde2700748378d78be0a2 Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski Date: Thu, 21 Apr 2022 10:54:05 +0200 Subject: [PATCH] feat: allow theme to set whether the foreground should be bold or not --- powerline.go | 6 +++++- themes.go | 2 ++ themes/default.json | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/powerline.go b/powerline.go index ea65688f..638759ed 100644 --- a/powerline.go +++ b/powerline.go @@ -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 { diff --git a/themes.go b/themes.go index c2732ce9..f52c9891 100644 --- a/themes.go +++ b/themes.go @@ -27,6 +27,8 @@ type SymbolTemplate struct { // Theme definitions type Theme struct { + BoldForeground bool + Reset uint8 DefaultFg uint8 diff --git a/themes/default.json b/themes/default.json index 0615b6fd..f734707c 100644 --- a/themes/default.json +++ b/themes/default.json @@ -1,4 +1,5 @@ { + "BoldForeground": false, "Reset": 255, "UsernameFg": 250, "UsernameBg": 240,