A terminal style toolkit inspired by CSS and lipgloss for truecolor 24-bit terminals.
terminal
cargo add kimono
Unicode text can be styled, padded, and bordered.
```rust use kimono::*;
const STYLE: Style = Style::new() .paddingtop(1) .paddingleft(1) .paddingright(2) .paddingbottom(3) .border(1) .borderstyle(BORDERSTYLEOUTLINE) .bordercolor(0xddae74) .border_background(0xbc5633) .color(0xebdeb8) .background(0x407955);
fn main() { print!("{}{}", ClearScreen, CursorMove::XY(10, 3)); STYLE.render("着物"); print!("{}", CursorMove::XY(-10, 3)); } ```
Text can be constrained to height and width.
```rust use kimono::*;
const STYLE: Style = Style::new() .padding(1) .color(0xfffd7c) .width(8) .background(0x956471);
fn main() { print!("{}{}", ClearScreen, CursorMove::XY(10, 3)); STYLE.render(text); print!("{}", CursorMove::XY(-10, 3)); println!("{:?}", STYLE.measure("abcdefghijklmno")); } ```
Text can be measured.
terminal
(8, 5)
```rust use kimono::*;
const STYLE: Style = Style::new() .padding(1) .color(0xfffd7c) .width(8) .background(0x956471);
fn main() { println!("{:?}", STYLE.measure("abcdefghijklmno")); } ```
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in kimono
by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.