kimono

docs.rs docs

A terminal style toolkit inspired by CSS and lipgloss for truecolor 24-bit terminals.

terminal cargo add kimono

Example

Unicode text can be styled, padded, and bordered.

Screen Shot 2022-07-23 at 5 01 28 PM

```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() { clearscreen(); STYLE.renderat_position(10, 3, "着物"); print!("\n\r"); } ```

Text can be constrained to height and width.

Screen Shot 2022-07-23 at 9 17 45 PM

```rust use kimono::*;

const STYLE: Style = Style::new() .padding(1) .color(0xfffd7c) .width(8) .background(0x956471);

fn main() { clearscreen(); STYLE.renderat_position(10, 3, text); print!("\n\r"); } ```

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")); } ```

Borders have advanced styling.

Screen Shot 2022-07-24 at 10 53 02 AM

```rust use kimono::*;

const STYLE: Style = Style::new() .padding(1) .color(0xe46281) .background(0xc50f47) .border(1) .italic() .borderstyle(BorderStyle { topleft: Some(' '), top: Some('•'), topright: Some(' '), left: Some('•'), right: Some('•'), bottomleft: Some(' '), bottom: Some('•'), bottomright: Some(' '), bold: true, italic: false, underline: false, strikethrough: false, }) .bordercolor(0xe5c7c9) .border_background(0x9e1d49);

fn main() { clearscreen(); STYLE.renderat_position(10, 3, "The Tale of Genji by 紫 式部"); print!("\n\r"); } ```

License

This project is licensed under either of

at your option.

Contribution

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.