color

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package color adds CLI coloring

Index

Constants

View Source
const (
	// Reset code
	Reset = "\033[0m"
	// CodeBold represents code for bold character
	CodeBold = "\033[1m"
	// CodeDim represents code for dimmed character
	CodeDim = "\033[2m"
	// CodeUnderline represents code for underlined character
	CodeUnderline = "\033[4m"
	// CodeStrike represents code for strike character
	CodeStrike = "\033[9m"
	// CodeItalic represents code for italic character
	CodeItalic = "\033[3m"

	// CodeRed represents code for red character
	CodeRed = "\033[31m"
	// CodeGreen represents code for green character
	CodeGreen = "\033[32m"
	// CodeYellow represents code for yellow character
	CodeYellow = "\033[33m"
	// CodeBlue represents code for blue character
	CodeBlue = "\033[34m"
	// CodePurple represents code for purple character
	CodePurple = "\033[35m"
	// CodeCyan represents code for cyan character
	CodeCyan = "\033[36m"
	// CodeWhite represents code for white character
	CodeWhite = "\033[37m"
)

Variables

This section is empty.

Functions

func Blue

func Blue(s string) string

Blue formats input string as blue.

func Combine added in v0.1.0

func Combine(s string, formatCode ...string) string

Combine concatenates one or more format codes with a given string and returns the result.

func Dim

func Dim(s string) string

Dim formats input string as dimmed.

func Green

func Green(s string) string

Green formats input string as green.

func Red

func Red(s string) string

Red formats input string as red.

Types

This section is empty.

Jump to

Keyboard shortcuts

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