Merge f19125bedd046e0effec17114fdbac76ac549277 into 82a912274504477990ecf7c852eebb7c85291772

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

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

@ -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. // SetDisplayAttributes to set VT100 display attributes.
func (w *VT100Writer) SetDisplayAttributes(fg, bg Color, attrs ...DisplayAttribute) { func (w *VT100Writer) SetDisplayAttributes(fg, bg Color, attrs ...DisplayAttribute) {
w.WriteRaw([]byte{0x1b, '['}) // control sequence introducer w.WriteRaw([]byte{0x1b, '['}) // control sequence introducer