A dead simple, zero-dependency ANSI terminal color painting library for Rust with automatic Windows support.
Yansi is an ANSI terminal color painting library for Rust that provides a simple and efficient way to add colors and styles to terminal output. It solves the problem of making terminal applications more readable and visually distinct by offering an intuitive API with zero dependencies by default and automatic Windows support.
Rust developers building command-line interfaces (CLIs), terminal applications, or tools that require colored or styled output for better user experience or debugging.
Developers choose Yansi for its simplicity, zero-dependency design, and robust feature set including Windows compatibility, `no_std` support, and dynamic styling control, making it a lightweight yet powerful alternative to other Rust terminal coloring libraries.
A dead simple ANSI terminal color painting library for Rust.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
By default, Yansi has no external dependencies, keeping it lightweight and easy to integrate, as highlighted in the README's key features.
It seamlessly enables ANSI colors on most Windows terminals without manual configuration, simplifying cross-platform development for CLI tools.
Styles can be defined as constants using `const` constructors, allowing for efficient static storage even with dynamic runtime conditions, per the library's documentation.
With default features disabled, Yansi works in no_std and no-alloc environments, making it suitable for embedded or resource-constrained applications.
Styling can be enabled, disabled, or conditioned dynamically at runtime via functions like `enable()` and `whenever()`, offering fine-grained control for debugging or user preferences.
Hyperlink support is marked as experimental in the README, meaning it may not be stable for production use and could change in future releases.
Focused solely on ANSI coloring, it lacks built-in components for common TUI elements like spinners or grids, requiring integration with other libraries for richer interfaces.
Implementing advanced features like masking or lingering requires manual setup and understanding of the API, which might be overkill for simple colorization tasks.