🎨 Polychrome
✨ Features
- 🌈 RGB and Hex Colors: Full truecolor support with easy-to-use APIs
- 🎨 Background Colors: Style text with colorful backgrounds
- 📝 Text Styling: Bold, italic, dim, blink, and more
- 🌊 Gradient Effects: Create beautiful color transitions
- 🌈 Polychrome Text: Automatic polychrome coloring
- 📊 Progress Bars: Built-in customizable progress indicators
- 🖥️ Terminal Utils: Cursor control, screen clearing, and more
- 🚀 Zero Dependencies: Lightweight and fast
- 🔗 Chainable API: Intuitive method chaining
- 🦀 Memory Safe: Built with Rust's safety guarantees
🚀 Quick Start
Add Polychrome to your Cargo.toml:
[]
= "3.0.0"
Then start styling your terminal output:
use ;
📖 Examples
Basic Text Styling
use ;
// Colors and styles
println!;
println!;
println!;
// Background colors
println!;
Advanced Effects
use ;
// Gradient text
let gradient = gradient;
println!;
// Polychrome effect
let polychrome = polychrome;
println!;
Progress Bars
use ProgressBar;
let bar = new.color;
println!;
// Custom characters
let custom_bar = new.chars;
println!;
Predefined Colors
use colors;
println!;
println!;
println!;
Available colors: RED, GREEN, BLUE, YELLOW, CYAN, MAGENTA, WHITE, BLACK, ORANGE, PURPLE, PINK, BROWN
Terminal Utilities
use utils;
// Clear screen and move cursor
clear_screen;
move_cursor;
// Hide/show cursor
hide_cursor;
show_cursor;
// Check color support
if supports_color
🎨 Underline Styles
use UnderlineStyle;
println!;
println!;
println!;
println!;
println!;
println!;
🔗 Method Chaining
Polychrome supports intuitive method chaining for complex styling:
use ;
println!;
🖥️ Terminal Compatibility
Polychrome works with modern terminals that support ANSI escape codes and 24-bit colors:
- ✅ Windows Terminal
- ✅ iTerm2 (macOS)
- ✅ GNOME Terminal (Linux)
- ✅ Alacritty
- ✅ Kitty
- ✅ VS Code Terminal
- ⚠️ CMD (Windows) - Limited support
🚀 Performance
Polychrome is designed to be fast and lightweight:
- Zero runtime dependencies
- Minimal memory allocations
- Efficient string formatting
- No heap allocations for basic styling
📊 Migration from v2.x
If you're upgrading from Polychrome v2.x:
// Old v2.x API
use ColorPrintExt;
println!;
// New v3.0 API (recommended)
use ;
println!;
📚 Documentation
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
📄 License
This project is licensed under the MIT OR Apache-2.0 license.