A Go library for terminal color rendering with 16/256/True color support, universal API methods, and Windows compatibility.
gookit/color is a Go library for adding color to terminal output. It solves the problem of inconsistent and limited color support across different terminals by providing a unified API that works with 16 colors, 256 colors, and true RGB colors, including full compatibility with Windows environments.
Go developers building command-line interfaces (CLIs), tools, or scripts that require colored terminal output for better user experience, debugging, or visual differentiation.
Developers choose gookit/color for its simplicity, zero dependencies, and robust cross-platform support. Its universal API methods and built-in styles make it easy to integrate, while features like HTML-like tags and color conversion utilities offer flexibility not found in basic alternatives.
🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows. GO CLI 控制台颜色渲染工具库,支持16色,256色,RGB色彩渲染输出,使用类似于 Print/Sprintf,兼容并支持 Windows 环境的色彩渲染
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library has no external dependencies, making it easy to integrate and maintain in Go projects without bloating the build.
Fully supports color rendering in Windows CMD and PowerShell, along with Unix terminals, ensuring consistent output across all major operating systems.
Provides 16-color, 256-color, and true RGB color modes with automatic environment detection, allowing for vibrant and precise terminal styling.
Includes HTML-like tags (e.g., <green>message</>) and built-in styles like Info and Error, enabling intuitive and quick color application without manual ANSI codes.
With multiple methods (Print, Printf, etc.) and styling options, simple tasks like coloring a single string can require more code than minimalist alternatives.
Relies on automatic terminal capability detection; in edge cases or misconfigured environments, color output might fail or render inconsistently, requiring manual overrides.
The extensive feature set, including color conversion utilities and tag parsing, may add unnecessary complexity if only basic color functionality is needed.