Documentation
¶
Index ¶
- Variables
- func Color(colorString string) func(...interface{}) string
- func CreateBgColor() string
- func CreateBgColorCode() string
- func CreateColor() string
- func CreateColorCode() string
- func GetCodeBg(code string) string
- func GetDefaultBg() string
- func GetGreyBg() string
- func GetReset() string
- func GetWhiteBg() string
- func LabelPrint(message string, attribute int) string
- func LabelPrintWithArg(message string, fg string, bg string, attribute int) string
- func PadString(line string, max int) string
- func PadStringToR(line string, max int) string
- func PrintColored(code string, output string) string
- func PrintColoredBg(code string, bgCode string, output string) string
- func ResetColors(print bool) string
- type LabelColor
Constants ¶
This section is empty.
Variables ¶
var ( // Info Color reference Info = Teal // Warn Color reference Warn = Yellow // Fata Color reference Fata = Red )
var ( // Black Color Black = Color("\033[1;30m%s\033[0m") // Red Color Red = Color("\033[1;31m%s\033[0m") // Green Color Green = Color("\033[1;32m%s\033[0m") // Yellow Color Yellow = Color("\033[1;33m%s\033[0m") // Purple Color Purple = Color("\033[1;34m%s\033[0m") // Magenta Color Magenta = Color("\033[1;35m%s\033[0m") // Teal Color Teal = Color("\033[1;36m%s\033[0m") // White Color White = Color("\033[1;37m%s\033[0m") )
var CurrentBgColor = "40"
CurrentBgColor current used background color
var CurrentColor = "36"
CurrentColor current used foreground color
Functions ¶
func CreateBgColor ¶
func CreateBgColor() string
CreateBgColor defines a random color and returns a id
func CreateBgColorCode ¶
func CreateBgColorCode() string
CreateBgColorCode returns the colorcode by a random number
func CreateColorCode ¶
func CreateColorCode() string
CreateColorCode returns the colorcode by a random number
func LabelPrint ¶
LabelPrint prints message by using current fore and background
func LabelPrintWithArg ¶
LabelPrintWithArg prints message by using current fore and background
func PadStringToR ¶
PadStringToR Returns max len string filled with spaces right placed
func PrintColored ¶
PrintColored formats string colored by the color id
func PrintColoredBg ¶
PrintColoredBg formats string colored by the color id including background
func ResetColors ¶
ResetColors resets terminal colors if print false you get the ansi code only
Types ¶
type LabelColor ¶
LabelColor contains fore and background color