https://github.com/junkdog/tachyonfx Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} junkdog / tachyonfx Public * Notifications You must be signed in to change notification settings * Fork 2 * Star 272 * shader-like effects library for ratatui applications License MIT license 272 stars 2 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights junkdog/tachyonfx This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 30 Commits examples examples images images src src .gitignore .gitignore CHANGELOG.md CHANGELOG.md Cargo.toml Cargo.toml LICENSE LICENSE README.md README.md View all files Repository files navigation * README * MIT license tachyonfx tachyonfx is a ratatui library for creating shader-like effects in terminal UIs. This library provides a collection of effects that can be used to enhance the visual appeal of terminal applications, offering capabilities such as color transformations, animations, and complex effect combinations. demo Installation Add tachyonfx to your Cargo.toml: [dependencies] tachyonfx = "0.2.0" Overview Effects The library includes a variety of effects, categorized as follows: Color Effects * fade_from: Fades from the specified background and foreground colors * fade_from_fg: Fades the foreground color from a specified color. * fade_to: Fades to the specified background and foreground colors. * fade_to_fg: Fades the foreground color to a specified color. * hsl_shift: Changes the hue, saturation, and lightness of the foreground and background colors. * hsl_shift_fg: Shifts the foreground color by the specified hue, saturation, and lightness over the specified duration. * term256_colors: Downsamples to 256 color mode. Text/Character Effects * coalesce: The reverse of dissolve, coalesces text over the specified duration. * dissolve: Dissolves the current text over the specified duration. * sweep_in: Sweeps in from the specified color. * sweep_out: Sweeps out to the specified color. Timing and Control Effects * consume_tick: Consumes a single tick. * never_complete: Makes an effect run indefinitely. * ping_pong: Plays the effect forwards and then backwards. * repeat: Repeats an effect indefinitely or for a specified number of times or duration. * repeating: Repeats the effect indefinitely. * sleep: Pauses for a specified duration. * timed_never_complete: Creates an effect that runs indefinitely but has an enforced duration. * with_duration: Wraps an effect and enforces a duration on it. Geometry Effects * translate: Moves the effect area by a specified amount. * resize_area: Resizes the area of the wrapped effect. Combination Effects * parallel: Runs effects in parallel, all at the same time. Reports completion once all effects have completed. * sequence: Runs effects in sequence, one after the other. Reports completion once the last effect has completed. EffectTimer and Interpolations The EffectTimer is used to control the duration and interpolation of effects. It allows for precise timing and synchronization of visual effects within your application. Cell Selection and Area Effects can be applied to specific cells in the terminal UI, allowing for targeted visual modifications and animations. // only apply to cells with `Light2` foreground color fx::sweep_in(Direction::UpToDown, 15, Dark0, timer) .with_cell_selection(CellFilter::FgColor(Light2.into())) CellFilters can be combined to form complex selection criteria. // apply effect to cells on the outer border of the area let margin = Margin::new(1, 1); let border_text = CellFilter::AllOf(vec![ CellFilter::Outer(margin), CellFilter::Text ]); sequence(vec![ with_duration(duration, never_complete(fx::fade_to(Dark0, Dark0, 0))), fx::fade_from(Dark0, Dark0, (320, QuadOut)), ]).with_cell_selection(border_text) Examples Example: tweens tweens cargo run --example=tweens Example: basic-effects basic effeects cargo run --example=basic-effects Example: open-window cargo run --example=open-window About shader-like effects library for ratatui applications Topics tweening tui ratatui Resources Readme License MIT license Activity Stars 272 stars Watchers 3 watching Forks 2 forks Report repository Releases No releases published Packages 0 No packages published Contributors 2 * @junkdog junkdog Adrian Papari * @orhun orhun Orhun Parmaksiz Languages * Rust 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.