systools

package
v0.0.7-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrentBgColor = "40"

CurrentBgColor current used background color

View Source
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 CreateColor

func CreateColor() string

CreateColor defines a random color and returns a id

func CreateColorCode

func CreateColorCode() string

CreateColorCode returns the colorcode by a random number

func GetCodeBg

func GetCodeBg(code string) string

GetCodeBg Get the Background from color Code

func GetDefaultBg

func GetDefaultBg() string

GetDefaultBg Get the Default Background

func GetGreyBg

func GetGreyBg() string

GetGreyBg Get the DarkGrey Background

func GetReset

func GetReset() string

GetReset gets the reset code

func GetWhiteBg

func GetWhiteBg() string

GetWhiteBg Get the White Background

func LabelPrint

func LabelPrint(message string, attribute int) string

LabelPrint prints message by using current fore and background

func LabelPrintWithArg

func LabelPrintWithArg(message string, fg string, bg string, attribute int) string

LabelPrintWithArg prints message by using current fore and background

func PadString

func PadString(line string, max int) string

PadString Returns max len string filled with spaces

func PadStringToR

func PadStringToR(line string, max int) string

PadStringToR Returns max len string filled with spaces right placed

func PrintColored

func PrintColored(code string, outputs string) string

PrintColored formats string colored by the color id

func PrintColoredBg

func PrintColoredBg(code string, bgCode string, outputs string) string

PrintColoredBg formats string colored by the color id including background

func ResetColors

func ResetColors(print bool) string

ResetColors resets terminal colors if print false you get the ansi code only

Types

type LabelColor

type LabelColor struct {
	Color   string
	BgColor string
}

LabelColor contains fore and background color

Jump to

Keyboard shortcuts

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