color

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: ISC Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearColors

func ClearColors(text string) string

Returns text without color

func ColorizeText

func ColorizeText(color Color, text string) string

Returns text prepended by ANSI color code and appended by ANSI color reset code

Types

type Color

type Color string
const (
	ANSIReset       Color = "\033[0m"
	ANSIColorRed    Color = "\033[31m"
	ANSIColorGreen  Color = "\033[32m"
	ANSIColorYellow Color = "\033[33m"
	ANSIColorBlue   Color = "\033[34m"
	ANSIColorPurple Color = "\033[35m"
	ANSIColorCyan   Color = "\033[36m"
	ANSIColorWhite  Color = "\033[37m"
	ANSIColorGray   Color = "\033[90m"
	ANSIFontBold    Color = "\033[1m"

	ColorTrace Color = ANSIColorGray
	ColorDebug Color = ANSIColorCyan
	ColorInfo  Color = ANSIColorGreen
	ColorWarn  Color = ANSIColorYellow
	ColorError Color = ANSIColorRed
	ColorFatal Color = ANSIFontBold + ANSIColorRed
)

func GetLevelColor

func GetLevelColor(level int) Color

Jump to

Keyboard shortcuts

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