color

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 前景色
	Black     = ForegroundColor(30)
	Red       = ForegroundColor(31)
	Green     = ForegroundColor(32)
	Yellow    = ForegroundColor(33)
	Blue      = ForegroundColor(34)
	Purple    = ForegroundColor(35)
	DarkGreen = ForegroundColor(36)
	White     = ForegroundColor(37)
	// 背景色
	BlackBGColor     = BackgroundColor(40)
	RedBGColor       = BackgroundColor(41)
	GreenBGColor     = BackgroundColor(42)
	YellowBGColor    = BackgroundColor(43)
	BlueBGColor      = BackgroundColor(44)
	PurpleBGColor    = BackgroundColor(45)
	DarkGreenBGColor = BackgroundColor(46)
	WhiteBGColor     = BackgroundColor(47)
	// 0:默认模式,无特殊效果
	DEFAULT = Mode(0)
	// 1:粗体模式
	BOLD = Mode(1)
	// 2:淡化模式
	FAINT = Mode(2)
	// 3:斜体模式
	ITALIC = Mode(3)
	// 4:下划线模式
	UNDERLINE = Mode(4)
	// 5:闪烁模式
	BLINK = Mode(5)
	// 7:反显模式
	REVERSE = Mode(6)
	// 8:隐藏模式
	HIDDEN = Mode(7)
)

Functions

func ErrorString

func ErrorString(str string) string

func InfoString

func InfoString(str string) string

func Println

func Println(str string, color Color)

func PrintlnError

func PrintlnError(str string)

func PrintlnInfo

func PrintlnInfo(str string)

func PrintlnWarn

func PrintlnWarn(str string)

func String

func String(str string, color Color) string

func WarnString

func WarnString(str string) string

Types

type BackgroundColor

type BackgroundColor int

type Color

type Color struct {
	ForegroundColor ForegroundColor
	BackgroundColor BackgroundColor
	Mode            Mode
}

type ForegroundColor

type ForegroundColor int

type Mode

type Mode int

Jump to

Keyboard shortcuts

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