A Rust library for colorizing console output with cute gradients.
- Extension trait API (
"text".gradient()
) - Builder API (
Cutifier::new()
) - Stateful API for persistent gradients
- Built-in color palettes
- Hue range filtering
- Gradient directions
- Configurable parameters
- Custom writer support
Note
Windows Compatibility
- These features require Windows 10+ or a modern terminal
- Stateful API:
cute!()
,cuteprintln!()
,cuteprint!()
macros - Extension trait API:
Display
formatting ofCutifiedString
- Stateful API:
use cutify::Cutify;
println!("{}", "Hello World".gradient());
println!("{}", "Pastel colors".pastel());
println!("{}", "Ocean vibes".ocean());
println!("{}", "Only purples".purples());
Fine-grained control with method chaining:
use cutify::{Cutifier, ColorPalette, GradientDirection};
Cutifier::new("Custom gradient")
.palette(ColorPalette::Sunset)
.direction(GradientDirection::Diagonal)
.hue_shift(15.0)
.print();
// Write to custom buffer
let mut buffer = Vec::new();
Cutifier::new("To buffer")
.palette(ColorPalette::Fire)
.write_to(&mut buffer)?;
Continue gradients across multiple prints:
use cutify::{cuteprintln, cute};
cuteprintln!("This continues");
cuteprintln!("the same gradient");
let colored = cute!("across calls");
palette(ColorPalette)
- Apply predefined color schemehue_range(HueRange)
- Limit colors to specific hue rangedirection(GradientDirection)
- Set gradient directionsaturation(f32)
- Adjust color saturation (0.0-1.0)lightness(f32)
- Adjust color lightness (0.0-1.0)hue_shift(f32)
- How much the hue changes per step (degrees, default: 12.0)step(f32)
- How often the color changes (characters per step, default: 1.0)step(3.0)
means every 3rd character gets a new color- Combine with
hue_shift
for control:step(2.0).hue_shift(30.0)
= big color jumps every 2 chars
scale(f32)
- Alternative to hue_shift: characters for full gradient cycle (e.g., 10.0=completes in 10 chars, 0=disabled)base_hue(f32)
- Set starting hue (0-360)random_hue()
- Randomize base huereverse()
- Reverse gradient direction
Run examples:
cargo run --example demo
MIT