yansi

A dead simple ANSI terminal color painting library.
```rust
use yansi::Paint;
println!("Testing, {}, {}, {}!",
"Ready".bold(),
"Set".black().onyellow().invert().italic(),
"STOP".white().onred().bright().underline().bold());
```
>
Testing,
Ready,
Set,
STOP!
Features
Why yet another ANSI terminal coloring library? Here are some reasons:
- This library makes simple things simple:
use
[Paint
] and go!
- Zero dependencies by default. It really is simple.
- Zero allocations except as needed by opt-in [wrapping].
- [Automatic Windows support] for the vast majority (95%+) of Windows
users.
- Featureful
no_std
, no-alloc
, support with default-features =
false
.
Style
constructors are const
: store styles statically, even with
dynamic conditions!
- Any type implementing a formatting trait can be stylized, not just
strings.
- Styling can be [enabled] and [disabled] globally and [dynamically], on
the fly.
- A
Style
can be predicated on arbitrary [conditions].
- Formatting specifiers like
{:x}
and {:08b}
are supported and
preserved!
- [Built-in (optional) conditions] for [TTY detection] and [common
environment variables].
- Arbitrary items can be [masked] for selective disabling.
- Styling can [wrap] to preserve styling across resets.
- Experimental support for [hyperlinking] is included.
- The name
yansi
is pretty cool 😎.
License
yansi
is licensed under either of the following, at your option:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)