color

package
v1.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Black

func Black() support.Printer

func Blue

func Blue() support.Printer

func CaptureOutput

func CaptureOutput(f func(w io.Writer)) string

CaptureOutput simulates capturing of os.stdout with a buffer and returns what was written to the screen

func Cyan

func Cyan() support.Printer

func Debugf

func Debugf(format string, a ...any)

func Debugln

func Debugln(a ...any)

func Default

func Default() support.Printer

func Errorf

func Errorf(format string, a ...any)

func Errorln

func Errorln(a ...any)

func Gray

func Gray() support.Printer

func Green

func Green() support.Printer

func Infof

func Infof(format string, a ...any)

func Infoln

func Infoln(a ...any)

func Magenta

func Magenta() support.Printer

func New

func New(color Color) support.Printer

New Functions to create Printer with specific color

func Red

func Red() support.Printer

func Successf

func Successf(format string, a ...any)

func Successln

func Successln(a ...any)

func Warnf

func Warnf(format string, a ...any)

func Warnln

func Warnln(a ...any)

func White

func White() support.Printer

func Yellow

func Yellow() support.Printer

Types

type Color

type Color uint8
const (
	FgBlack Color = iota + 30
	FgRed
	FgGreen
	FgYellow
	FgBlue
	FgMagenta
	FgCyan
	FgWhite
	// FgDefault revert default FG.
	FgDefault Color = 39
)
const (
	FgDarkGray Color = iota + 90
	FgLightRed
	FgLightGreen
	FgLightYellow
	FgLightBlue
	FgLightMagenta
	FgLightCyan
	FgLightWhite
	// FgGray is an alias of FgDarkGray.
	FgGray Color = 90
)

Extra foreground color 90 - 97.

func (Color) Print

func (c Color) Print(a ...any) *support.Printer

func (Color) Printf

func (c Color) Printf(format string, a ...any) *support.Printer

func (Color) Printfln

func (c Color) Printfln(format string, a ...any) *support.Printer

func (Color) Println

func (c Color) Println(a ...any) *support.Printer

func (Color) Sprint

func (c Color) Sprint(a ...interface{}) string

func (Color) Sprintf

func (c Color) Sprintf(format string, a ...interface{}) string

func (Color) Sprintfln

func (c Color) Sprintfln(format string, a ...interface{}) string

func (Color) Sprintln

func (c Color) Sprintln(a ...interface{}) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL