ansi

package
v0.0.0-...-ed9fe1d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package ansi supports ANSI color decorated functions for fmt package You can decorate output text with colors by replacing fmt.Print function with ansi.{ColorName}.Print

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code int

Code implements ANSI code support for fmt.Print, fmt.FPrint, and fmt.Sprint functions.

const (
	Reset Code = iota
	Bold
	Faint
	Italic
	Underline
	BlinkSlow
	BlinkRapid
	ReverseVideo
	Concealed
	CrossedOut
)

Available ANSI decorators

const (
	Black Code = 30 + iota
	Red
	Green
	Yellow
	Blue
	Megenta
	Cyan
	White
)

Available ANSI Color

const (
	BgBlack Code = iota + 40
	BgRed
	BgGreen
	BgYellow
	BgBlue
	BgMegenta
	BgCyan
	BgWhite
)

Available ANSI Background Color

func (Code) FPrint

func (i Code) FPrint(w io.Writer, a ...interface{})

FPrint outputs the decorated string with `fmt.FPrint(io.Writer, ...interface{})`

func (Code) FPrintf

func (i Code) FPrintf(w io.Writer, s string, a ...interface{})

FPrintf outputs the decorated string with `fmt.Printf(string, ...interface{})`

func (Code) FPrintln

func (i Code) FPrintln(w io.Writer, a ...interface{})

FPrintln outputs the decorated string with `fmt.Println(...interface{})`

func (Code) Print

func (i Code) Print(a ...interface{})

Print outputs the decorated string with `fmt.Print(...interface{})`

func (Code) Printf

func (i Code) Printf(s string, a ...interface{})

Printf outputs the decorated string with `fmt.Printf(string, ...interface{})`

func (Code) Println

func (i Code) Println(a ...interface{})

Println outputs the decorated string with `fmt.Println(...interface{})`

func (Code) Sprint

func (i Code) Sprint(a ...interface{}) string

Sprint returns the decorated string with `fmt.Sprint(...interface{})`

func (Code) Sprintf

func (i Code) Sprintf(s string, a ...interface{}) string

Sprintf returns the decorated string with `fmt.Sprint(string, ...interface{})`

func (Code) Sprintln

func (i Code) Sprintln(s string, a ...interface{}) string

Sprintln returns the decorated string with `fmt.Sprint(...interface{})`

Jump to

Keyboard shortcuts

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