rust-colors 0.2.1

A library for parsing ANSI Strings to colors.
Documentation
  • Coverage
  • 5.88%
    1 out of 17 items documented1 out of 1 items with examples
  • Size
  • Source code size: 5.8 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.63 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ProgrammerReddy

rust-colors

A library for parsing ANSI Strings to colors. Built in Rust, open source and easy to use. Underneath are some examples of how you could use the functions.

You can reach out to me on Discord: RedIsGaming

Example color functions main program

Here is an example of how the main program can look:

use rust_colors::{Ansi, Color, Colors};

fn main() {
    let colors = Ansi;

    println!(
        "The sky is {}, apples can be {}, do you like to touch {} grass?",
        colors.color("blue", Colors::Blue),
        colors.bold_color("red", Colors::Red),
        colors.underline_color("green", Colors::Green),
    );
}

rust-colors options to choose from

Colors::Black,
Colors::Red,
Colors::Green,
Colors::Yellow,
Colors::Blue,
Colors::Purple,
Colors::Cyan,
Colors::White,
Colors::Default,

Author

RedIsGaming

Language(s) and tools

  • Rust
  • VSCode
    • rust-analyzer (extension)
    • Even Better TOML (extension)
    • Error Lens (extension)
    • crates (extension)
  • Cargo
    • clippy (feature)
    • fmt (feature)

License

MIT license

Status

Contact

Discord

How to use this project?

How to run?

First clone the rust-colors project to any location you desire.

git clone https://github.com/RedIsGaming/rust-colors.git

Then switch to that directory and run Cargo.

cd rust-colors
cargo run