Here's the script to color the text and to give bold, blinking, highlighting effect on ansi console.
import (
"fmt"
"github.com/mgutz/ansi"
)
color1Func := ansi.ColorFunc(fmt.Sprintf("%v+bh:%v", 181, 255))
color2Func := ansi.ColorFunc(fmt.Sprintf("%v+B:%v", 121, 255))
io.WriteString(os.Stdout, color1Func(text1))
io.WriteString(os.Stdout, color2Func(text2))
I tried to print italic font to style better console application, but couldn't find it anywhere for several days of struggling. Is this something that's not possible with ansi console?
Update:
This is what I did checked for mgutz/ansi
library
if strings.Contains(fgStyle, "b") {
buf.WriteString(bold)
}
if strings.Contains(fgStyle, "B") {
buf.WriteString(blink)
}
if strings.Contains(fgStyle, "u") {
buf.WriteString(underline)
}
if strings.Contains(fgStyle, "i") {
buf.WriteString(inverse)
}
if strings.Contains(fgStyle, "s") {
buf.WriteString(strikethrough)
}
if strings.Contains(fgStyle, "h") {
base = highIntensityFG
}
It has "i" but it's not italic.