pealn 0.2.0

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
Documentation

Pealn

Pealn is a Rust library for printing coloured text to make your CLI app beautiful as a Peacock

Features

  • 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

Installation

Add Pealn to your Cargo.toml:

[dependencies]

pealn = "0.1"

Add Pealn using Cargo CLI:

cargo add Pealn

Available macros to print colored and styled text

pea!("hello world"); // to print on same line
pealn!("hello world"); // to print on next line

print new line with colored and styles

Format

[foreground,background,styles....](text) 

Available Colors

red, green, blue, yellow, cyan,purple , magenta, black, white

Available Styles

bold, dim, italic, underline, blink, reverse, hidden, strikethrough

*Note:Some styles are not supported on every console , like blink,reverse and dim

Examples

To print text with foreground

use pealn::{pealn};
pealn!("[yellow](Hello) [green](World)!");
let name  = "Subham Shaw";
pealn!("[yellow,bold](Name) : [bold,hidden]({}) " , name );

you can use RGB color

 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)!");

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,white,italic](World)!");

Pealn makes your CLI apps more colorful and expressive!