color

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LightRed can format text to be displayed to the terminal in light red, using ANSI escape codes.
	LightRed = Color(91)
	// LightGreen can format text to be displayed to the terminal in light green, using ANSI escape codes.
	LightGreen = Color(92)
	// LightYellow can format text to be displayed to the terminal in light yellow, using ANSI escape codes.
	LightYellow = Color(93)
	// LightBlue can format text to be displayed to the terminal in light blue, using ANSI escape codes.
	LightBlue = Color(94)
	// LightPurple can format text to be displayed to the terminal in light purple, using ANSI escape codes.
	LightPurple = Color(95)
	// Red can format text to be displayed to the terminal in red, using ANSI escape codes.
	Red = Color(31)
	// Green can format text to be displayed to the terminal in green, using ANSI escape codes.
	Green = Color(32)
	// Yellow can format text to be displayed to the terminal in yellow, using ANSI escape codes.
	Yellow = Color(33)
	// Blue can format text to be displayed to the terminal in blue, using ANSI escape codes.
	Blue = Color(34)
	// Purple can format text to be displayed to the terminal in purple, using ANSI escape codes.
	Purple = Color(35)
	// Cyan can format text to be displayed to the terminal in cyan, using ANSI escape codes.
	Cyan = Color(36)
	// None uses ANSI escape codes to reset all formatting.
	None = Color(0)

	// Default default output color for output from Skaffold to the user
	Default = Blue
)
View Source
var IsTerminal = isTerminal

IsTerminal will check if the specified output stream is a terminal. This can be changed for testing to an arbitrary method.

Functions

This section is empty.

Types

type Color

type Color int

Color can be used to format text using ANSI escape codes so it can be printed to the terminal in color.

func (Color) Fprint

func (c Color) Fprint(out io.Writer, a ...interface{}) (n int, err error)

Fprint wraps the operands in c's ANSI escape codes, and outputs the result to out. If out is not a terminal, the escape codes will not be added. It returns the number of bytes written and any errors encountered.

func (Color) Fprintf

func (c Color) Fprintf(out io.Writer, format string, a ...interface{}) (n int, err error)

Fprintf applies formats according to the format specifier (and the optional interfaces provided), wraps the result in c's ANSI escape codes, and outputs the result to out, followed by a newline. If out is not a terminal, the escape codes will not be added. It returns the number of bytes written and any errors encountered.

func (Color) Fprintln

func (c Color) Fprintln(out io.Writer, a ...interface{}) (n int, err error)

Fprintln wraps the operands in c's ANSI escape codes, and outputs the result to out, followed by a newline. If out is not a terminal, the escape codes will not be added. It returns the number of bytes written and any errors encountered.

Jump to

Keyboard shortcuts

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