Crate make_colors

Crate make_colors 

Source
Expand description

§make_colors

A simple, powerful and cross-platform Rust library for adding colors to your terminal output.

§Features

  • 🎨 Support for standard terminal colors (16 colors)
  • 🌈 Hex color support (#00FFFF)
  • 🎯 RGB color support (0-255 for each channel)
  • 📝 Simple and intuitive API
  • 🖋 Attributes support (bold, underline, italic, etc.)
  • 🔧 Flexible formatting with multiple notations

§Quick Start

use make_colors::*;

// Simple colored text
println!("{}", make_colors("Hello World!", "red", None));

// With background
println!("{}", make_colors("Important", "white", Some("red")));

// Using hex colors
println!("{}", make_colors_hex("Cyan text", "#00FFFF", None));

// Using RGB
println!("{}", make_colors_rgb("Custom color", (255, 100, 50), None));

Modules§

ansi
ANSI color codes for standard colors

Macros§

color
Macro to create colored text easily
color_hex
Macro for hex colors

Structs§

ColorBuilder
Builder pattern for creating colored text

Enums§

MakeColorsError
Errors that can occur when using make_colors

Functions§

hex_to_rgb
Convert hex color string to RGB tuple
make_colors
Main function to colorize text with named colors
make_colors_hex
Colorize text using hex color codes
make_colors_hex_with_attrs
Colorize text using hex colors with attributes
make_colors_rgb
Colorize text using RGB values
make_colors_rgb_with_attrs
Colorize text using RGB values with attributes
make_colors_with_attrs
Colorize text with attributes