colored

The simplest way to add ANSI colors and styles to terminal strings in Rust.

Library
Cargo
v3.1.1
2,035stars
Mozilla Public License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
44/100Fair
Development Activity4
Maintenance20
Community52
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture75
Code Quality78
Innovation65
Learning Curve85

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 Colorize extension 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_COLOR and CLICOLOR/CLICOLOR_FORCE environment-variable handling for well-behaved CLI output
  • An optional no-color Cargo 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_COLOR for 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

TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

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.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
TypeScript
55%
Other

Cap

Team Chat · Video Conferencing

20,986

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
TypeScript55%
Rust40%
Updated yesterday
Rust
100%
Other

Fluree DB

Databases

445

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.

View details
86
Repo Health
74
Technical
65
Dependency
Built with
Rust100%
Updated yesterday
Rust
69%
Other

GitButler

Developer Tools · Devops · AI Development

21,531

Git, but better — a modern version control client with stacked branches, parallel workflows, unlimited undo, and first-class support for AI-powered development.

View details
89
Repo Health
84
Technical
68
Dependency
Built with
Rust69%
TypeScript18%
Svelte12%
Updated today
Rust
72%
Other

iii

Developer Tools · Devops

18,604

Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.

View details
86
Repo Health
85
Technical
69
Dependency
Built with
Rust72%
TypeScript17%
Updated yesterday
Python
33%
Apache 2.0

magika

Developer Tools · Security

17,958

AI-powered file type detection that identifies 200+ content types with ~99% accuracy in milliseconds using a compact deep learning model.

View details
75
Repo Health
85
Technical
77
Dependency
Built with
Python33%
Rust26%
TypeScript18%
Updated today
Rust
79%
MIT

mnemo

AI Agents · AI Development

237

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.

View details
30
Repo Health
78
Technical
75
Dependency
Built with
Rust79%
Python16%
Updated 2 months ago
Rust
53%
GPL 3.0

openfootmanager

Game Development

1,082

A free and open source football management simulation game built with Rust and Tauri, inspired by Football Manager.

View details
93
Repo Health
79
Technical
75
Dependency
Built with
Rust53%
TypeScript47%
Updated 2 days ago
Python
74%
AGPL 3.0

OpenViking

Databases · AI Development

29,711

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
84
Repo Health
75
Technical
65
Dependency
Built with
Python74%
Rust14%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search