cli-colors 1.0.0

A CLI tool for outputting text in ANSI format with features like colors, underlining, boldening, and italicizing
Documentation
  • Coverage
  • 0%
    0 out of 67 items documented0 out of 50 items with examples
  • Size
  • Source code size: 13.72 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.92 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • BrianIAm/cli-color
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • BrianIAm

cli-colors

cli-colors is a Rust library that provides a simple way to add ANSI color and formatting to your command-line interface (CLI) applications. With cli-color, you can easily add underlines, bold text, italics, and various colors to your CLI output.

Features

  • Easy-to-use API for adding color and formatting to CLI text
  • Support for common text styles:
    • Bold
    • Italic
    • Underline
  • Wide range of color options for both foreground and background
  • Combine multiple styles and colors

Installation

Add this to your Cargo.toml:

[dependencies]

cli-colors = "1.0.0"

Usage

Here's a quick example of how to use cli-colors:

use cli_colors::Colorizer;

fn main() {
    let colorizer = Colorizer::new();
    
    println!("{}", colorizer.black("Black"));
    println!("{}", colorizer.blue("Blue"));
    println!("{}", colorizer.bold("Bold"));
    println!("{}", colorizer.bright_black("Bright Black"));
    println!("{}", colorizer.bright_red("Bright Red"));
    println!("{}", colorizer.cyan("Cyan"));
    println!("{}", colorizer.green("Green"));
    println!("{}", colorizer.italic("Italic"));
    println!("{}", colorizer.magenta("Magenta"));
    println!("{}", colorizer.red("Red"));
    println!("{}", colorizer.strikethrough("Strikethrough"));
    println!("{}", colorizer.underline("Underline"));
    println!("{}", colorizer.white("White"));
    println!("{}", colorizer.yellow("Yellow"));
    println!("{}", colorizer.rgb("Custom", 255, 0, 255));
    println!("{}", colorizer.rainbow("THIS IS A PRETTY RAINBOW WOOT WOOT"));
    println!("{}", colorizer.bg_rainbow("THIS IS A PRETTY RAINBOW WOOT WOOT"));
}

License

This project is licensed under the MIT