Crate coloriz[][src]

Expand description

A library for Rust that provides utilities to colorizing terminal outputs and styling strings.

Coloriz helps to make your terminal colorful.

Quick Example

use coloriz::*;

fn main() {
    let text = "Lorem ipsum";
    println!("{}", text.fg(Color::Cyan));
    println!("{}", text.bg(Color::BrightBlack).fg(Color::Red));
    println!("{}", text.fg(HSL::new(0.03, 0.7, 0.666)));
    println!("{}", text.fg((167, 232, 78)); // the same as text.fg(RGB::new(167, 232, 78))
    println!("{}", text.fg_gradient(RGB::from_hex(0xFF6712), RGB::from_hex(0x1087FF)));
    println!("{}", Color::BrightMagenta.to(text));
    println!("{}", Color::BrightMagenta.under(text));
}

Re-exports

pub use color::*;
pub use colorize::*;
pub use gradient::*;
pub use style::*;

Modules

color

Color types

colorize
gradient
style

Text styles

Structs

ColoredText

A string that may be colorized

Traits

ColorApply

A Color that can apply to text