A fast Ruby gem for adding ANSI terminal colors and effects with a simple API and true color support.
Paint is a Ruby gem that adds ANSI terminal colors and effects to text output. It solves the problem of colorizing command-line interface (CLI) output with a fast, simple API that supports true color, 256-color palettes, and various text effects. It automatically detects terminal capabilities and falls back appropriately.
Ruby developers building command-line tools, libraries, or applications that require colored terminal output, especially those who need a lightweight, non-intrusive solution without core extensions.
Developers choose Paint for its speed, simplicity, and flexibility—it outperforms similar gems, offers a clean API without monkey-patching, and supports advanced features like true color and nested colorization, making it ideal for both simple scripts and complex libraries.
Ruby gem for ANSI terminal colors 🎨︎ VERY FAST
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Does not monkey-patch String class, making it safe for library development and avoiding conflicts with other gems, as highlighted in the README's philosophy.
Uses a single `Paint.[]` method for all colorization needs, with benchmarks showing it outperforms similar gems like term-ansicolor and rainbow.
Defaults to 24-bit true color in Paint 2.0 with automatic fallback to 256 or 16 colors based on terminal detection, ensuring rich output on modern terminals.
Supports a wide range of ANSI effects and allows colorizing substrings via templating with the `%` method, though the README notes it can create verbose sequences.
Relies on external tools like ansicon or WSL for ANSI support on native Windows, adding setup complexity and potential cross-platform headaches.
Many ANSI effects listed, such as italic or rapid blink, are not widely supported across terminals, reducing their practical utility in real-world applications.
Substitution for nested colorization generates lengthy escape sequences that can be hard to debug and may impact performance in large or complex outputs.