A Golang package to add colors to your terminal output.
go get -u github.com/noa-log/colorizepackage main
import (
"fmt"
"github.com/noa-log/colorize"
)
func main() {
// Add color to text
fmt.Println(colorize.BlueText("This is blue text"))
// Add background color to text
fmt.Println(colorize.BlueBackground("This is text with a blue background"))
// Set custom text color, background color, and style
fmt.Println(colorize.Set("This is custom styled text", colorize.ConfigBold, colorize.BackgroundBlue, colorize.TextWhite))
}- All available colors and styles are defined as constants.
- Provides methods to quickly set text color and background color.
- Supports custom combinations of colors and styles.
- Uses ANSI escape sequences, compatible with most terminals.
- 100% unit test coverage.
This project is open-sourced under the Apache License 2.0. Please comply with the terms when using it.