color

package
v0.0.0-...-d194529 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Black = colorFgBgPair{
		Fg: clr.New(clr.FgBlack),
		Bg: clr.New(clr.BgBlack),
	}

	Red = colorFgBgPair{
		Fg: clr.New(clr.FgRed),
		Bg: clr.New(clr.BgRed),
	}

	Green = colorFgBgPair{
		Fg: clr.New(clr.FgGreen),
		Bg: clr.New(clr.BgGreen),
	}

	Yellow = colorFgBgPair{
		Fg: clr.New(clr.FgYellow),
		Bg: clr.New(clr.BgYellow),
	}

	Blue = colorFgBgPair{
		Fg: clr.New(clr.FgBlue),
		Bg: clr.New(clr.BgBlue),
	}

	Magenta = colorFgBgPair{
		Fg: clr.New(clr.FgMagenta),
		Bg: clr.New(clr.BgMagenta),
	}

	Cyan = colorFgBgPair{
		Fg: clr.New(clr.FgCyan),
		Bg: clr.New(clr.BgCyan),
	}

	White = colorFgBgPair{
		Fg: clr.New(clr.FgWhite),
		Bg: clr.New(clr.BgWhite),
	}
)

Structure Definitions

Functions

This section is empty.

Types

type Color

type Color struct {
	Name      string
	ColorPair colorFgBgPair
}

func New

func New(colorPair colorFgBgPair) Color

func (*Color) MakeBold

func (color *Color) MakeBold()

func (Color) Print

func (color Color) Print(text string, mode string)

func (Color) Printf

func (color Color) Printf(text string, mode string, a ...interface{})

func (Color) Println

func (color Color) Println(text string, mode string)

func (Color) Sprint

func (color Color) Sprint(text string, mode string) string

func (Color) Sprintf

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

type IColor

type IColor interface {
	Print(text string, mode string)
	Println(text string, mode string)
	Sprint(text string, mode string) string
	FromName(name string) interface{}
}

Interface Definitions

Jump to

Keyboard shortcuts

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