| Crates.io | pealn |
| lib.rs | pealn |
| version | 0.4.1 |
| created_at | 2025-06-18 18:29:48.750759+00 |
| updated_at | 2025-07-16 09:37:09.70953+00 |
| description | Intuitive way to print colored and styled text to console ,use predefined and RGB colors , use text styles , using ANSI, #terminal #console #colors #text #print #pealn #win #windows #ansi |
| homepage | |
| repository | https://github.com/subham008/Pealn |
| max_upload_size | |
| id | 1717474 |
| size | 186,094 |
Pealn is a Rust library for printing coloured text to make your CLI app beautiful as a Peacock
Fatest Pealn is fastest among other famous ones. see benchmarks
Compile time format pealn codes during compile time i,e [red](name) converted to \x1b[38;2;255;0;0m name \x1b[0m during compile time
Easy to use Apply modification inside string
Pre defined Colors Common colors are already defined
Text Styles Add Styles like , bold , italic , underline and more
Use RGB colors Apply colors using RGB value
| Traditional Rust Macro | Pealn Macro Alternative |
|---|---|
print!() |
pea!() |
println!() |
pealn!() |
write!() |
pealn_write!() |
writeln!() |
pealn_writeln!() |
format!() |
pealn_format!() |
eprint!() |
pealn_eprint!() |
eprintln!() |
pealn_eprintln!() |
Add Pealn to your Cargo.toml:
[dependencies]
pealn = "0.3"
Add Pealn using Cargo CLI:
cargo add Pealn
print new line with colored and styles
[foreground,background,styles....](text)
| Name | Preview | Example Code |
|---|---|---|
| Red | ■ | [red](text) |
| Green | ■ | [green](text) |
| Blue | ■ | [blue](text) |
| Yellow | ■ | [yellow](text) |
| Cyan | ■ | [cyan](text) |
| Purple | ■ | [purple](text) |
| Magenta | ■ | [magenta](text) |
| Black | ■ | [black](text) |
| White | ■ | [white](text) |
Note: Color preview may not render
| Style | Example Code | Description |
|---|---|---|
| Bold | [bold](text) |
Bold text |
| Dim | [dim](text) |
Dim/faint text |
| Italic | [italic](text) |
Italic text |
| Underline | [underline](text) |
Underlined text |
| Blink | [blink](text) |
Blinking text (not always supported) |
| Reverse | [reverse](text) |
Reverse video |
| Hidden | [hidden](text) |
Hidden text |
| Strikethrough | [strikethrough](text) |
Some styles may not be supported in all terminals.
To print text with foreground
use pealn::{pealn};
pealn!("[yellow](Hello) [green](World)!");
To print text with background
use pealn::{pealn};
pealn!("[default,yellow](Hello) [default,green](World)!");
you can use RGB color too
use pealn::{pealn};
pealn!("[(25,45,78)](Hello) [(34,67,78)](World)!");
To print text with foreground and background
use pealn::{pealn};
pealn!("[yellow,white](Hello) [green,white](World)!");
First color defined is always considers as foreground and second color as background color, even if you put style in middle it will behave same
To print text with styles
use pealn::{pealn};
pealn!("[bold,underline](Hello) [italic](World)!");
To print text with color and styles
use pealn::{pealn};
//here order of colors and styles does not matter,
//first color will be used as foreground and second as background
pealn!("[red,green,bold,underline](Hello) [yellow,italic,white](World)!");
We welcome contributions!
Please see CONTRIBUTING.md for guidelines.
Pealn makes your CLI apps more colorful and expressive!