mccolors-rust

Crates.iomccolors-rust
lib.rsmccolors-rust
version0.1.3
sourcesrc
created_at2024-01-19 11:07:38.001492
updated_at2024-01-23 09:45:01.317622
descriptionA Rust library for working with Minecraft color codes and ANSI colors.
homepagehttps://github.com/wrrulos/mccolors-rust
repositoryhttps://github.com/wrrulos/mccolors-rust
max_upload_size
id1105193
size7,735
Pedro Vega (wrrulos)

documentation

README

mccolors-rust

mccolors-rust is a Rust library for handling Minecraft-style color codes in your terminal text. Easily add colorful and expressive text to your Rust applications for a visually appealing user experience.

Installation

You can include mccolors-rust in your Rust project by adding it to your Cargo.toml:

[dependencies]
mccolors-rust = "0.1.3"

Usage

use mccolors_rust::{mcwrite, mcreplace, mcremove};

// Writing text with Minecraft color codes
mcwrite("&4Hello &rWorld!");

// Replacing Minecraft color codes with their respective colors
let formatted_text = mcreplace("&6Formatted &ctext &athat &3shines!");

// Removing Minecraft color codes from text
let clean_text = mcremove("&eClean &7this &ftext.");

Functions

mcwrite(text)

Allows writing text with Minecraft color codes in the terminal.

mcreplace(text)

Replaces Minecraft color codes in the text with their respective colors.

mcremove(text)

Removes Minecraft color codes from the text, leaving clean text.

Parameters

  • text: The input text containing Minecraft color codes.

Contributions and Issues

Contributions and suggestions are welcome! If you encounter any issues or want to contribute, please open an issue or pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Commit count: 0

cargo fmt