Colored Next (CNXT)
A fork of colored which introduces better functionalities.
Why CNXT?
- Enhanced Performance: Uses
Cowto minimize allocations (Inspired by this PR) - Streamlined Codebase: Removed outdated and redundant code
- Superior Terminal Support: Improved detection and handling of terminal capabilities
Usage
Coloring your terminal made simple. You already know how to do it.

Small tips
-
For Windows targets, add this to enable colors in Windows CMD:
set_virtual_terminal;Comparison of colors with virtual terminal disabled vs enabled.

-
CNXT automatically detects terminal color support across 3 levels:
Ansi16Ansi256TrueColor
When using colors beyond your terminal's capabilities, CNXT automatically downgrades them to the maximum supported level.
use ; // By default, the support level is detected from environment from_env // You can explicitly set the support level: set_should_colorize; // Enable colorization with true color support set_should_colorize; // Enable colorization with 256 color support // Simple on/off control: set_should_colorize; // Disable colorization set_should_colorize; // Enable colorization // Reset to environment-based detection: set_should_colorize;And for manual color fallback control:
use Color; let color = TrueColor ; let ansi16_color = color.fallback_to_ansi16; # or let ansi256_color = color.fallback_to_ansi256;
License
As a fork of colored, CNXT maintains the same MPL-2.0 license as the original repository.