utilprint 0.1.1

A utility crate for easily using colors or unicode in your terminal printing
Documentation

UtilPrint

Crates.io Documentation License

UtilPrint is a minimalist Rust crate designed to simplify the process of adding color and Unicode characters, such as emojis, to your terminal output.

It provides a fast and easy-to-use interface for enhancing your console applications with visually appealing elements. This is how it looks in a few different terminals. The aesthetics will depend on your terminal settings and support.

Features

  • Easy to Use: UtilPrint offers a straightforward API that makes it simple to integrate color and Unicode characters into your terminal output.
  • Minimalistic: The crate is designed to be lightweight and unobtrusive, focusing on providing essential functionality without unnecessary complexity.
  • Fast: UtilPrint is optimized for performance, ensuring that adding color and emojis to your terminal output doesn't slow down your application.
  • Unicode Support: Easily incorporate Unicode characters, including emojis, into your terminal output to create more engaging and expressive console applications.

Installation

Add utilprint to your Cargo.toml:

[dependencies]
utilprint = "0.1.0"

Usage Here's a quick example of how to use UtilPrint to add color and an emoji to your terminal output:

use utilprint::utilprint;

fn main() {
    utilprint("@rHello, @bworld! #1F600").unwrap();
}

This will print "Hello, world!" with "Hello" in red, "world" in blue, and a smiley face emoji at the end.

If you're sure that your utilprint function will not fail, or if you're just writing a quick example, you can omit the .unwrap() for simplicity. Just keep in mind that if an error does occur, the program will fail silently without any indication of what went wrong.

Color Codes

UtilPrint uses simple color codes to specify colors:

@d: Black
@r: Red
@g: Green
@y: Yellow
@b: Blue
@m: Magenta
@c: Cyan
@w: White
@D: Gray (Bright Black)
@R: Bright Red
@G: Bright Green
@Y: Bright Yellow
@B: Bright Blue
@M: Bright Magenta
@C: Bright Cyan
@W: Bright White
@u: Reset color
For Xterm 256 colors, use @xNNN where NNN is the color number.

Unicode Characters
To add Unicode characters, use #NNNN where NNNN is the Unicode code. For example, #1F600 for a smiley face.

Contributing

Contributions are welcome! Please feel free to submit pull requests, report bugs, or suggest new features.

License

UtilPrint is licensed under the MIT License. Have fun using or modifying it!