Use styled chunks of text instead of plain strings

This commit is contained in:
Joscha 2022-07-04 10:55:25 +02:00
parent 761519c1a7
commit 9b0d80873f
8 changed files with 209 additions and 66 deletions

View file

@ -6,13 +6,14 @@ use toss::terminal::Terminal;
fn draw(f: &mut Frame) {
f.write(
Pos::new(0, 0),
"Hello world!",
ContentStyle::default().green(),
("Hello world!", ContentStyle::default().green()),
);
f.write(
Pos::new(0, 1),
"Press any key to exit",
ContentStyle::default().on_dark_blue(),
(
"Press any key to exit",
ContentStyle::default().on_dark_blue(),
),
);
f.show_cursor(Pos::new(16, 0));
}