color

package
v0.0.0-...-03b1570 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithColor

func WithColor(text string, colour Color) string

WithColor returns a string with the given color applied.

func WithColorPadding

func WithColorPadding(text string, colour Color) string

WithColorPadding returns a string with the given color applied with leading and trailing spaces.

Types

type Color

type Color uint32
const (
	// NoColor is no color for both foreground and background.
	NoColor Color = iota
	// FgBlack is the foreground color black.
	FgBlack
	// FgRed is the foreground color red.
	FgRed
	// FgGreen is the foreground color green.
	FgGreen
	// FgYellow is the foreground color yellow.
	FgYellow
	// FgBlue is the foreground color blue.
	FgBlue
	// FgMagenta is the foreground color magenta.
	FgMagenta
	// FgCyan is the foreground color cyan.
	FgCyan
	// FgWhite is the foreground color white.
	FgWhite

	// BgBlack is the background color black.
	BgBlack
	// BgRed is the background color red.
	BgRed
	// BgGreen is the background color green.
	BgGreen
	// BgYellow is the background color yellow.
	BgYellow
	// BgBlue is the background color blue.
	BgBlue
	// BgMagenta is the background color magenta.
	BgMagenta
	// BgCyan is the background color cyan.
	BgCyan
	// BgWhite is the background color white.
	BgWhite
)

Jump to

Keyboard shortcuts

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