color

package
v0.0.0-...-fe7d10f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// common
	Reset     = "\033[0m"
	Normal    = 0
	Bold      = 1
	Dim       = 2
	Underline = 4
	Blink     = 5
	Reverse   = 7
	Hidden    = 8

	// color
	Black       = 30
	Red         = 31
	Green       = 32
	Yellow      = 33
	Blue        = 34
	Purple      = 35
	Cyan        = 36
	LightGray   = 37
	DarkGray    = 90
	LightRed    = 91
	LightGreen  = 92
	LightYellow = 93
	LightBlue   = 94
	LightPurple = 95
	LightCyan   = 96
	White       = 97
	Success     = Green
	Error       = Red
	Warning     = Yellow
)

Variables

This section is empty.

Functions

func Color

func Color(c int, str string) string

返回带颜色的字符串 c为颜色代码,f为字体格式

func IsWindows

func IsWindows() bool

判断是否是windows系统

func Print

func Print(c int, format string, v ...interface{})

打印颜色到控制台

func Println

func Println(c int, format string, v ...interface{})

func Render

func Render(color int, txt string) string

render string to output

Types

This section is empty.

Jump to

Keyboard shortcuts

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