Fix UDA colors
This commit is contained in:
@ -29,6 +29,8 @@ type Styles struct {
|
||||
ColumnBlurred lipgloss.Style
|
||||
ColumnInsert lipgloss.Style
|
||||
|
||||
Colors map[string]lipgloss.Style
|
||||
|
||||
// TODO: make color config completely dynamic to account for keyword., project., tag. and uda. colors
|
||||
Active lipgloss.Style
|
||||
Alternate lipgloss.Style
|
||||
@ -114,10 +116,12 @@ func NewStyles(config *taskwarrior.TWConfig) *Styles {
|
||||
|
||||
func parseColors(config map[string]string) *Styles {
|
||||
styles := Styles{}
|
||||
colors := make(map[string]lipgloss.Style)
|
||||
|
||||
for key, value := range config {
|
||||
if strings.HasPrefix(key, "color.") {
|
||||
_, colorValue, _ := strings.Cut(key, ".")
|
||||
colors[colorValue] = parseColorString(value)
|
||||
switch colorValue {
|
||||
case "active":
|
||||
styles.Active = parseColorString(value)
|
||||
@ -217,6 +221,8 @@ func parseColors(config map[string]string) *Styles {
|
||||
}
|
||||
}
|
||||
|
||||
styles.Colors = colors
|
||||
|
||||
return &styles
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user