Colored Next (CNXT)
An enhanced fork of colored offering superior performance and terminal handling.
Why CNXT?
- Optimized Performance: Utilizes
Cowfor intelligent memory management (Inspired by this PR) - Modern Codebase: Removed legacy code and streamlined implementation
- Advanced Terminal Support: Sophisticated terminal capability detection with automatic color downgrading
Usage
Coloring your terminal made simple. You already know how to do it.

Essential Configuration
-
For Windows targets, add this to enable colors in Windows CMD:
set_virtual_terminal;Comparison showing how Windows CMD displays colors before and after enabling virtual terminal.

-
CNXT dynamically detects terminal color support across three tiers:
Ansi16(16 colors)Ansi256(256 colors)TrueColor
When using colors beyond your terminal's capabilities, CNXT automatically downgrades them to the maximum supported level.
Manual control options:
use ; // Environment-based detection level (default) set_should_colorize; // Explicit configuration set_should_colorize; // Force truecolor set_should_colorize; // Force 256-color set_should_colorize; // Disable colors set_should_colorize; // Enable colors with auto-detect level // Manual color fallback use Color; let truecolor = TrueColor ; let ansi16 = truecolor.fallback_to_ansi16; let ansi256 = truecolor.fallback_to_ansi256;
Features
-
terminal-detection (Enabled by default):
Automatically detects terminal color support and downgrades colors accordingly.
Defaultly use TrueColor if disable this feature.
-
conditional-coloring : Provide helper functions to colorize strings based on conditions.
use Colorize as _; println!; // print red color println!; // print no color println!; // print green color
License
CNXT maintains the original MPL-2.0 License from the colored project.