Files
pmg/internal/ui/colors.go
T
Abhisek DattaandGitHub 6a3821d44a chore: Improve console error experience (#124)
* chore: Improve console error experience

* fix: Use standard error code and handle verbosity
2026-01-17 14:05:01 +05:30

28 lines
752 B
Go

package ui
import "github.com/fatih/color"
type ColorFn func(format string, a ...interface{}) string
type TerminalColors struct {
Normal ColorFn
Red ColorFn
Yellow ColorFn
Cyan ColorFn
Green ColorFn
Bold ColorFn
Dim ColorFn
ErrorCode ColorFn
}
var Colors = TerminalColors{
Normal: color.New().SprintfFunc(),
Red: color.New(color.FgRed, color.Bold).SprintfFunc(),
Yellow: color.New(color.FgYellow).SprintfFunc(),
Cyan: color.New(color.FgCyan).SprintfFunc(),
Green: color.New(color.FgGreen).SprintfFunc(),
Bold: color.New(color.Bold).SprintfFunc(),
Dim: color.New(color.Faint).SprintfFunc(),
ErrorCode: color.New(color.BgRed, color.FgBlack, color.Bold).SprintfFunc(),
}