Skip to content
프로젝트

소개

Convert ansi colored text to tui::text::Text

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
기록 수집 중
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

ansi-to-tui

Crate Badge Repo Badge
Docs Badge License Badge
CI Badge Codecov Badge

Convert ANSI color and style codes into Ratatui Text.

This crate parses bytes containing ANSI SGR escape sequences (like \x1b[31m). It produces a Ratatui Text with equivalent foreground/background Color and Modifier settings via Style.

Unknown or malformed escape sequences are ignored so you can feed it real terminal output without having to pre-clean it.

Color Mode Supported SGR Example Ratatui Color Example
Named (3/4-bit, 8/16-color) ✓ \x1b[30..37;40..47m Color::Blue
Indexed (8-bit, 256-color) ✓ \x1b[38;5;<N>m Color::Indexed(1)
Truecolor (24-bit RGB) ✓ \x1b[38;2;<R>;<G>;<B>m Color::Rgb(255, 0, 0)

Minimum Supported Rust Version

Rust 1.88 or newer is required.

Example

use ansi_to_tui::IntoText as _;
let buffer = std::fs::read("ascii/text.ascii")?;
let output = buffer.into_text()?;

Contributing and CI details are in CONTRIBUTING.md.

관련 프로젝트 살펴보기

불러오는 중…