| Crates.io | tinterm |
| lib.rs | tinterm |
| version | 0.2.0 |
| created_at | 2024-12-12 08:03:34.405905+00 |
| updated_at | 2025-09-24 19:25:37.252218+00 |
| description | A powerful library for vibrant solid and gradient text with shimmer animations in terminal outputs. |
| homepage | https://github.com/bratish/Tinterm |
| repository | https://github.com/bratish/Tinterm |
| max_upload_size | |
| id | 1480964 |
| size | 103,268 |
A powerful and ergonomic Rust library for creating beautiful, colorful terminal output with stunning shimmer animations inspired by modern CLI tools.
Add tinterm to your Cargo.toml:
[dependencies]
tinterm = "0.2.0"
Basic usage:
use tinterm::*;
fn main() {
// Simple colors
println!("{}", "Hello World!".color(Color::RED));
// Gradients
println!("{}", "Rainbow Text".gradient(Color::RED, Color::BLUE, None));
// ✨ NEW: Shimmer animations!
println!("{}", "Shimmering Text".shimmer(Color::GOLD, None).static_render());
// Chainable styling
println!("{}", "Styled Text".bold().color(Color::GREEN).bg(Color::BLACK));
}
The crown jewel of tinterm v0.2.0 - beautiful animated text effects:
use tinterm::*;
// Create a shimmering effect
let shimmer = "✨ Amazing Text ✨".shimmer(Color::GOLD, None);
// Static render for single display
println!("{}", shimmer.static_render());
// Live animation for 3 seconds
shimmer.animate(3);
// Wave-like shine animation
let shine = "🌟 Sparkling Text 🌟".shine(Color::CYAN);
shine.animate(2);
// Pulsing glow animation
let glow = "💫 Glowing Text 💫".glow(Color::PURPLE, 200);
glow.animate(4);
// Animated gradient effects
let gradient_shimmer = "🌈 Rainbow Magic 🌈"
.shimmer_gradient(Color::RED, Color::VIOLET, None)
.speed(150);
gradient_shimmer.animate(5);
// Customize speed, background, and intensity
let custom = "Custom Effect"
.shimmer(Color::BLUE, Some(Color::BLACK))
.speed(80) // Animation speed in milliseconds
.intensity(220); // Effect intensity (0-255)
custom.animate(3);
use tinterm::*;
// Use any of 140+ predefined colors (see COLORS.md for full visual reference)
println!("{}", "Fire".color(Color::RED));
println!("{}", "Ocean".color(Color::DEEP_SKY_BLUE));
println!("{}", "Forest".color(Color::FOREST_GREEN));
println!("{}", "Sunset".color(Color::ORANGE));
// RGB values
let custom = Color::new(255, 128, 64);
println!("{}", "Custom Color".color(custom));
// Hex colors
let hex_color = Color::from_hex("#FF8040").unwrap();
println!("{}", "Hex Color".color(hex_color));
// Short hex
let short_hex = Color::from_hex("#F80").unwrap();
println!("{}", "Short Hex".color(short_hex));
// Foreground gradients
println!("{}", "Gradient Text".gradient(Color::RED, Color::BLUE, None));
// Background gradients
println!("{}", "Background Gradient".gradient_bg(Color::GREEN, Color::PURPLE, None));
// Multi-line gradients
let multiline = "Line 1\nLine 2\nLine 3";
println!("{}", multiline.gradient(Color::CYAN, Color::MAGENTA, Some(true)));
use tinterm::*;
// Basic styling
println!("{}", "Bold Text".bold());
println!("{}", "Italic Text".italic());
println!("{}", "Underlined".underline());
println!("{}", "Strikethrough".strikethrough());
// Advanced styling
println!("{}", "Dim Text".dim());
println!("{}", "Bright Text".bright());
println!("{}", "Reversed".reverse());
println!("{}", "Blinking".blink());
// Method chaining
println!("{}",
"Fancy Text"
.bold()
.italic()
.color(Color::GOLD)
.bg(Color::DARK_BLUE)
);
use tinterm::*;
// Success, warning, error indicators
println!("Status: {} Success", "●".color(Color::GREEN));
println!("Status: {} Warning", "●".color(Color::YELLOW));
println!("Status: {} Error", "●".color(Color::RED));
// With shimmer for important notifications
println!("{}",
"🎉 Deployment Complete!"
.shimmer(Color::GREEN, None)
.static_render()
);
use tinterm::*;
fn show_progress(percent: usize) {
let filled = "█".repeat(percent / 5);
let empty = "░".repeat(20 - percent / 5);
println!("Progress: [{}{}] {}%",
filled.color(Color::GREEN),
empty.color(Color::DARK_GRAY),
percent
);
}
show_progress(75);
use tinterm::*;
println!("{} {} {} {}",
"fn".color(Color::PURPLE),
"main".color(Color::BLUE),
"()".color(Color::YELLOW),
"{".color(Color::WHITE)
);
Tinterm is optimized for performance:
use tinterm::*;
use std::time::Instant;
let start = Instant::now();
for i in 0..10000 {
let _colored = format!("Line {}", i).color(Color::BLUE);
}
let duration = start.elapsed();
println!("Rendered 10,000 colored strings in: {:?}", duration);
// Typical result: ~2-5ms
Run the included examples to see tinterm in action:
# Comprehensive feature demo
cargo run --example comprehensive_demo
# Shimmer animation showcase
cargo run --example shimmer_showcase
# CLI tools simulation
cargo run --example cli_tools
# ASCII art and creativity
cargo run --example art_and_logos
TextModifier: Colors and text stylingGradient: Gradient effectsShimmer: Animation effects (NEW!).color(color) / .fg(color): Set foreground color.bg(color): Set background color.gradient(start, end, block): Apply gradient.shimmer(color, bg): Create shimmer effect ✨.shine(color): Create shine effect ✨.glow(color, intensity): Create glow effect ✨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.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ✨ by Bratish Goswami
Transform your terminal output from boring to brilliant with tinterm!