nazacolor

package
v0.30.12 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SimplePrefixBlack  = "\033[22;30m" // 黑
	SimplePrefixRed    = "\033[22;31m" // 红
	SimplePrefixGreen  = "\033[22;32m" // 浅绿,亮绿
	SimplePrefixYellow = "\033[22;33m" // 黄
	SimplePrefixBlue   = "\033[22;34m" // 深蓝
	SimplePrefixCyan   = "\033[22;36m" // 青,暗绿
	SimplePrefixWhite  = "\033[22;37m" // 白

	SimpleSuffix = suffix
)

Variables

This section is empty.

Functions

func Wrap

func Wrap(v string, format Format, fg FgColor, bg BgColor) string

Wrap 分别设置样式,前景色(字体颜色),背景色

func WrapBlack

func WrapBlack(v string) string

WrapBlack 将前景色(字体颜色)设置为黑色

func WrapBlue

func WrapBlue(v string) string

func WrapCyan

func WrapCyan(v string) string

func WrapGreen

func WrapGreen(v string) string

func WrapRed

func WrapRed(v string) string

WrapRed 将前景色(字体颜色)设置为红色

func WrapWhite

func WrapWhite(v string) string

func WrapWithFgColor

func WrapWithFgColor(v string, fg FgColor) string

WrapWithFgColor 只设置前景色(字体颜色)

func WrapYellow

func WrapYellow(v string) string

Types

type BgColor

type BgColor int

BgColor 背景色

const (
	BgBlack  BgColor = 40
	BgRed    BgColor = 41
	BgGreen  BgColor = 42
	BgYellow BgColor = 43
	BgBlue   BgColor = 44
	BgCyan   BgColor = 46
	BgWhite  BgColor = 47
)

type FgColor

type FgColor int

FgColor 前景色(字体颜色)

const (
	FgBlack  FgColor = 30
	FgRed    FgColor = 31
	FgGreen  FgColor = 32
	FgYellow FgColor = 33
	FgBlue   FgColor = 34
	FgCyan   FgColor = 36
	FgWhite  FgColor = 37
)

type Format

type Format int

Format 格式

TODO(chef): 添加其他值:0(默认值)、1(高亮)、22(非粗体)、4(下划线)、24(非下划线)、 5(闪烁)、25(非闪烁)、7(反显)、27(非反显)

const (
	FormatNonBold Format = 22
)

Jump to

Keyboard shortcuts

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