color

package
v0.0.0-...-85bb7ee Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 1 Imported by: 5

Documentation

Overview

Package color is a very basic ANSI escape sequence colorer. Use it like this:

fmt.Println(color.Text(color.Red) + "I AM SO RED" + color.Reset())
fmt.Println(color.All(color.Red, false, color.White) + "Red on white." + color.Reset())

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(foreground Color, bright bool, background Color) string

func Error

func Error(e error) string

Error() returns an error string colored red

func Fail

func Fail() string

Fail() returns a cute little red cross mark ✗

func Pass

func Pass() string

Pass() returns a cute little green check mark ✓

func Reset

func Reset() string

func Text

func Text(c Color) string

Types

type Color

type Color int
const (
	Black Color = iota + 1
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
)

Jump to

Keyboard shortcuts

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