termcolor

package
v0.0.0-...-21611da Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2014 License: BSD-3-Clause, BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

ANSI Color formatting

Based partly on http://pypi.python.org/pypi/termcolor

Examples

log.Println(termcolor.Colored("My string", termcolor.Red, termcolor.Bold))
log.Println(termcolor.ColoredWithBackground("My string", termcolor.Green, termcolor.BgWhite, termcolor.Underline))

Index

Constants

View Source
const Reset = "\033[0m"

Variables

View Source
var (
	Bold      Attribute = 1
	Dark      Attribute = 2
	Reverse   Attribute = 7
	Underline Attribute = 4

	Blue    Color = 34
	Cyan    Color = 36
	Green   Color = 32
	Grey    Color = 30
	Magenta Color = 35
	Red     Color = 31
	White   Color = 37
	Yellow  Color = 33

	BgBlue    Background = 44
	BgCyan    Background = 46
	BgGreen   Background = 42
	BgGrey    Background = 40
	BgMagenta Background = 45
	BgRed     Background = 41
	BgWhite   Background = 47
	BgYellow  Background = 43
)

Functions

func Colored

func Colored(text string, color Color, attributes ...Attribute) string

func ColoredWithBackground

func ColoredWithBackground(text string, color Color, background Background, attributes ...Attribute) (ret string)

Types

type Attribute

type Attribute int

type Background

type Background int

type Color

type Color int

Jump to

Keyboard shortcuts

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