<commit_before># Colored

[![Build
Status](https://travis-ci.org/mackwic/colored.svg?branch=master)](https://travis-ci.org/mackwic/colored)

Coloring terminal so simple, you already know how to do it !

```rust
    "this is blue".blue();
    "this is red".red();
    "this is red on blue".red().on_blue();
    "this is also red on blue".on_blue().red();
    "you can also make bold comments".bold();
    println!("{} {} {}", "or use".cyan(), "any".italic().yellow(), "string type".cyan());
    "or change advice. This is red".yellow().blue().red();
    "or clear things up. This is default color and style".red().bold().clear()
    "purple and magenta are the same".purple().magenta()
    "and so are normal and clear".normal().clear()
    String::new("this also works!").green().bold()
```

## How to use

Add this in your `Cargo.toml`:

```toml
[dependencies]
colored = "1.0"
```

and add this to your `lib.rs` or `main.rs`:

```rust
    extern crate colored;
    
    use colored::*;
    
    // test the example with `cargo run --example most_simple`
    fn main() {
        // TADAA !
        println!("{} {} !", "it".green(), "works".blue().bold());
    }
```

#### Colors:

- black
- red
- green
- yellow
- blue
- magenta (or purple)
- cyan
- white

Background colors: prepend the color by `on_`. Simple as that.

#### Styles:

- bold
- underline
- italic
- dimmed
- reversed
- blink
- hidden

You can clear color _and_ style anytime by using `normal()` or `clear()`

## Todo

- **Windows console support**: this works only with ansi term. I plan to support
  the windows console also.
- **More tests ?**: We always wecome more tests ! Please contribute !

## Credits

This library wouldn't have been the same without the marvelous ruby gem [colored](https://github.com/defunkt/colored).

Thanks for the [ansi\_term crate](https://github.com/ogham/rust-ansi-term) for
providing a reference implementation, which greatly helped making this crate
output correct strings.

## Licence

Mozilla Public Licence 2.0. See the LICENCE file at the root of the repository.

In non legal terms it means that:
- if you fix a bug, you MUST give me the code of the fix (it's only fair)
- if you change/extend the API, you MUST give me the code you changed in the
  files under MPL2.
- you CAN'T sue me for anything about this code
- appart from that, you can do almost whatever you want. See the LICENCE file
  for details.


<commit_msg> update todo from feedback<commit_after># Colored

[![Build
Status](https://travis-ci.org/mackwic/colored.svg?branch=master)](https://travis-ci.org/mackwic/colored)

Coloring terminal so simple, you already know how to do it !

```rust
    "this is blue".blue();
    "this is red".red();
    "this is red on blue".red().on_blue();
    "this is also red on blue".on_blue().red();
    "you can also make bold comments".bold();
    println!("{} {} {}", "or use".cyan(), "any".italic().yellow(), "string type".cyan());
    "or change advice. This is red".yellow().blue().red();
    "or clear things up. This is default color and style".red().bold().clear()
    "purple and magenta are the same".purple().magenta()
    "and so are normal and clear".normal().clear()
    String::new("this also works!").green().bold()
```

## How to use

Add this in your `Cargo.toml`:

```toml
[dependencies]
colored = "1.0"
```

and add this to your `lib.rs` or `main.rs`:

```rust
    extern crate colored;

    use colored::*;

    // test the example with `cargo run --example most_simple`
    fn main() {
        // TADAA !
        println!("{} {} !", "it".green(), "works".blue().bold());
    }
```

#### Colors:

- black
- red
- green
- yellow
- blue
- magenta (or purple)
- cyan
- white

Background colors: prepend the color by `on_`. Simple as that.

#### Styles:

- bold
- underline
- italic
- dimmed
- reversed
- blink
- hidden

You can clear color _and_ style anytime by using `normal()` or `clear()`

## Todo

- **Windows console support**: this works only with ansi term. I plan to support
  the windows console also.
- **Optional disabling** Sometimes the user don't want colors. We won't colorize
  when the env variable `RUST_NOCOLOR` is set.
- **Color templating** From a brson idea, something like
  `"{blue}this is blue{/}{bold}{yellow}this is yellow and bold{/}{/}".colorize()` ?
  Is it really interesting ? Thinking of it.
- **More tests ?**: We always wecome more tests ! Please contribute !

## Credits

This library wouldn't have been the same without the marvelous ruby gem [colored](https://github.com/defunkt/colored).

Thanks for the [ansi\_term crate](https://github.com/ogham/rust-ansi-term) for
providing a reference implementation, which greatly helped making this crate
output correct strings.

## Licence

Mozilla Public Licence 2.0. See the LICENCE file at the root of the repository.

In non legal terms it means that:
- if you fix a bug, you MUST give me the code of the fix (it's only fair)
- if you change/extend the API, you MUST give me the code you changed in the
  files under MPL2.
- you CAN'T sue me for anything about this code
- appart from that, you can do almost whatever you want. See the LICENCE file
  for details.

{'fraction_non_alphanumeric': 0.14139463009464942, 'fraction_numerical': 0.0019316206297083252, 'mean_word_length': 3.4030612244897958, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '694169', 'n_tokens_mistral': 1657, 'n_tokens_neox': 1609, 'n_words': 642}