A Go library for adding ANSI colors and text formatting to terminal output, with support for Printf/Sprintf methods.
Aurora is a Go library that provides ANSI color codes and text formatting for terminal output. It solves the problem of creating colored and styled command-line interfaces by offering a simple API that works with Go's standard Printf and Sprintf functions.
Go developers building command-line tools, CLI applications, or any terminal-based software that requires colored or formatted text output.
Developers choose Aurora for its comprehensive ANSI support, chainable API, and seamless integration with Go's formatting functions, making it a robust and easy-to-use alternative to basic color libraries.
Golang ultimate ANSI-colors that supports Printf/Sprintf methods
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports a wide range of ANSI codes including 24 grayscale colors, 216 8-bit colors, and formats like bold, underline, and hyperlinks, as detailed in the README's color and format tables.
Allows method chaining like `Red("x").Bold().BgMagenta()` for concise and readable styling, improving code clarity over nested functions.
Integrates directly with Go's Printf and Sprintf functions to colorize formatted strings, shown in usage examples for easy adoption.
Enables runtime enabling or disabling of colors via configuration, useful for output redirection or flag-based control, as demonstrated in the Enable/Disable colors section.
By design, it only provides ANSI colors, so Windows requires workarounds like go-colorable or registry edits, as admitted in the Limitations section.
Lacks internal TTY detectors, forcing developers to implement custom logic for enabling colors only in terminals, adding complexity for file output.
Has issues with Go's Printf verbs like %T and %p, requiring workarounds such as wrapping with fmt.Sprintf, which can be inconvenient for debugging.