diff options
| author | Paul Buetow <paul@buetow.org> | 2021-08-09 10:33:57 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-08-09 10:33:57 +0300 |
| commit | 4a1fbb7ed3143e38e10884955839a87966c3255e (patch) | |
| tree | 5769bd26e1c6c4b8b6a93e2512f4ed742729a13d /internal | |
| parent | eefb05ae411edef4de293099c5f6611a2ec7e9fb (diff) | |
change paint API
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/color/color.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/color/color.go b/internal/color/color.go index c6760d5..52a5752 100644 --- a/internal/color/color.go +++ b/internal/color/color.go @@ -61,27 +61,27 @@ const ( var Colored bool // Paint paints a given text in a given foreground/background color combination. -func Paint(fg FgColor, bg FgColor, text string) string { +func Paint(text string, fg FgColor, bg FgColor) string { return fmt.Sprintf(seq, fg, bg, text, BgDefault, FgDefault) } // PaintWithAttr paints a given text in a given foreground/background/attribute combination -func PaintWithAtt(fg FgColor, bg FgColor, att Attribute, text string) string { +func PaintWithAtt(text string, fg FgColor, bg FgColor, att Attribute) string { return fmt.Sprintf(seq, fg, bg, att, text, AttReset, BgDefault, FgDefault) } // PaintFg paints a given text in a given foreground color. -func PaintFg(fg FgColor, text string) string { +func PaintFg(text string, fg FgColor) string { return fmt.Sprintf(seq, fg, text, FgDefault) } // PaintBg paints a given text in a given background color. -func PaintBg(bg BgColor, text string) string { +func PaintBg(text string, bg BgColor) string { return fmt.Sprintf(seq, bg, text, BgDefault) } // PaintAtt adds a given attribute to a given text, such as "bold" or "italic". -func PaintAtt(att Attribute, text string) string { +func PaintAtt(text string, att Attribute) string { return fmt.Sprintf(seq, att, text, AttReset) } |
