color

package
v0.49.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IfTrueCyan added in v0.10.0

func IfTrueCyan(condition bool, a ...interface{}) string

func IfTrueGreen added in v0.10.0

func IfTrueGreen(condition bool, a ...interface{}) string

func IfTrueMagenta added in v0.10.0

func IfTrueMagenta(condition bool, a ...interface{}) string

func IfTrueRed added in v0.10.0

func IfTrueRed(condition bool, a ...interface{}) string

func IfTrueYellow added in v0.10.0

func IfTrueYellow(condition bool, a ...interface{}) string

func Is256ColorSupported added in v0.13.0

func Is256ColorSupported() bool

Types

type Func added in v0.42.1

type Func func(a ...interface{}) string

Func - color function type

var (
	// Bold returns a bold string
	Bold Func = color.New(color.Bold).SprintFunc()
	// Red returns a red-colored string
	Red Func = color.New(color.FgRed).SprintFunc()
	// Green returns a green-colored string
	Green Func = color.New(color.FgGreen).SprintFunc()
	// Yellow returns a yellow-colored string
	Yellow Func = color.New(color.FgYellow).SprintFunc()
	// Magenta returns a purple-colored string
	Magenta Func = color.New(color.FgMagenta).SprintFunc()
	// Cyan returns a cyan-colored string
	Cyan Func = color.New(color.FgCyan).SprintFunc()
	// Underline returns an underline string
	Underline Func = color.New(color.Underline).SprintFunc()
	// Grey returns a dark grey-colored string
	Grey Func = color.New(color.FgHiBlack).SprintFunc()

	// Background colored string
	BgYellow  Func = color.New(color.BgYellow).SprintFunc()
	BgMagenta Func = color.New(color.BgMagenta).SprintFunc()
	BgRed     Func = color.New(color.BgRed).SprintFunc()
)

Jump to

Keyboard shortcuts

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