fmtcolor

package
v0.0.0-...-29e02a0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blue

func Blue(template string, args ...interface{}) string

func BlueBg

func BlueBg(template string, args ...interface{}) string

func Green

func Green(template string, args ...interface{}) string

func GreenBg

func GreenBg(template string, args ...interface{}) string

func Red

func Red(template string, args ...interface{}) string

func RedBg

func RedBg(template string, args ...interface{}) string

func SetColor

func SetColor(str string, color FgColor, bg BgColor, extraArgs ...ExtFlg) string

str: text content color: font color bg: back color extraArgs: blink 闪烁; line/underline: 下划线; high/highligt 高亮; inverse/reverse 反色

func Warn

func Warn(template string, args ...interface{}) string

func Yellow

func Yellow(template string, args ...interface{}) string

func YellowBg

func YellowBg(template string, args ...interface{}) string

Types

type BgColor

type BgColor int
const (
	BG_Black BgColor = iota + 40
	BG_Red
	BG_Green
	BG_Yellow
	BG_Blue
	// 紫
	BG_Purple
	// 青
	BG_Cyan
	BG_White
	BG_NIL BgColor = 0
)

type ExtFlg

type ExtFlg string
const (
	EXT_NIL     ExtFlg = "0"
	EXT_HIGH    ExtFlg = "1"
	EXT_LINE    ExtFlg = "4"
	EXT_BLINK   ExtFlg = "5"
	EXT_REVERSE ExtFlg = "7"
	EXT_NOTSHOW ExtFlg = "8"
)

代码 意义 --------------

0  终端默认设置
1  高亮显示
4  使用下划线
5  闪烁
7  反白显示
8  不可见

type FgColor

type FgColor int
const (
	FC_Black FgColor = iota + 30
	FC_Red
	FC_Green
	FC_Yellow
	FC_Blue
	// 紫
	FC_Purple
	// 青
	FC_Cyan
	FC_White
)

前景 背景 颜色 ------------- 30 40 黑色 31 41 红色 32 42 绿色 33 43 黄色 34 44 蓝色 35 45 紫红色 36 46 青蓝色 37 47 白色

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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