From b9beca8449a10ba53807ecfc7d4b15cb6f14e82e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 6 Jan 2025 22:32:36 +0200 Subject: refactor colors a bit --- internal/colour/colour.go | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'internal/colour/colour.go') diff --git a/internal/colour/colour.go b/internal/colour/colour.go index b5f2681..5cefc58 100644 --- a/internal/colour/colour.go +++ b/internal/colour/colour.go @@ -7,14 +7,28 @@ import ( ) var ( - // infoCol = color.New(color.FgCyan, color.BgBlue, color.Bold) - Infof = func(format string, args ...any) { fmt.Printf(format, args...) } - Infoln = func(args ...any) { fmt.Println(args...) } + Infof = func(format string, args ...any) { + fmt.Printf(format, args...) + fmt.Print("\n") + } + Infoln = func(args ...any) { fmt.Println(args...) } + info2Col = color.New(color.FgHiYellow, color.BgBlue) - Info2f = info2Col.PrintfFunc() - SInfo2f = info2Col.SprintfFunc() - Ackf = color.New(color.FgBlack, color.BgHiYellow, color.Bold).PrintfFunc() - warnCol = color.New(color.FgHiWhite, color.BgRed) - Warnf = warnCol.PrintfFunc() - Successf = color.New(color.FgWhite, color.BgGreen).PrintfFunc() + Info2f = func(format string, args ...any) { + info2Col.Printf(format, args...) + fmt.Print("\n") + } + SInfo2f = info2Col.SprintfFunc() + + warnCol = color.New(color.FgHiWhite, color.BgRed) + Warnln = warnCol.PrintlnFunc() + + successCol = color.New(color.FgWhite, color.BgGreen) + Successf = func(format string, args ...any) { + successCol.Printf(format, args...) + fmt.Print("\n") + + } + + Ackf = color.New(color.FgBlack, color.BgHiYellow, color.Bold).PrintfFunc() ) -- cgit v1.2.3