5 releases

0.1.4 Sep 26, 2022
0.1.3 Sep 26, 2022
0.1.2 Sep 25, 2022
0.1.1 Sep 25, 2022
0.1.0 Sep 25, 2022

#5 in #bold

MIT license

13KB
227 lines

Ctrem

print colored and styled text

CLI Examples

$ctrem "[bold]H[/]ello"

Rust Example

use ctrem::*;

cprintln("[bold][blink]Hello[/], world![/]"); 

prints Hello, world! in bold and blinks Hello

Available style

  • Default
  • Bold
  • Dim
  • Italic
  • Underline
  • Blink
  • Normal
  • Reverse
  • Strike

Available colors

  • Black
  • Red
  • Green
  • Yellow
  • Blue
  • Magenta
  • Cyan
  • White

Supported 8bit (256) also 24 bit (16.7 million) colors

Foreground is default , for background use ' * '

Cterm supported different styles and colors styles or colors palette must be inclosed in [palette] and ends with [/]

  • For bold text use [bold]some text[/]

  • For underline text use [underline] some text[/]

  • For RGB colored text use [rgb 25,55,55]some text[/] or [#b366b1]some text[/]

  • For 4bit colors use [color 4]some text[/]

command palette must end , use [//] to end all

Foreground is default , for background use ' * '

Rust Example Colors

use ctrem::*;
fn main(){
    cprintln("[bold][blink][red]Hello[//],[green]world[*blue]![//]"); 
}

Dependencies

~2.2–3MB
~55K SLoC