ColorOutput

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 4 Imported by: 1

README

ColorOutput

ColorOutput for linux

DEMO

ColorOutput.Colorful.Println("test")
ColorOutput.Colorful.WithFrontColor("green").Println("test")

Documentation

Overview

-- @Time : 2021/3/8 15:30 -- @Author : raoxiaoya -- @Desc :

Index

Constants

View Source
const (
	FrontBlack = iota + 30
	FrontRed
	FrontGreen
	FrontYellow
	FrontBlue
	FrontPurple
	FrontCyan
	FrontWhite
)
View Source
const (
	BackBlack = iota + 40
	BackRed
	BackGreen
	BackYellow
	BackBlue
	BackPurple
	BackCyan
	BackWhite
)
View Source
const (
	ModeDefault   = 0
	ModeHighLight = 1
	ModeLine      = 4
	ModeFlash     = 5
	ModeReWhite   = 6
	ModeHidden    = 7
)
View Source
const (
	CmdBlack  = 0
	CmdRed    = 4
	CmdGreen  = 2
	CmdYellow = 6
	CmdBlue   = 1
	CmdPurple = 5
	CmdCyan   = 3
	CmdWhite  = 7
)

Variables

View Source
var CmdPrint func(s interface{}, i int)

Functions

This section is empty.

Types

type ColorOutput

type ColorOutput struct {
	// contains filtered or unexported fields
}
var Colorful ColorOutput

func (ColorOutput) Println

func (c ColorOutput) Println(str interface{})

其中0x1B是标记,[开始定义颜色,依次为:模式,背景色,前景色,0代表恢复默认颜色。

func (ColorOutput) WithBackColor

func (c ColorOutput) WithBackColor(color string) ColorOutput

func (ColorOutput) WithFrontColor

func (c ColorOutput) WithFrontColor(color string) ColorOutput

func (ColorOutput) WithMode

func (c ColorOutput) WithMode(mode int) ColorOutput

Jump to

Keyboard shortcuts

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