This repository has been archived on 2021-06-21. You can view files and clone it, but cannot push or open issues/pull-requests.
beaver/color
jolheiser d94c70e319
Add license and fix READMEs
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-10-18 17:00:45 -05:00
..
README.md Add license and fix READMEs 2020-10-18 17:00:45 -05:00
basic.go Extended and true colors 2020-10-18 16:47:07 -05:00
basic_colors.go Extended and true colors 2020-10-18 16:47:07 -05:00
basic_test.go Extended and true colors 2020-10-18 16:47:07 -05:00
color.go Extended and true colors 2020-10-18 16:47:07 -05:00
color_test.go Extended and true colors 2020-10-18 16:47:07 -05:00
extended.go Extended and true colors 2020-10-18 16:47:07 -05:00
extended_colors.go Extended and true colors 2020-10-18 16:47:07 -05:00
rgb.go Extended and true colors 2020-10-18 16:47:07 -05:00
rgb_test.go Extended and true colors 2020-10-18 16:47:07 -05:00
true.go Extended and true colors 2020-10-18 16:47:07 -05:00

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.