color-output
Description
- An atomic output library based on Rust that supports output functionalities through functions, builders, and other methods. It allows customization of text and background colors.
Features
- Supports formatted output of the current time.
- Allows customization of text color, background color, font weight, and other configurations.
- Supports defining structures for output messages.
- Supports defining builders for output messages.
- Supports single-line output for multiple tasks.
- Supports multi-line output for multiple tasks.
- Ensures atomic output operations.
Installation
To install color-output run cmd:
cargo add color-output
Code Examples
Struct Output
Using output Function
use *;
output;
Using output Method
use *;
Output
.output;
Array of Structs
use *;
OutputList
.output;
Builder Output
Using output Function
use *;
output;
Using output Method
use *;
new
.text
.bg_color
.color
.blod
.endl
.build
.output;
Array Builder
use *;
new_from
.add
.add
.add
.run;
Output Macros
Passing Struct
use *;
output_macro!;
Passing Builder
use *;
output_macro!;
Multiple Inputs
use *;
output_macro!;
print_success!
Outputs success information without a new line.
use *;
print_success!;
print_warning!
Outputs warning information without a new line.
use *;
print_warning!;
print_error!
Outputs error information without a new line.
use *;
print_error!;
println_success!
Outputs success information with a new line.
use *;
println_success!;
println_warning!
Outputs warning information with a new line.
use *;
println_warning!;
println_error!
Outputs error information with a new line.
use *;
println_error!;
Color Usage
ColorType::Use: Use built-in colors.ColorType::Color256: Hexadecimal colors.ColorType::Rgb: RGB color (r, g, b).
ColorType::Use
Use
ColorType::Color256
Color256
ColorType::Rgb
Rgb
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Contact
For any inquiries, please reach out to the author at ltpp-universe root@ltpp.vip.