diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-05-31 16:46:54 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-06-03 01:46:03 +0900 |
commit | fdbfe36c0b882a4e948fafd1949956341607b1e5 (patch) | |
tree | cda8cbb826626ca84a1f7b460a68ce02e4093959 /src/item.go | |
parent | 446e8227236c4d15bb17e80db797d1799b05521b (diff) |
Color customization (#245)
Diffstat (limited to 'src/item.go')
-rw-r--r-- | src/item.go | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/item.go b/src/item.go index 711adbe2..7c2f94d5 100644 --- a/src/item.go +++ b/src/item.go @@ -143,13 +143,25 @@ func (item *Item) colorOffsets(color int, bold bool, current bool) []colorOffset offset: Offset{int32(start), int32(idx)}, color: color, bold: bold}) } else { ansi := item.colors[curr-1] + fg := ansi.color.fg + if fg == -1 { + if current { + fg = curses.CurrentFG + } else { + fg = curses.FG + } + } bg := ansi.color.bg - if current && bg == -1 { - bg = int(curses.DarkBG) + if bg == -1 { + if current { + bg = curses.DarkBG + } else { + bg = curses.BG + } } offsets = append(offsets, colorOffset{ offset: Offset{int32(start), int32(idx)}, - color: curses.PairFor(ansi.color.fg, bg), + color: curses.PairFor(fg, bg), bold: ansi.color.bold || bold}) } } |