skittles

Crates.ioskittles
lib.rsskittles
version0.1.0
sourcesrc
created_at2018-03-18 01:04:08.316168
updated_at2018-03-18 01:04:08.316168
descriptionAdd colors and formatting to ANSI terminal output with easy-to-use macros.
homepage
repositoryhttps://github.com/zacharygolba/skittles
max_upload_size
id56191
size30,359
Zachary Golba (zacharygolba)

documentation

https://docs.rs/skittles/0.1

README

skittles

CircleCI branch AppVeyor branch

Add colors and formatting to ANSI terminal output with easy-to-use macros built on top of ansi_term.

Installation

First, add skittles to the dependencies section of your Cargo.toml:

[dependencies]
skittles = "0.1"

Next, add add this to the entrypoint of your crate (lib.rs or main.rs).

#[macro_use]
extern crate skittles;

Usage

Each macro provided by skittles can accept a string literal or a format string with arguments as input.

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.

println!(
    "{} - {} {} {}.",
    blink!(yellow!("Skittles")),
    underline!(red!("Taste")),
    underline!(italic!(green!("the"))),
    underline!(bold!(blue!("rainbow")))
);

License

Licensed under either of

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.

Commit count: 4

cargo fmt