Crates.io | anscape |
lib.rs | anscape |
version | 0.2.2 |
source | src |
created_at | 2022-08-15 16:45:24.225 |
updated_at | 2022-08-18 18:52:25.797333 |
description | 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. |
homepage | |
repository | https://github.com/arg2u/anscape |
max_upload_size | |
id | 646027 |
size | 14,314 |
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.
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);
}
use anscape::seq::cursor;
fn main() {
println!("{}Move to line 1 col 1", cursor::move_to(100, 100));
}
use anscape::seq::erase::*;
fn main() {
println!("{}Erase", FROM_CURSOR_TO_BEGINING_OF_SCREEN);
}
MIT