color

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute string

Attribute 控制台属性

const (
	Bold         Attribute = "1" // 粗体
	Italic       Attribute = "3" // 斜体
	Underline    Attribute = "4" // 下划线
	ReverseVideo Attribute = "7" // 反色
	CrossedOut   Attribute = "9" // 删除线
)
const (
	Black   Attribute = "30" // 黑色
	Red     Attribute = "31" // 红色
	Green   Attribute = "32" // 绿色
	Yellow  Attribute = "33" // 黄色
	Blue    Attribute = "34" // 蓝色
	Magenta Attribute = "35" // 紫色
	Cyan    Attribute = "36" // 青色
	White   Attribute = "37" // 白色
)
const (
	BgBlack   Attribute = "40" // 背景黑色
	BgRed     Attribute = "41" // 背景红色
	BgGreen   Attribute = "42" // 背景绿色
	BgYellow  Attribute = "43" // 背景黄色
	BgBlue    Attribute = "44" // 背景蓝色
	BgMagenta Attribute = "45" // 背景紫色
	BgCyan    Attribute = "46" // 背景青色
	BgWhite   Attribute = "47" // 背景白色
)

func (Attribute) Sprint

func (attr Attribute) Sprint(a ...interface{}) string

Sprint 返回根据控制台属性格式化后的字符串。

func (Attribute) Sprintf

func (attr Attribute) Sprintf(format string, a ...interface{}) string

Sprintf 返回根据控制台属性格式化后的字符串。

type Text

type Text struct {
	// contains filtered or unexported fields
}

Text 控制台属性组合

func NewText

func NewText(attributes ...Attribute) *Text

NewText 返回组合的控制台属性。

func (*Text) Sprint

func (c *Text) Sprint(a ...interface{}) string

Sprint 返回根据控制台属性格式化后的字符串。

func (*Text) Sprintf

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

Sprintf 返回根据控制台属性格式化后的字符串。

Jump to

Keyboard shortcuts

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