colored
The simplest way to add ANSI colors and styles to terminal strings in Rust.
Repository Health
Technical Analysis
colored is a Rust crate that adds a Colorize trait directly onto &str and String, so any string can be colored or styled by chaining calls like .red(), .on_blue(), or .bold(). It covers the standard 8 ANSI colors plus bright variants, background colors, and text styles such as bold, underline, italic, dimmed, and strikethrough, all without requiring users to learn a separate builder API.
Beyond basic named colors, colored supports truecolor (24-bit RGB) foreground and background colors, hex color strings, and dynamic color selection from runtime strings. It also respects terminal color conventions out of the box — honoring NO_COLOR and CLICOLOR/CLICOLOR_FORCE environment variables — and works across Linux, macOS, and Windows (including PowerShell).
What You Get
- A
Colorizeextension trait adding.red(),.blue(),.on_green(),.bright_yellow(), etc. directly to strings - Text styling methods:
.bold(),.underline(),.italic(),.dimmed(),.reversed(),.blink(),.hidden(),.strikethrough() - Truecolor (24-bit RGB) support via
.truecolor(r,g,b),.custom_color(), and hex-string colors like.color("#0057B7") - Automatic
NO_COLORandCLICOLOR/CLICOLOR_FORCEenvironment-variable handling for well-behaved CLI output - An optional
no-colorCargo feature to strip all color output at compile time - Cross-platform support for Linux, macOS, and Windows (including PowerShell) terminals
Common Use Cases
- Highlighting success/error/warning output in a command-line tool without hand-writing ANSI escape codes
- Building colorized diff, log, or test-runner output that still degrades gracefully when piped to a file
- Adding branded truecolor output to a CLI while respecting
NO_COLORfor accessibility and CI environments - Prototyping terminal UIs or REPLs that need quick, readable color-coded text without a full TUI framework
Under The Hood
Architecture: The crate’s core is a ColoredString wrapper (src/lib.rs) produced by the Colorize trait, which is implemented for &str and String. Color and style state is tracked in a small struct backed by the enums defined in src/color.rs (Color) and src/style.rs (Style, bitflags-style for combinable styles like bold+underline), and src/customcolors.rs adds a CustomColor type for arbitrary RGB values. src/formatters.rs implements Display/fmt::Debug for ColoredString, translating the tracked state into ANSI escape sequences only at format time, which is what lets a colored string still work correctly with Rust’s format specifiers (padding, truncation) as shown in the README’s format!("{:30}", ...) example. src/control.rs centralizes the NO_COLOR/CLICOLOR/CLICOLOR_FORCE environment-variable checks so every formatter respects the same global on/off state. Tech Stack: Rust 2021 edition, minimum supported Rust version 1.80; the only runtime dependency is windows-sys (gated to cfg(windows)) for Windows console color support — everything else is std-only. Dev-dependencies (insta for snapshot testing, rspec for spec-style tests, ansiterm for compatibility testing) are test-only. The crate enables Clippy’s pedantic/nursery/correctness lint groups as warnings, showing an intentionally strict internal quality bar. Code Quality: The crate ships a real test suite — tests/ansi_term_compat.rs checks compatibility with the ansiterm crate’s output, and snapshot tests under src/snapshots/ (via insta) pin exact colored output for both color-enabled and no-color builds, catching accidental formatting regressions. Combined with the strict Clippy lint configuration in Cargo.toml, this indicates an actively quality-gated codebase, though GitHub activity data shows currently low commit velocity relative to its age. API Design: The trait-based Colorize design is the crate’s biggest ergonomic win — no wrapper types or builder calls are needed at the call site, just .red() chained onto any string literal, which is why the README can claim ‘coloring terminal so simple you already know how to do it.’ Style and color calls compose freely (.on_blue().red().bold()), and the crate documents an escape hatch (.clear()/.normal()) for resetting state, keeping the API small and discoverable without a generated-docs deep dive.
Used by 13 apps in this directory
Anarlog
Note Taking · AI Assistants · Productivity
Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.
Cap
Team Chat · Video Conferencing
Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.
Fluree DB
Databases
A temporal, verifiable graph database with git-like branching, integrated vector/text/geo search, and RDF/SPARQL/JSON-LD/openCypher support — benchmarked at 10.4x faster than the next database on the full Wikidata dump.
GitButler
Developer Tools · Devops · AI Development
Git, but better — a modern version control client with stacked branches, parallel workflows, unlimited undo, and first-class support for AI-powered development.
iii
Developer Tools · Devops
Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.
magika
Developer Tools · Security
AI-powered file type detection that identifies 200+ content types with ~99% accuracy in milliseconds using a compact deep learning model.
mnemo
AI Agents · AI Development
A local-first AI memory sidecar that extracts entities, builds a persistent knowledge graph, and injects ranked context into any LLM pipeline — no cloud required.
openfootmanager
Game Development
A free and open source football management simulation game built with Rust and Tauri, inspired by Football Manager.
OpenViking
Databases · AI Development
An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.