anscape 0.2.2

Anscape provides a simple way to customize your terminal window with some styles and colors and manipulate with a cursor position using ANSI Escape Sequences.
Documentation
  • Coverage
  • 91.47%
    118 out of 129 items documented5 out of 22 items with examples
  • Size
  • Source code size: 14.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.12 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • arg2u/anscape
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • arg2u

Latest Version | Documentation

Anscape provides a simple way to customize your terminal window with some styles and colors and manipulate with a cursor position using ANSI Escape Sequences.

Features

  • 256-color mode.
  • Cursor movement.
  • Text formatting.
  • Console size.
  • Erasing.

Examples

Style and colors

use anscape::{
    seq::colors::*,
    seq::styles::*, 
    seq::base::*, 
};

fn main() {
    // Basic foregroung
    println!("{}{}Red bold text, {}{} Green Italic{}", RED, BOLD, GREEN, ITALIC, RESET);

    // Basic background
    println!("{}{}Red BG for bold text, {}{} Green BG for italic text{}", RED_BG, BOLD, GREEN_BG, ITALIC, RESET);

    // RGB foreground
    println!("{}Here's red RGB color{}", rgb_fg(255, 0, 0), RESET);

    // RGB background
    println!("{}Here's red RGB BG color{}", rgb_bg(255, 0, 0), RESET);
}

Moving the cursor

use anscape::seq::cursor;

fn main() {
    println!("{}Move to line 1 col 1", cursor::move_to(100, 100));
}

Erase

use anscape::seq::erase::*;

fn main() {
    println!("{}Erase", FROM_CURSOR_TO_BEGINING_OF_SCREEN);
}

License

MIT