Documentation
¶
Index ¶
- Constants
- func BackgroundColor(backgroundcolorCode int) string
- func Color(colorCode int) string
- func Sprint(text ...any) string
- func Sprintf(format string, params ...any) string
- func Sprintln(text ...any) string
- type Pattern
- func (p *Pattern) Print(text ...any) *Pattern
- func (p *Pattern) Printf(format string, params ...any) *Pattern
- func (p *Pattern) Println(text ...any) *Pattern
- func (p *Pattern) Sprint(text ...any) string
- func (p *Pattern) Sprintf(format string, params ...any) string
- func (p *Pattern) Sprintln(text ...any) string
- func (p *Pattern) WithBackgroundColor(backgroundColor string) *Pattern
- func (p *Pattern) WithColor(color string) *Pattern
Constants ¶
const ( DefaultColor = "" BlackColor = "\u001b[30m" RedColor = "\u001b[31m" GreenColor = "\u001b[32m" YellowColor = "\u001b[33m" BlueColor = "\u001b[34m" MagentaColor = "\u001b[35m" CyanColor = "\u001b[36m" WhiteColor = "\u001b[37m" BrightBlackColor = "\u001b[30;1m" BrightRedColor = "\u001b[31;1m" BrightGreenColor = "\u001b[32;1m" BrightYellowColor = "\u001b[33;1m" BrightBlueColor = "\u001b[34;1m" BrightMagentaColor = "\u001b[35;1m" BrightCyanColor = "\u001b[36;1m" BrightWhiteColor = "\u001b[37;1m" ResetColor = "\u001b[0m" )
Colors
const ( DefaultBackgroundColor = "" BlackBackgroundColor = "\u001b[40m" RedBackgroundColor = "\u001b[41m" GreenBackgroundColor = "\u001b[42m" YellowBackgroundColor = "\u001b[43m" BlueBackgroundColor = "\u001b[44m" MagentaBackgroundColor = "\u001b[45m" CyanBackgroundColor = "\u001b[46m" WhiteBackgroundColor = "\u001b[47m" BrightBlackBackgroundColor = "\u001b[40;1m" BrightRedBackgroundColor = "\u001b[41;1m" BrightGreenBackgroundColor = "\u001b[42;1m" BrightYellowBackgroundColor = "\u001b[43;1m" BrightBlueBackgroundColor = "\u001b[44;1m" BrightMagentaBackgroundColor = "\u001b[45;1m" BrightCyanBackgroundColor = "\u001b[46;1m" BrightWhiteBackgroundColor = "\u001b[47;1m" )
Background colors
Variables ¶
This section is empty.
Functions ¶
func BackgroundColor ¶
BackgroundColor returns background color with the inputted code.
Types ¶
type Pattern ¶
Pattern is an instantiation that defines color and background color.
func WithBackgroundColor ¶
WithBackgroundColor returns pattern with inputted background color.
func (*Pattern) Print ¶
Print prints inputted text formats with the color and background that set in the pattern.
func (*Pattern) Printf ¶
Printf prints text formats with the inputted format ,color and background that set in the pattern.
func (*Pattern) Println ¶
Println prints text formats with the color and background that set in the pattern and ends with newline.
func (*Pattern) Sprint ¶
Sprint returns string that formats with color and background color that set in the pattern.
func (*Pattern) Sprintf ¶
Sprintf returns string that formats with the inputted format and color and background that set in the pattern.
func (*Pattern) Sprintln ¶
Sprintln returns string that formats with the inputted format and color and background color set in the pattern and ends with new line.
func (*Pattern) WithBackgroundColor ¶
WithBackgroundColor returns patterns that changed color with inputted background color.