yansi
A dead simple ANSI terminal color painting library.
use yansi::Paint;
println!("Testing, {}, {}, {}!",
"Ready".bold(),
"Set".black().on_yellow().invert().italic(),
"STOP".white().on_red().bright().underline().bold());
>
Testing, Ready, Set, STOP!
Why yet another ANSI terminal coloring library? Here are some reasons:
use
Paint
and go!no_std
, no-alloc
, support with default-features = false
.Style
constructors are const
: store styles statically, even with dynamic conditions!Style
can be predicated on arbitrary conditions.{:x}
and {:08b}
are supported and preserved!yansi
is pretty cool 😎.yansi
is licensed under either of the following, at your option:
.gitignore
/target
Cargo.lock
Cargo.toml
[package]
name = "yansi"
version = "1.0.0-rc"
authors = ["Sergio Benitez <sb@sergio.bz>"]
repository = "https://github.com/SergioBenitez/yansi"
documentation = "https://docs.rs/yansi"
description = "A dead simple ANSI terminal color painting library."
keywords = ["ansi", "terminal", "color", "format", "paint"]
readme = "README.md"
license = "MIT OR Apache-2.0"
categories = ["command-line-interface"]
rust-version = "1.63"
edition = "2021"
[package.metadata.docs.rs]
all-features = true
[features]
default = ["std"]
detect-tty = ["is-terminal", "std"]
detect-env = ["std"]
hyperlink = ["std"]
std = ["alloc"]
alloc = []
# hidden feature to enable nightly doc cfg
_nightly = []
[dependencies]
is-terminal = { version = "0.4.7", optional = true }
Author: SergioBenitez
Source: https://github.com/SergioBenitez/yansi
License: Apache-2.0, MIT licenses found