John Olheiser
c628fd1987
Co-authored-by: jolheiser <john.olheiser@gmail.com> Reviewed-on: https://gitea.com/jolheiser/beaver/pulls/3 Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-committed-by: John Olheiser <john.olheiser@gmail.com> |
||
---|---|---|
.. | ||
README.md | ||
basic.go | ||
basic_colors.go | ||
basic_test.go | ||
color.go | ||
color_test.go | ||
extended.go | ||
extended_colors.go | ||
rgb.go | ||
rgb_test.go | ||
true.go |
README.md
Color
Beaver comes with the color
sub-package that can be used even without Beaver calls.
Color
is an interface that simply needs Format(text string) string
to fulfill it.
Any logger in beaver can be set to a Color
.
Formatting a string with a single attribute
text := color.FgRed.Format("red")
Formatting a string with a full color
text := color.New(color.BgGreen, color.FgRed, color.Bold).Format("green background, red text, and bold")
Extended colors
Extended colors are 256-color extensions. They can be referred to by name, available in extended_colors.go.
True colors
True colors are full RBG colors, they can be either created with RGB values or parsed from hex.