ansi

package
Version: v0.0.0-...-b56184e Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sprintf

func Sprintf(ec EscapeCode, msg string) string

Sprintf wraps a message between a defined escape code and a reset escape code. It returns the stylized string.

Types

type EscapeCode

type EscapeCode string
const (
	Black   EscapeCode = "\u001b[30m"
	Red     EscapeCode = "\u001b[31m"
	Green   EscapeCode = "\u001b[32m"
	Yellow  EscapeCode = "\u001b[33m"
	Blue    EscapeCode = "\u001b[34m"
	Magenta EscapeCode = "\u001b[35m"
	Cyan    EscapeCode = "\u001b[36m"
	White   EscapeCode = "\u001b[37m"

	BrightBlack   EscapeCode = "\u001b[30;1m"
	BrightRed     EscapeCode = "\u001b[31;1m"
	BrightGreen   EscapeCode = "\u001b[32;1m"
	BrightYellow  EscapeCode = "\u001b[33;1m"
	BrightBlue    EscapeCode = "\u001b[34;1m"
	BrightMagenta EscapeCode = "\u001b[35;1m"
	BrightCyan    EscapeCode = "\u001b[36;1m"
	BrightWhite   EscapeCode = "\u001b[37;1m"

	Bold      EscapeCode = "\u001b[1m"
	Underline EscapeCode = "\u001b[4m"
	Reversed  EscapeCode = "\u001b[7m"

	ClearLine EscapeCode = "\u001b[2K\r"
	Reset     EscapeCode = "\u001b[0m"
)

func Combo

func Combo(codes ...EscapeCode) EscapeCode

Combo creates an larger escape code from smaller ones. It returns the combo escape code.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL