Dekor
Simple to use general character and styling library for Rust, designed to enhance console output with various text styles and UTF-8 characters.
Features
- Ease of Use: Apply multiple text styles with a single macro call or function.
- Safety: Macro compile-time checks prevent the use of invalid style names.
- Flexible Styling:: The
style!()macro supports.- Generating styled strings for console output using
ANSIcodes. - Coloring text foreground and background.
- Applying bold, underline(Markdown doesn't do underlined), and italicize the text in any combination
- Generating styled strings for console output using
- RGB Color Support: Apply custom text colors using RGB values.
- Comprehensive Character Set: The
Utf8enum provides various UTF-8 characters- Intention is to complete the list of characters over time
- Character list source: https://www.fileformat.info/info/charset/UTF-8/list.htm
- Implements
Displayand has the function.repeat(n)wherenisusize
Getting Started
To start using Dekor, add the following to your Cargo.toml:
[]
= "0.2.1"
- Minimum supported Rust version:
1.56.1
Usage
Basic Text Styling
use *;
Using RGB Colors
use *;
Working with UTF-8 Characters
use *;
Example Output:

- Characters:
Utf8::VPipeSlim,Utf8::JointPipeSlim,Utf8::NodePipeCurved,Utf8::HPipeSlim, andUtf8::ModLetterDownArrowhead - Styles:
FGBlue,Bold

use *;
Goals
- Create a macro which allows for text styling
- Allow for handling RGB and Hex inputs
- Provide function implementations of the macros for a more robust approach
- Import characters necessary for file tree display
- Import the remaining UTF-8 characters
- Look into using escape keys for these characters as some of them do not display properly
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
._. why would you do this?
- Assisting with importing all characters into the characters library would help greatly, just branch and make a pull request. Do your best to use the provided link and their naming schema to keep things consistent.