From f19125bedd046e0effec17114fdbac76ac549277 Mon Sep 17 00:00:00 2001 From: HiyashuChuka Date: Fri, 21 Dec 2018 14:48:31 +0900 Subject: [PATCH] Add SetColorFormat Sets --- output.go | 3 +++ output_vt100.go | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/output.go b/output.go index 42531b4..044d193 100644 --- a/output.go +++ b/output.go @@ -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) } diff --git a/output_vt100.go b/output_vt100.go index 81c5e12..fa0d898 100644 --- a/output_vt100.go +++ b/output_vt100.go @@ -243,6 +243,12 @@ func (w *VT100Writer) SetColor(fg, bg Color, bold bool) { return } +// 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