Skip to main content

Crate neco_tui

Crate neco_tui 

Source
Expand description

外部依存ゼロの最小 ANSI ターミナルヘルパー。

SGR (Select Graphic Rendition) エスケープシーケンスによるテキスト装飾と、 複数スタイルの合成を提供する。

§使い方

use neco_tui::{style, Color, Style};

// 単一スタイル
let text = style("hello").fg(Color::Cyan).bold().to_string();
assert!(text.starts_with("\x1b["));
assert!(text.ends_with("\x1b[0m"));

// リセットのみ
assert_eq!(Style::RESET, "\x1b[0m");

Structs§

Style
テキスト装飾の定数。
Styled
スタイル付きテキストのビルダー。

Enums§

Color
SGR 前景色。

Functions§

style
テキストにスタイルを適用するビルダーを返す。