Crates.io | qute |
lib.rs | qute |
version | 0.0.13 |
source | src |
created_at | 2020-09-26 14:13:15.035363 |
updated_at | 2020-11-17 11:32:56.640207 |
description | designify your terminal with a large ansi colors palette đ¨ |
homepage | https://github.com/qurity |
repository | https://github.com/qurity/qute |
max_upload_size | |
id | 293162 |
size | 58,183 |
designify your terminal with a large ansi colors palette đ¨
Examples â API â Goals â License
a nice ANSI escape codes API
to use ansi color in a elegant way that support 8 color, 16 color, 88 color, 256 color and 16 millions color mode. You can manage the color mode by yourself, you got the control dude!
snippet
extern crate qute;
use qute::prelude::*;
fn main () {
let quted = qute!("my string").background_black().white();
println!("{}", quted);
}
extern crate qute;
use qute::prelude::*;
fn main () {
let quted = style!({
value: "my string";
color: "purple";
background: "black";
font-weight: none;
});
println!("{}", quted);
}
cargo
example | command |
---|---|
256 | cargo run --example hello_colors |
basic | cargo run --example basic |
css | cargo run --example css |
rgb | cargo run --example rgb |
Add the following to your Cargo.toml:
[dependencies]
qute = "0.0.13"
Now you can use the crate in your code
extern crate qute;
the qute!
macro contains all method to designify your terminal as you want. Select Graphic Rendition
are parameters applied into the escape sequence format string. See the SGR
table below
no params
returns
self
{ Designer }: the current instance
color | snippet | preview |
---|---|---|
bold | qute!("my string").bold() |
|
dim | qute!("my string").dim() |
|
underlined | qute!("my string").underline() |
|
blink | qute!("my string").blink() |
|
reverse | qute!("my string").reverse() |
|
hidden | qute!("my string").hidden() |
|
strikethrough | qute!("my string").strikethrough() |
no params
returns
self
{ Designer }: the current instance
color | snippet | preview |
---|---|---|
black | qute!("my string").black() |
|
red | qute!("my string").red() |
|
green | qute!("my string").green() |
|
yellow | qute!("my string").yellow() |
|
blue | qute!("my string").blue() |
|
magenta | qute!("my string").magenta() |
|
cyan | qute!("my string").cyan() |
|
gray | qute!("my string").gray() |
|
light_red | qute!("my string").light_red() |
|
light_green | qute!("my string").light_green() |
|
light_yellow | qute!("my string").light_yellow() |
|
light_blue | qute!("my string").light_blue() |
|
light_magenta | qute!("my string").light_magenta() |
|
light_cyan | qute!("my string").light_cyan() |
|
white | qute!("my string").white() |
no params
returns
self
{ Designer }: the current instance
color | snippet | preview |
---|---|---|
black | qute!("my string").background_black() |
|
red | qute!("my string").background_red() |
|
green | qute!("my string").background_green() |
|
yellow | qute!("my string").background_yellow() |
|
blue | qute!("my string").background_blue() |
|
magenta | qute!("my string").background_magenta() |
|
cyan | qute!("my string").background_cyan() |
|
gray | qute!("my string").background_gray() |
|
light_red | qute!("my string").background_light_red() |
|
light_green | qute!("my string").background_light_green() |
|
light_yellow | qute!("my string").background_light_yellow() |
|
light_blue | qute!("my string").background_light_blue() |
|
light_magenta | qute!("my string").background_light_magenta() |
|
light_cyan | qute!("my string").background_light_cyan() |
|
white | qute!("my string").background_white() |
params
n
{ u8 }: the color number - from 0 to 255
returns
self
{ Designer }: the current instance
mode | snippet | preview |
---|---|---|
foreground | qute!("my string").set_color(231) |
|
background | qute!("my string").set_background(220) |
params
r
{ u8 }: the standard red
g
{ u8 }: the standard green
b
{ u8 }: the standard blue
returns
self
{ Designer }: the current instance
mode | snippet | preview |
---|---|---|
foreground | qute!("my string").set_rgb_color(255, 255, 255) |
|
background | qute!("my string").set_rgb_background(128, 128, 128) |
CSS colors keyword are supported. See the complete list here
params
keyword
{ String }: the css color keyword
returns
self
{ Designer }: the current instance
mode | snippet | preview |
---|---|---|
foreground | qute!("my string").set_css_color("lime") |
|
background | qute!("my string").set_css_background("aquamarine") |
Copyright Šī¸ 2020 Qurity
Released under the MIT license