bright

Crates.iobright
lib.rsbright
version0.4.1
sourcesrc
created_at2019-06-17 08:17:28.365934
updated_at2021-05-20 03:08:18.033707
descriptionBeautiful terminal color
homepagehttps://github.com/wyhaya/bright
repositoryhttps://github.com/wyhaya/bright.git
max_upload_size
id141694
size14,490
(wyhaya)

documentation

README

bright

Crates.io LICENSE

preview

Beautiful terminal color

Install

Add this in your Cargo.toml:

[dependencies]
bright = "*"

Usage

use bright::*;
use std::io::{stdout, Write};

fn main() {
    println!("{}", "Hello world".bold().red().bg_green());
    
    // stdout
    let ansi = Bright::new("Hello world").red().to_string();
    stdout().write(ansi.as_bytes());
}

Styles

Modifiers

  • .bold()
  • .dim()
  • .italic()
  • .underline()
  • .slow_blink()
  • .fast_blink()
  • .invert()
  • .hidden()
  • .cross_out()

Colors

  • .black()
  • .red()
  • .green()
  • .yellow()
  • .blue()
  • .magenta()
  • .cyan()
  • .white()
  • .rgb(r, g, b)

Background colors

  • .bg_black()

  • .bg_red()

  • .bg_green()

  • .bg_yellow()

  • .bg_blue()

  • .bg_magenta()

  • .bg_cyan()

  • .bg_white()

  • .bg_rgb(r, g, b)

Commit count: 11

cargo fmt