chromakopia
Beautiful terminal string gradients and animations for Rust. A port of gradient-string and chalk-animation, built on colored + tokio.
Gradients
use ;
// Custom gradient
println!;
// HSV interpolation
println!;
// Presets
println!;
// Multiline (column-aligned, great for ASCII art)
println!;
17 presets: atlas, cristal, teen, mind, morning, vice, passion, fruit, instagram, retro, summer, rainbow, pastel, dark_n_stormy, mist, relic, flughafen
Animations
Standalone animations run on a background tokio task with start/stop control:
use animate;
let anim = rainbow;
// ... do async work ...
anim.replace;
anim.stop;
Effects: rainbow, pulse, glitch, radar, neon, karaoke
Gradient-parameterized: glow(gradient, ...), cycle(gradient, ...)
Split-flap board: flap(...), flap_with(gradient, ...)
Sequences
Chain animations with fades and transitions:
use ;
use Duration;
new
.glow
.with_fade
.fade_to_gradient
.run
.await;
Sequence steps
.glow(gradient, duration)— sweeping glow.rainbow(duration)— HSV hue shift.cycle(gradient, duration)— scrolling gradient.flap(duration)— split-flap departure board.flap_with(gradient, duration)— split-flap with custom colors.hold(color, duration)— static colored text.fade_in(duration)/.fade_out(duration)— fade from/to black
Fade modifiers (applied to last step)
.with_fade(fade_in, fade_out)— fade to/from background (text disappears).fade_to_foreground(duration)— settle into terminal's text color.fade_to_color(color, duration)— settle into a specific color.fade_to_gradient(gradient, duration)— settle into a static gradient.eased(Easing)— apply an easing curve to the last fade
Easing curves
All fade transitions support easing via .eased():
use Easing;
new
.glow
.with_fade
.eased
.fade_to_gradient
.eased
.run
.await;
Built-in curves: Linear, EaseIn, EaseOut, EaseInOut, CubicBezier(x1, y1, x2, y2)
Layer API (power-user)
Place effects and fades at explicit time ranges for full compositional control:
use ;
new
.effect
.fade
.fade
.run
.await;
Effect factories: rainbow_effect(), glow_effect(gradient), cycle_effect(gradient), flap_effect(settled, flipping)
Terminal detection
Auto-detects terminal background (OSC 11) and foreground (OSC 10) colors for seamless fades. Override with set_bg_color() / set_fg_color().
Examples
# Individual animations