This commit is contained in:
Deleted user 2021-03-06 02:19:18 +05:30 committed by GitHub
commit 8760a362b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -158,4 +158,7 @@ type ConsoleWriter interface {
// SetColor sets text and background colors. and specify whether text is bold.
SetColor(fg, bg Color, bold bool)
// SetColorFormat sets text and background colors. and format
SetColorFormat(fg, bg Color, format DisplayAttribute)
}

View File

@ -219,6 +219,12 @@ func (w *VT100Writer) SetColor(fg, bg Color, bold bool) {
}
}
// SetColorFormat sets text and background colors. and format
func (w *VT100Writer) SetColorFormat(fg, bg Color, format DisplayAttribute) {
w.SetDisplayAttributes(fg, bg, format)
return
}
// SetDisplayAttributes to set VT100 display attributes.
func (w *VT100Writer) SetDisplayAttributes(fg, bg Color, attrs ...DisplayAttribute) {
w.WriteRaw([]byte{0x1b, '['}) // control sequence introducer