color

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 0 Imported by: 0

Documentation

Overview

Package color formats colored terminal output.

Index

Constants

View Source
const (
	Reset      = "\x1b[0m"  // Reset terminal color.
	Bright     = "\x1b[1m"  // Set bright display.
	Dim        = "\x1b[2m"  // ??.
	Underscore = "\x1b[4m"  // Underline format.
	Blink      = "\x1b[5m"  // Blinking text.
	Reverse    = "\x1b[7m"  // Reverse fg and bg colors.
	Hidden     = "\x1b[8m"  // Hide text.
	FgBlack    = "\x1b[30m" // Foreground black.
	FgRed      = "\x1b[31m" // Foreground Red.
	FgGreen    = "\x1b[32m" // Foreground Green.
	FgYellow   = "\x1b[33m" // Foreground Yellow.
	FgBlue     = "\x1b[34m" // Foreground Blue.
	FgMagenta  = "\x1b[35m" // Foreground Magenta.
	FgCyan     = "\x1b[36m" // Foreground Cyan.
	FgWhite    = "\x1b[37m" // Foreground White.
	BgBlack    = "\x1b[40m" // Background Black.
	BgRed      = "\x1b[41m" // Background Red.
	BgGreen    = "\x1b[42m" // Background Green.
	BgYellow   = "\x1b[43m" // Background Yellow.
	BgBlue     = "\x1b[44m" // Background Blue.
	BgMagenta  = "\x1b[45m" // Background Magenta.
	BgCyan     = "\x1b[46m" // Background Cyan.
	BgWhite    = "\x1b[47m" // Background White.
)

Terminal colors.

Variables

This section is empty.

Functions

func Colored

func Colored(msg, col string) string

Colored returns a colored message if any.

func Green

func Green(msg string) string

Green formatting of text.

func Magenta

func Magenta(msg string) string

Magenta formatting of text.

func Red

func Red(msg string) string

Red formatting of text.

func TxtBright

func TxtBright(msg string) string

TxtBright formatting of text.

func Yellow

func Yellow(msg string) string

Yellow formatting of text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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