Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zacharygolba/skittles
🌈 Add colors and formatting to ANSI terminal output with easy-to-use macros.
https://github.com/zacharygolba/skittles
ansi color console macro rust terminal
Last synced: 17 days ago
JSON representation
🌈 Add colors and formatting to ANSI terminal output with easy-to-use macros.
- Host: GitHub
- URL: https://github.com/zacharygolba/skittles
- Owner: zacharygolba
- License: apache-2.0
- Created: 2018-03-18T00:00:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-18T01:24:46.000Z (over 6 years ago)
- Last Synced: 2024-10-10T20:48:56.050Z (about 1 month ago)
- Topics: ansi, color, console, macro, rust, terminal
- Language: Rust
- Homepage:
- Size: 13.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# skittles
[![CircleCI branch](https://img.shields.io/circleci/project/github/zacharygolba/skittles/master.svg?style=flat-square)](https://circleci.com/gh/zacharygolba/skittles/tree/master) [![AppVeyor branch](https://img.shields.io/appveyor/ci/zacharygolba/skittles/master.svg?logo=appveyor&style=flat-square)](https://ci.appveyor.com/project/zacharygolba/skittles/branch/master) [![Crates.io](https://img.shields.io/crates/v/skittles.svg?style=flat-square)](https://crates.io/crates/skittles)
Add colors and formatting to ANSI terminal output with easy-to-use macros built on top of [`ansi_term`](https://docs.rs/ansi_term).
## Installation
First, add `skittles` to the dependencies section of your `Cargo.toml`:
```toml
[dependencies]
skittles = "0.1"```
Next, add add this to the entrypoint of your crate (`lib.rs` or `main.rs`).
```rust
#[macro_use]
extern crate skittles;
```## Usage
Each macro provided by `skittles` can accept a string literal or a format string with arguments as input.
```rust
println!(
"{} - {} {} {}.",
underline!("Skittles"),
red!("Taste"),
green!("the"),
blue!("rainbow")
);
```You can also compose `skittles` macros together to get the exact color and formatting you want while avoiding itermediate allocations entirely.
```rust
println!(
"{} - {} {} {}.",
blink!(yellow!("Skittles")),
underline!(red!("Taste")),
underline!(italic!(green!("the"))),
underline!(bold!(blue!("rainbow")))
);
```## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.