term

package
v0.0.0-...-2c87074 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Unlicense Imports: 4 Imported by: 52

Documentation

Overview

Package term implements colored output and size measurements for terminals.

Index

Constants

View Source
const (
	Default   = "0"
	Bold      = "1"
	Dim       = "2"
	Underline = "4"
	Inverse   = "7"
	Hidden    = "8"
	Strikeout = "9"
)

Style codes.

View Source
const (
	FgBlack   = "30"
	FgRed     = "31"
	FgGreen   = "32"
	FgYellow  = "33"
	FgBlue    = "34"
	FgMagenta = "35"
	FgCyan    = "36"
	FgWhite   = "37"
)

Foreground color codes.

View Source
const (
	BgBlack   = "40"
	BgRed     = "41"
	BgGreen   = "42"
	BgYellow  = "43"
	BgBlue    = "44"
	BgMagenta = "45"
	BgCyan    = "46"
	BgWhite   = "47"
)

Background color codes.

Variables

This section is empty.

Functions

func Blue

func Blue(text string) string

Blue returns a blue text on a black background.

func BlueBold

func BlueBold(text string) string

BlueBold returns a bold blue text on a black background.

func Color

func Color(text string, colors ...string) string

Color returns a colored text based on the specified style and color codes.

func Cyan

func Cyan(text string) string

Cyan returns a cyan text on a black background.

func CyanBold

func CyanBold(text string) string

CyanBold returns a bold cyan text on a black background.

func Green

func Green(text string) string

Green returns a green text on a black background.

func GreenBold

func GreenBold(text string) string

GreenBold returns a bold green text on a black background.

func Magenta

func Magenta(text string) string

Magenta returns a magenta text on a black background.

func MagentaBold

func MagentaBold(text string) string

MagentaBold returns a bold magenta text on a black background.

func Red

func Red(text string) string

Red returns a red text on a black background.

func RedBold

func RedBold(text string) string

RedBold returns a bold red text on a black background.

func Size

func Size() (col, row int, err error)

Size returns the col and row size for the active terminal.

func White

func White(text string) string

White returns a white text on a black background.

func WhiteBold

func WhiteBold(text string) string

WhiteBold returns a bold white text on a black background.

func Yellow

func Yellow(text string) string

Yellow returns a yellow text on a black background.

func YellowBold

func YellowBold(text string) string

YellowBold returns a bold yellow text on a black background.

Types

This section is empty.

Jump to

Keyboard shortcuts

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