1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-19 21:10:15 +02:00

Changed terminal16m to semicolons (#64)

Most terminals seems to use semicolons in true colors:
https://gist.github.com/XVilka/8346728
This commit is contained in:
hexasoftware 2017-10-17 02:04:12 -02:00 committed by Alec Thomas
parent 02c4adc066
commit 03b0c0d6bb

View File

@ -22,10 +22,10 @@ func trueColourFormatter(w io.Writer, style *chroma.Style, it chroma.Iterator) e
out += "\033[4m"
}
if entry.Colour.IsSet() {
out += fmt.Sprintf("\033[38:2:%d:%d:%dm", entry.Colour.Red(), entry.Colour.Green(), entry.Colour.Blue())
out += fmt.Sprintf("\033[38;2;%d;%d;%dm", entry.Colour.Red(), entry.Colour.Green(), entry.Colour.Blue())
}
if entry.Background.IsSet() {
out += fmt.Sprintf("\033[48:2:%d:%d:%dm", entry.Background.Red(), entry.Background.Green(), entry.Background.Blue())
out += fmt.Sprintf("\033[48;2;%d;%d;%dm", entry.Background.Red(), entry.Background.Green(), entry.Background.Blue())
}
fmt.Fprint(w, out)
}