Registry / utility / supports-color

supports-color

JSON →
library3.0.2rscratesunverified

Detects whether a terminal supports color, and gives details about that support.

# Cargo.toml [dependencies] supports-color = "3.0.2"
INSTALL
IMPORT
SIG · SUPPORTS-COLOR
S
supports-color
utilityrustv3.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

on
use supports_color::on;

Checks if stdout supports color and prints the color level.

use supports_color::on; fn main() { match on(supports_color::Stream::Stdout) { Some(support) => println!("Color level: {:?}", support), None => println!("No color support"), } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.0.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
supports-color — cargo add supports-color · libregistry