ansi-to-tui 0.1.9

A library to convert ansi color coded text into tui::text::Text type from tui-rs library
Documentation

ansi-to-tui

Build & Tests

Parse text with ansi color codes and turn them into tui::text::Text.

Supports TrueColor ( RGB ) ( \x1b[38;2;<r>;<g>;<b>m)
Supports 8 - Bit Color ( 0..256 ) ( \x1b[38;5;<n>m )
Supports 4 - Bit Color Pallete ( \x1b[30..37;40..47m )

Example

use ansi_to_tui::ansi_to_text;
use std::io::Read;

let mut file = std::fs::File::open("ascii/text.ascii").unwrap();
let mut buffer: Vec<u8> = Vec::new();
file.read_to_end(&mut buffer);
let text = ansi_to_text(buffer);

A naive implementation, relatively fast.
Probably lots of room for improvement.