Support custom colors for drawbox characters (#1251)

This commit is contained in:
Joe Lim authored and GitHub committed 2023-05-20 17:53:05 +03:00
1 parent 1be7d2689a
commit 3b942a8a39
8 files changed
+31 -1

No files matched your search

+8
View File
@@ -81,6 +81,14 @@ func parseStyles() styleMap {
return sm
}
func parseEscapeSequence(s string) tcell.Style {
s = strings.TrimPrefix(s, "\033[")
if i := strings.IndexByte(s, 'm'); i >= 0 {
s = s[:i]
}
return applyAnsiCodes(s, tcell.StyleDefault)
}
func applyAnsiCodes(s string, st tcell.Style) tcell.Style {
toks := strings.Split(s, ";")