### Implement LaserEtch Effect Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/laseretch.md Quick start example for using the LaserEtch effect. Requires importing the effect and Gradient class. The final gradient direction can be configured before printing each frame. ```python from terminaltexteffects import Gradient from terminaltexteffects.effects.effect_laseretch import LaserEtch effect = LaserEtch("YourTextHere") with effect.terminal_output() as terminal: effect.effect_config.final_gradient_direction = Gradient.Direction.HORIZONTAL for frame in effect: terminal.print(frame) ``` -------------------------------- ### SynthGrid Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md This example demonstrates how to use the command-line arguments to configure the SynthGrid effect, specifying gradient colors, steps, directions, symbols, and active block limits. ```bash terminaltexteffects synthgrid --grid-gradient-stops CC00CC ffffff --grid-gradient-steps 12 --text-gradient-stops 8A008A 00D1FF FFFFFF --text-gradient-steps 12 --grid-row-symbol ─ --grid-column-symbol "│" --text-generation-symbols ░ ▒ ▓ --max-active-blocks 0.1 ``` -------------------------------- ### LaserEtch Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md This example demonstrates how to use the LaserEtch effect with various command-line arguments to control etching speed, delay, direction, and gradient colors. ```bash terminaltexteffects laseretch --etch-speed 2 --etch-delay 5 --etch-direction row_top_to_bottom --cool-gradient-stops ffe680 ff7b00 --laser-gradient-stops ffffff 376cff --spark-gradient-stops ffffff ffe680 ff7b00 1a0900 --spark-cooling-frames 10 --final-gradient-stops 8A008A 00D1FF ffffff --final-gradient-steps 8 --final-gradient-frames 5 --final-gradient-direction vertical ``` -------------------------------- ### Example with Specific Options Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/README.md An example demonstrating the use of specific options for an effect, including typing speed, ciphertext colors, and gradient settings. ```bash ls -a | tte decrypt --typing-speed 2 --ciphertext-colors 008000 00cb00 00ff00 --final-gradient-stops eda000 --final-gradient-steps 12 --final-gradient-direction vertical ``` -------------------------------- ### Install with UV (Tool) Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/README.md Installs the terminaltexteffects tool using UV. Run this command to execute the tool directly. ```bash uv tool run terminaltexteffects -h ``` -------------------------------- ### Burn Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md This example demonstrates how to use command-line arguments to configure the Burn effect. It specifies starting color, burn colors, smoke chance, final gradient stops, gradient steps, and gradient direction. ```bash terminaltexteffects burn --starting-color 837373 --burn-colors ffffff fff75d fe650d 8a003c 510100 --smoke-chance 0.2 --final-gradient-stops 00c3ff ffff1c --final-gradient-steps 12 ``` -------------------------------- ### SynthGrid Quick Start Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/synthgrid.md Instantiate the SynthGrid effect with your desired text and render it to the terminal. ```python from terminaltexteffects.effects.effect_synthgrid import SynthGrid effect = SynthGrid("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Implement Sweep Effect Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/sweep.md Quick start example for the Sweep effect. Requires importing the effect and configuring its gradient direction. ```python import terminaltexteffects as tte from terminaltexteffects.effects.effect_sweep import Sweep effect = Sweep("YourTextHere") effect.effect_config.final_gradient_direction = tte.Gradient.Direction.HORIZONTAL with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Install with UV (Application) Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/README.md Installs the terminaltexteffects application using UV. This makes the tool available system-wide. ```bash uv tool install terminaltexteffects ``` -------------------------------- ### Gradient Basic Usage Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/engine/utils/gradient.md Demonstrates how to initialize a Gradient object with start and end colors, and specify the number of steps. The gradient can then be iterated to get individual color values. ```APIDOC ## Gradient Basic Usage ### Description Initializes a Gradient object with specified colors and steps, allowing iteration to retrieve color values. ### Method `Gradient(color1, color2, ..., steps)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from terminaltexteffects.utils.graphics import Gradient, Color rgb = Gradient(Color("#ff0000"), Color("#00ff00"), Color("#0000ff"), steps=5) for color in rgb: # color is a hex string print(color) ``` ### Response #### Success Response (200) Iteration over the Gradient object yields hex color strings. #### Response Example ``` #ff0000 #e61a00 #cc3300 #b34d00 #996600 ``` ``` -------------------------------- ### Custom Effect Python File Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/changeblog/changeblog_0.15.0.md Illustrates the file structure for a custom effect Python file. ```text ~/.config/terminaltexteffects/effects/effect_custom.py ``` -------------------------------- ### Wipe Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md This example demonstrates how to use command-line arguments to configure the Wipe effect. It specifies the wipe direction, gradient colors, gradient steps, gradient frames, gradient direction, and wipe delay. ```bash terminaltexteffects wipe --wipe-direction diagonal_bottom_left_to_top_right --final-gradient-stops 833ab4 fd1d1d fcb045 --final-gradient-steps 12 --final-gradient-frames 5 --wipe-delay 0 ``` -------------------------------- ### Bubbles Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md This example demonstrates how to use various command-line arguments to customize the Bubbles text effect. It covers color options, animation speed, delay, pop conditions, and easing functions. ```bash --rainbow If set, the bubbles will be colored with a rotating rainbow gradient. (default: False) --bubble-colors (XTerm [0-255] OR RGB Hex [000000-ffffff]) [(XTerm [0-255] OR RGB Hex [000000-ffffff]) ...] Space separated, unquoted, list of colors for the bubbles. Ignored if --no-rainbow is left as default False. (default: ('d33aff', '7395c4', '43c2a7', '02ff7f')) --pop-color (XTerm [0-255] OR RGB Hex [000000-ffffff]) Color for the spray emitted when a bubble pops. (default: ffffff) --final-gradient-stops (XTerm [0-255] OR RGB Hex [000000-ffffff]) [(XTerm [0-255] OR RGB Hex [000000-ffffff]) ...] Space separated, unquoted, list of colors for the character gradient (applied across the canvas). If only one color is provided, the characters will be displayed in that color. (default: ('d33aff', '02ff7f')) --final-gradient-steps (int > 0) [(int > 0) ...] Space separated, unquoted, list of the number of gradient steps to use. More steps will create a smoother and longer gradient animation. (default: (12,)) --final-gradient-direction (diagonal, horizontal, vertical, radial) Direction of the final gradient. (default: Direction.DIAGONAL) --bubble-speed (float > 0) Speed of the floating bubbles. (default: 0.1) --bubble-delay (int > 0) Number of frames between bubbles. (default: 50) --pop-condition {row,bottom,anywhere} Condition for a bubble to pop. 'row' will pop the bubble when it reaches the the lowest row for which a character in the bubble originates. 'bottom' will pop the bubble at the bottom row of the terminal. 'anywhere' will pop the bubble randomly, or at the bottom of the terminal. (default: row) --easing (Easing Function) Easing function to use for character movement after a bubble pops. (default: in_out_sine) Easing ------ Note: A prefix must be added to the function name. All easing functions support the following prefixes: IN_ - Ease in OUT_ - Ease out IN_OUT_ - Ease in and out Easing Functions ---------------- SINE - Sine easing QUAD - Quadratic easing CUBIC - Cubic easing QUART - Quartic easing QUINT - Quintic easing EXPO - Exponential easing CIRC - Circular easing BACK - Back easing ELASTIC - Elastic easing BOUNCE - Bounce easing Visit: https://easings.net/ for visualizations of the easing functions. ``` ```bash terminaltexteffects bubbles --bubble-colors d33aff 7395c4 43c2a7 02ff7f --pop-color ffffff --final-gradient-stops d33aff 02ff7f --final-gradient-steps 12 --final-gradient-direction diagonal --bubble-speed 0.1 --bubble-delay 50 --pop-condition row --easing IN_OUT_SINE ``` -------------------------------- ### VHSTape Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md Demonstrates how to use the VHSTape effect with custom command-line arguments for gradient colors, steps, direction, glitching, and noise. ```bash terminaltexteffects vhstape --final-gradient-stops ab48ff e7b2b2 fffebd --final-gradient-steps 12 --glitch-line-colors ffffff ff0000 00ff00 0000ff ffffff --glitch-wave-colors ffffff ff0000 00ff00 0000ff ffffff --noise-colors 1e1e1f 3c3b3d 6d6c70 a2a1a6 cbc9cf ffffff --glitch-line-chance 0.05 --noise-chance 0.004 --total-glitch-time 1000 ``` -------------------------------- ### Rings Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md Demonstrates how to configure the 'rings' effect using command-line arguments, specifying colors, gradient, and animation parameters. ```bash terminaltexteffects rings --ring-colors ab48ff e7b2b2 fffebd --final-gradient-stops ab48ff e7b2b2 fffebd --final-gradient-steps 12 --ring-gap 0.1 --spin-duration 200 --spin-speed 0.25-1.0 --disperse-duration 200 --spin-disperse-cycles 3 ``` -------------------------------- ### Print Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md Demonstrates how to use the 'print' command with various arguments to control gradient colors, steps, direction, print speed, and easing functions. ```bash terminaltexteffects print --final-gradient-stops 02b8bd c1f0e3 00ffa0 --final-gradient-steps 12 --print-head-return-speed 1.25 --print-speed 1 --print-head-easing IN_OUT_QUAD ``` -------------------------------- ### Slide Effect Quick Start Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/slide.md Use the Slide effect to animate text. Import the Slide class and instantiate it with your desired text. Then, iterate over the effect to get animated frames and print them to the terminal. ```python from terminaltexteffects.effects.effect_slide import Slide effect = Slide("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Sweep Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md This example demonstrates how to use command-line arguments to configure the Sweep text effect. It specifies custom symbols, sweep directions, gradient colors, and gradient steps. ```bash terminaltexteffects sweep --sweep-symbols '█' '▓' '▒' '░' --first-sweep-direction column_right_to_left --second-sweep-direction column_left_to_right --final-gradient-stops 8A008A 00D1FF ffffff --final-gradient-steps 8 8 8 --final-gradient-direction vertical ``` -------------------------------- ### TTE argument specification example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/appguide.md This example shows how to pipe `ls` output to TTE with global options for text wrapping and tab width, and effect options for the slide effect. ```bash ls | tte --wrap-text --tab-width 4 slide --merge --movement-speed 2 --grouping column ``` -------------------------------- ### Install TerminalTextEffects using Pipx Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/installation.md Use this command to install TerminalTextEffects as a system application, making it available in your shell. ```bash pipx install terminaltexteffects ``` -------------------------------- ### Install with UV (Library) Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/README.md Adds the terminaltexteffects library to your project's dependencies using UV. ```bash uv add terminaltexteffects ``` -------------------------------- ### Beams Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md Demonstrates how to configure the 'beams' text effect using command-line arguments. This includes settings for beam symbols, speed, gradient colors, and wipe direction. ```bash --beam-row-symbols (ASCII/UTF-8 character) [(ASCII/UTF-8 character) ...] Symbols to use for the beam effect when moving along a row. Strings will be used in sequence to create an animation. (default: ('▂', '▁', '_')) --beam-column-symbols (ASCII/UTF-8 character) [(ASCII/UTF-8 character) ...] Symbols to use for the beam effect when moving along a column. Strings will be used in sequence to create an animation. (default: ('▌', '▍', '▎', '▏')) --beam-delay (int > 0) Number of frames to wait before adding the next group of beams. Beams are added in groups of size random(1, 5). (default: 10) --beam-row-speed-range (hyphen separated int range e.g. '1-10') Minimum speed of the beam when moving along a row. (default: (10, 40)) --beam-column-speed-range (hyphen separated int range e.g. '1-10') Minimum speed of the beam when moving along a column. (default: (6, 10)) --beam-gradient-stops (XTerm [0-255] OR RGB Hex [000000-ffffff]) [(XTerm [0-255] OR RGB Hex [000000-ffffff]) ...] Space separated, unquoted, list of colors for the beam, a gradient will be created between the colors. (default: ('ffffff', '00D1FF', '8A008A')) --beam-gradient-steps (int > 0) [(int > 0) ...] Space separated, unquoted, numbers for the of gradient steps to use. More steps will create a smoother and longer gradient animation. Steps are paired with the colors in final-gradient- stops. (default: (2, 8)) --beam-gradient-frames (int > 0) Number of frames to display each gradient step. Increase to slow down the gradient animation. (default: 2) --final-gradient-stops (XTerm [0-255] OR RGB Hex [000000-ffffff]) [(XTerm [0-255] OR RGB Hex [000000-ffffff]) ...] Space separated, unquoted, list of colors for the wipe gradient. (default: ('8A008A', '00D1FF', 'ffffff')) --final-gradient-steps (int > 0) [(int > 0) ...] Space separated, unquoted, numbers for the of gradient steps to use. More steps will create a smoother and longer gradient animation. Steps are paired with the colors in final-gradient- stops. (default: (12,)) --final-gradient-frames (int > 0) Number of frames to display each gradient step. Increase to slow down the gradient animation. (default: 5) --final-gradient-direction (diagonal, horizontal, vertical, radial) Direction of the final gradient. (default: Direction.VERTICAL) --final-wipe-speed (int > 0) Speed of the final wipe as measured in diagonal groups activated per frame. (default: 1) ``` ```bash terminaltexteffects beams --beam-row-symbols ▂ ▁ _ --beam-column-symbols ▌ ▍ ▎ ▏ --beam-delay 10 --beam-row-speed-range 10-40 --beam-column-speed-range 6-10 --beam-gradient-stops ffffff 00D1FF 8A008A --beam-gradient-steps 2 8 --beam-gradient-frames 2 --final-gradient-stops 8A008A 00D1FF ffffff --final-gradient-steps 12 --final-gradient-frames 5 --final-gradient-direction vertical --final-wipe-speed 1 ``` -------------------------------- ### Bouncyballs Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md This example demonstrates how to use command-line arguments to customize the Bouncyballs effect. It covers color selection, ball symbols, gradient settings, delay, movement speed, and easing functions. ```bash --ball-colors (XTerm [0-255] OR RGB Hex [000000-ffffff]) [(XTerm [0-255] OR RGB Hex [000000-ffffff]) ...] Space separated list of colors from which ball colors will be randomly selected. If no colors are provided, the colors are random. (default: ('d1f4a5', '96e2a4', '5acda9')) --ball-symbols (ASCII/UTF-8 character) [(ASCII/UTF-8 character) ...] Space separated list of symbols to use for the balls. (default: ('*', 'o', 'O', '0', '.')) --final-gradient-stops (XTerm [0-255] OR RGB Hex [000000-ffffff]) [(XTerm [0-255] OR RGB Hex [000000-ffffff]) ...] Space separated, unquoted, list of colors for the character gradient (applied across the canvas). If only one color is provided, the characters will be displayed in that color. (default: ('f8ffae', '43c6ac')) --final-gradient-steps (int > 0) [(int > 0) ...] Space separated, unquoted, list of the number of gradient steps to use. More steps will create a smoother and longer gradient animation. (default: (12,)) --final-gradient-direction (diagonal, horizontal, vertical, radial) Direction of the final gradient. (default: Direction.DIAGONAL) --ball-delay (int >= 0) Number of frames between ball drops, increase to reduce ball drop rate. (default: 7) --movement-speed (float > 0) Movement speed of the characters. (default: 0.25) --easing EASING Easing function to use for character movement. (default: out_bounce) Easing ------ Note: A prefix must be added to the function name. All easing functions support the following prefixes: IN_ - Ease in OUT_ - Ease out IN_OUT_ - Ease in and out Easing Functions ---------------- SINE - Sine easing QUAD - Quadratic easing CUBIC - Cubic easing QUART - Quartic easing QUINT - Quintic easing EXPO - Exponential easing CIRC - Circular easing BACK - Back easing ELASTIC - Elastic easing BOUNCE - Bounce easing Visit: https://easings.net/ for visualizations of the easing functions. Example: terminaltexteffects bouncyballs --ball-colors d1f4a5 96e2a4 5acda9 --ball-symbols o "*" O 0 . --final-gradient-stops f8ffae 43c6ac --final-gradient-steps 12 --final-gradient-direction diagonal --ball-delay 7 --movement-speed 0.25 --easing OUT_BOUNCE ``` -------------------------------- ### Scattered Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md Shows how to use command-line arguments for the 'scattered' effect, including gradient colors, steps, frames, movement speed, and easing. ```bash terminaltexteffects scattered --final-gradient-stops ff9048 ab9dff bdffea --final-gradient-steps 12 --final-gradient-frames 12 --movement-speed 0.5 --movement-easing IN_OUT_BACK ``` -------------------------------- ### Dynamic Color Handling Example (Burn Effect) Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/changeblog/changeblog_0.15.0.md Demonstrates the 'dynamic' mode for color handling in the Burn effect, showing how input colors are preserved. ```text ![dynamic_colors](../img/changeblog_media/0.15.0/color_dynamic_burn.gif) ``` -------------------------------- ### Print Effect Quick Start Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/print.md Instantiate the Print effect with your desired text and use it within a terminal output context to display the effect. ```python from terminaltexteffects.effects.effect_print import Print effect = Print("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Install TerminalTextEffects as a library using Pip Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/installation.md Use this command to install TerminalTextEffects as a Python library for use within your applications. ```bash pip install terminaltexteffects ``` -------------------------------- ### Ignore Color Handling Example (Burn Effect) Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/changeblog/changeblog_0.15.0.md Demonstrates the 'ignore' mode for color handling in the Burn effect, where input colors are stripped. ```text ![ignore_colors](../img/changeblog_media/0.15.0/color_ignore_burn.gif) ``` -------------------------------- ### Implement Thunderstorm Effect Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/thunderstorm.md Quick start for using the Thunderstorm effect. Import the effect, instantiate it with text, and render it using the terminal_output context manager. ```python from terminaltextefects.effects import Thunderstorm effect = Thunderstorm("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Spotlights Command Line Arguments Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md This snippet lists the available command-line arguments for the spotlights effect, including gradient colors, gradient steps, beam width, search duration, and spotlight count. It also details easing functions and provides an example command. ```bash --final-gradient-stops (XTerm [0-255] OR RGB Hex [000000-ffffff]) [(XTerm [0-255] OR RGB Hex [000000-ffffff]) ...] Space separated, unquoted, list of colors for the character gradient (applied across the canvas). If only one color is provided, the characters will be displayed in that color. (default: ('ab48ff', 'e7b2b2', 'fffebd')) --final-gradient-steps (int > 0) [(int > 0) ...] Number of gradient steps to use. More steps will create a smoother and longer gradient animation. (default: (12,)) --final-gradient-direction (diagonal, horizontal, vertical, radial) Direction of the final gradient. (default: Direction.VERTICAL) --beam-width-ratio (float > 0) Width of the beam of light as min(width, height) // n of the input text. (default: 2.0) --beam-falloff (float >= 0) Distance from the edge of the beam where the brightness begins to fall off, as a percentage of total beam width. (default: 0.3) --search-duration (int > 0) Duration of the search phase, in frames, before the spotlights converge in the center. (default: 750) --search-speed-range (hyphen separated float range e.g. '0.25-0.5') Range of speeds for the spotlights during the search phase. The speed is a random value between the two provided values. (default: (0.25, 0.5)) --spotlight-count (int > 0) Number of spotlights to use. (default: 3) Easing ------ Note: A prefix must be added to the function name. All easing functions support the following prefixes: IN_ - Ease in OUT_ - Ease out IN_OUT_ - Ease in and out Easing Functions ---------------- SINE - Sine easing QUAD - Quadratic easing CUBIC - Cubic easing QUART - Quartic easing QUINT - Quintic easing EXPO - Exponential easing CIRC - Circular easing BACK - Back easing ELASTIC - Elastic easing BOUNCE - Bounce easing Visit: https://easings.net/ for visualizations of the easing functions. Example: terminaltexteffects spotlights --final-gradient-stops ab48ff e7b2b2 fffebd --final-gradient-steps 12 --beam-width-ratio 2.0 --beam-falloff 0.3 --search-duration 750 --search-speed-range 0.25-0.5 --spotlight-count 3 ``` -------------------------------- ### MiddleOut Command Line Arguments Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md Demonstrates how to use the MiddleOut effect with various command-line arguments for customization. This includes setting colors, gradient stops and steps, expansion direction, movement speeds, and easing functions. ```bash terminaltexteffects middleout --starting-color 8A008A --final-gradient-stops 8A008A 00D1FF FFFFFF --final-gradient-steps 12 --expand-direction vertical --center-movement-speed 0.35 --full-movement-speed 0.35 --center-easing IN_OUT_SINE --full-easing IN_OUT_SINE ``` -------------------------------- ### Crumble Effect Quick Start Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/crumble.md Instantiate the Crumble effect with your desired text and iterate through its frames to display the animation in the terminal. ```python from terminaltextefects.effects.effect_crumble import Crumble effect = Crumble("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Always Color Handling Example (Burn Effect) Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/changeblog/changeblog_0.15.0.md Demonstrates the 'always' mode for color handling in the Burn effect, where input colors are always maintained. ```text ![always_colors](../img/changeblog_media/0.15.0/color_always_burn.gif) ``` -------------------------------- ### Profile Benchmark Scenario Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/performance.md Use the --profile flag to get a call-level explanation of timing deltas for a specific scenario. This is useful after a benchmark indicates a significant change. ```bash ./.venv/bin/python tools/perf/benchmark_effects.py \ --effect wipe \ --input-preset medium \ --samples 1 \ --warmups 0 \ --profile ``` -------------------------------- ### Create and Iterate a Gradient Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/engine/utils/gradient.md Instantiate a Gradient object with start and end colors and the desired number of steps. Iterate through the gradient to access each color as a hex string. ```python from terminaltexteffects.utils.graphics import Gradient, Color rgb = Gradient(Color("#ff0000"), Color("#00ff00"), Color("#0000ff"), steps=5) for color in rgb: # color is a hex string ... ``` -------------------------------- ### Play Slide Effect Animation with Context Manager Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/libguide.md Use the `terminal_output()` context manager for automatic terminal setup and teardown. The `merge` option in `effect_config` makes text slide in from alternating sides. ```python from terminaltextefects.effects.effect_slide import Slide text = ("EXAMPLE" * 10 + "\n") * 10 effect = Slide(text) effect.effect_config.merge = True # (1) with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Run TerminalTextEffects via Python module Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/installation.md If pipx is not available, you can install via pip and run TTE by calling the python binary with the module argument. This example shows redirection of 'ls -latr' output to TTE. ```bash ls -latr | python3 -m terminaltexteffects ``` -------------------------------- ### Instantiate Color Objects Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/engine/utils/color.md Demonstrates creating Color objects using different specification formats: hex, xterm code, and hex with a prefix. ```python from terminaltextefects.utils.graphics import Color red = Color('ff0000') xterm_red = Color(9) rgb_red_again = Color('#ff0000') ``` -------------------------------- ### Run Spotlights Effect Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/spotlights.md Instantiate the Spotlights effect with your desired text and render it to the terminal. Ensure the effect is imported correctly. ```python from terminaltextefects.effects.effect_spotlights import Spotlights effect = Spotlights("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Invoking a Custom Effect from CLI Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/changeblog/changeblog_0.15.0.md Demonstrates how to run a registered custom effect from the command line. ```bash cat message.txt | tte custom ``` -------------------------------- ### Nix Run Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/README.md Runs the terminaltexteffects tool directly from a Nix flake. This example pipes text to the 'beams' effect. ```bash echo 'terminaltexteffects is awesome' | nix run github:ChrisBuilds/terminaltexteffects/ -- beams ``` -------------------------------- ### ColorPair Creation and Usage Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/engine/utils/colorpair.md Demonstrates how to instantiate ColorPair objects using Color objects or string/integer representations of colors. ```APIDOC ## ColorPair ### Description ColorPair objects are used to represent a foreground and background color pair. ### Method Constructor ### Endpoint `terminaltexteffects.utils.graphics.ColorPair` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **fg** (Color or str or int) - Optional - The foreground color. - **bg** (Color or str or int) - Optional - The background color. ### Request Example ```python import terminaltexteffects as tte # Using Color objects color_pair_1 = tte.ColorPair(fg=tte.Color("#FF0000"), bg=tte.Color("#00FF00")) # Using string representations color_pair_2 = tte.ColorPair("#FF0000", "#00FF00") ``` ### Response #### Success Response (200) N/A (This is a class constructor) #### Response Example N/A ``` -------------------------------- ### Nix Shell Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/README.md Creates a temporary shell environment with terminaltexteffects available. Useful for trying out the tool without a full installation. ```bash nix shell github:ChrisBuilds/terminaltexteffects/ ``` -------------------------------- ### Slice Effect Quick Start Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/slice.md Demonstrates how to use the Slice effect with a diagonal direction. Ensure the Slice class is imported from terminaltexteffects.effects.effect_slice. ```python from terminaltextefects.effects.effect_slice import Slice effect = Slice("YourTextHere") effect.effect_config.slice_direction = "diagonal" with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### MiddleOut Effect Quick Start Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/middleout.md Instantiate the MiddleOut effect with your desired text and render it to the terminal. Ensure the effect is imported from terminaltexteffects.effects.effect_middleout. ```python from terminaltexteffects.effects.effect_middleout import MiddleOut effect = MiddleOut("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Implement RandomSequence Effect Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/randomsequence.md Use the RandomSequence effect to display text with characters appearing in a random sequence. Ensure the 'terminaltexteffects' library is installed. ```python from terminaltexteffects.effects.effect_random_sequence import RandomSequence effect = RandomSequence("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Run Baseline Benchmark Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/performance.md Execute the benchmark script to establish a baseline performance metric. Use specific effects and input presets for repeatable checks. ```bash ./.venv/bin/python tools/perf/benchmark_effects.py \ --effect wipe \ --input-preset medium \ --json-out /tmp/tte-baseline.json ``` -------------------------------- ### TTE Command Line Options Overview Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/README.md This snippet lists the available command-line options for the TTE tool, including help, input/output files, version, color settings, and canvas/text anchoring. ```markdown options: -h, --help show this help message and exit --input-file, -i INPUT_FILE File to read input from --version, -v show program's version number and exit --print-completion {bash,zsh} Print a shell completion script for the requested shell and exit. --random-effect, -R Randomly select an effect to apply --seed SEED Seed to use for random effect selection --include-effects INCLUDE_EFFECTS [INCLUDE_EFFECTS ...] Space-separated list of Effects to include when randomly selecting an effect --exclude-effects EXCLUDE_EFFECTS [EXCLUDE_EFFECTS ...] Space-separated list of Effects to exclude when randomly selecting an effect --tab-width (int > 0) Number of spaces to use for a tab character. --xterm-colors Convert any colors specified in 24-bit RGB hex to the closest 8-bit XTerm-256 color. --no-color Disable all colors in the effect. --terminal-background-color (XTerm [0-255] OR RGB Hex [000000-ffffff]) The background color of your terminal. Used to determine the appropriate color for fade-in/out within effects. --existing-color-handling {always,dynamic,ignore} Specify handling of existing ANSI SGR color sequences in the input data. Supported input colors include 3-bit, 4-bit, 8-bit, and 24-bit foreground/background sequences. 'always' will always use the input colors, ignoring any effect specific colors. 'dynamic' will leave it to the effect implementation to apply input colors. 'ignore' will ignore the colors in the input data. Default is 'ignore'. --wrap-text Wrap text wider than the canvas width. --frame-rate FRAME_RATE Target frame rate for the animation in frames per second. Set to 0 to disable frame rate limiting. Defaults to 60. --canvas-width int >= -1 Canvas width, set to an integer > 0 to use a specific dimension, use 0 to match the terminal width, or use -1 to match the input text width. Defaults to -1. --canvas-height int >= -1 Canvas height, set to an integer > 0 to use a specific dimension, use 0 to match the terminal height, or use -1 to match the input text height. Defaults to -1. --anchor-canvas {sw,s,se,e,ne,n,nw,w,c} Anchor point for the canvas. The canvas will be anchored in the terminal to the location corresponding to the cardinal/diagonal direction. Defaults to 'sw'. --anchor-text {n,ne,e,se,s,sw,w,nw,c} Anchor point for the text within the Canvas. Input text will be anchored in the Canvas to the location corresponding to the cardinal/diagonal direction. Defaults to 'sw'. --ignore-terminal-dimensions Ignore the terminal dimensions and utilize the full Canvas beyond the extents of the terminal. Useful for sending frames to another output handler. --reuse-canvas Do not create new rows at the start of the effect. The cursor will be moved up the number of rows present in the input text in an attempt to re-use the canvas. This option works best when used in a shell script. If used interactively with prompts between runs, the result is unpredictable. --no-eol Suppress the trailing newline emitted when an effect animation completes. --no-restore-cursor Do not restore cursor visibility after the effect. ``` -------------------------------- ### Burn Effect Quick Start Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/burn.md Use the Burn effect to display text that appears to burn away. Requires importing the Burn class. ```python from terminaltextefects.effects.effect_burn import Burn effect = Burn("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Bubbles Effect Quick Start Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/bubbles.md Use the Bubbles effect to animate text in your terminal. Requires importing the Bubbles class and iterating through its frames. ```python from terminaltextefects.effects.effect_bubbles import Bubbles effect = Bubbles("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Implement Waves Effect Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/waves.md Use the Waves effect to animate text with a wave-like motion. Ensure the terminaltexteffects library is installed and import the Waves class. ```python from terminaltexteffects.effects.effect_waves import Waves effect = Waves("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Pour Command Line Arguments Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md Configure the pour text effect with direction, speed, gap, and gradient options. ```bash --pour-direction {up,down,left,right} Direction the text will pour. (default: down) --pour-speed (int > 0) Number of characters poured in per tick. Increase to speed up the effect. (default: 1) --movement-speed (float > 0) Movement speed of the characters. (default: 0.2) --gap (int >= 0) Number of frames to wait between each character in the pour effect. Increase to slow down effect and create a more defined back and forth motion. (default: 1) --starting-color (XTerm [0-255] OR RGB Hex [000000-ffffff]) Color of the characters before the gradient starts. (default: ffffff) --final-gradient-stops (XTerm [0-255] OR RGB Hex [000000-ffffff]) [(XTerm [0-255] OR RGB Hex [000000-ffffff]) ...] Space separated, unquoted, list of colors for the character gradient. If only one color is provided, the characters will be displayed in that color. (default: ('8A008A', '00D1FF', 'FFFFFF')) --final-gradient-steps (int > 0) Number of gradient steps to use. More steps will create a smoother and longer gradient animation. (default: (12,)) --final-gradient-frames (int > 0) Number of frames to display each gradient step. Increase to slow down the gradient animation. (default: 10) --final-gradient-direction (diagonal, horizontal, vertical, radial) Direction of the final gradient. (default: Direction.VERTICAL) --easing EASING Easing function to use for character movement. (default: in_quad) Easing ------ Note: A prefix must be added to the function name. All easing functions support the following prefixes: IN_ - Ease in OUT_ - Ease out IN_OUT_ - Ease in and out Easing Functions ---------------- SINE - Sine easing QUAD - Quadratic easing CUBIC - Cubic easing QUART - Quartic easing QUINT - Quintic easing EXPO - Exponential easing CIRC - Circular easing BACK - Back easing ELASTIC - Elastic easing BOUNCE - Bounce easing Visit: https://easings.net/ for visualizations of the easing functions. Example: terminaltexteffects pour --pour-direction down --movement-speed 0.2 --gap 1 --starting-color FFFFFF --final-gradient-stops 8A008A 00D1FF FFFFFF --easing IN_QUAD ``` -------------------------------- ### Nix Classic Shell Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/README.md Sets up a development shell with terminaltexteffects using Nix's classic package management. Requires fetching the source and defining the package. ```nix let pkgs = import {}; tte = pkgs.callPackage (pkgs.fetchFromGitHub { owner = "ChrisBuilds"; repo = "terminaltexteffects"; rev = ""; hash = ""; # Build first, put proper hash in place }) {}; in pkgs.mkShell { packages = [tte]; } ``` -------------------------------- ### Expand Command Line Arguments Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/showroom.md Configure the Expand text effect with gradient colors, steps, frames, movement speed, and easing functions. Easing functions require a prefix like IN_OUT_. ```bash --final-gradient-stops (XTerm [0-255] OR RGB Hex [000000-ffffff]) [(XTerm [0-255] OR RGB Hex [000000-ffffff]) ...] Space separated, unquoted, list of colors for the character gradient (applied across the canvas). If only one color is provided, the characters will be displayed in that color. (default: ('8A008A', '00D1FF', 'FFFFFF')) --final-gradient-steps (int > 0) [(int > 0) ...] Space separated, unquoted, list of the number of gradient steps to use. More steps will create a smoother and longer gradient animation. (default: (12,)) --final-gradient-frames (int > 0) Number of frames to display each gradient step. Increase to slow down the gradient animation. (default: 5) --final-gradient-direction (diagonal, horizontal, vertical, radial) Direction of the final gradient. (default: Direction.VERTICAL) --movement-speed (float > 0) Movement speed of the characters. (default: 0.35) --expand-easing EXPAND_EASING Easing function to use for character movement. (default: in_out_quart) Easing ------ Note: A prefix must be added to the function name. All easing functions support the following prefixes: IN_ - Ease in OUT_ - Ease out IN_OUT_ - Ease in and out Easing Functions ---------------- SINE - Sine easing QUAD - Quadratic easing CUBIC - Cubic easing QUART - Quartic easing QUINT - Quintic easing EXPO - Exponential easing CIRC - Circular easing BACK - Back easing ELASTIC - Elastic easing BOUNCE - Bounce easing Visit: https://easings.net/ for visualizations of the easing functions. Example: terminaltexteffects expand --final-gradient-stops 8A008A 00D1FF FFFFFF --final-gradient-steps 12 --final-gradient-frames 5 --movement-speed 0.35 --expand-easing IN_OUT_QUART ``` -------------------------------- ### Create Gradient with Colors Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/engine/utils/color.md Illustrates building a color gradient using multiple Color objects and specifying the number of steps. The gradient yields hex strings. ```python from terminaltextefects.utils.graphics import Gradient, Color rgb = Gradient(Color("#ff0000"), Color("#00ff00"), Color("#0000ff"), steps=5) for color in rgb: # color is a hex string ... ``` -------------------------------- ### Managed Terminal Output Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/README.md Use the `terminal_output` context manager to let the library handle terminal setup, teardown, cursor positioning, and frame rate. ```python from terminaltexteffects.effects import Rain effect = Rain("your text here") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Configure Effect with Color Gradient Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/engine/utils/color.md Demonstrates passing Color objects to an effect's configuration to define a gradient for text effects. Requires importing the effect class and Color/Gradient utilities. ```python from terminaltextefects.utils.graphics import Gradient, Color from terminaltextefects.effects.color_shift import ColorShift text = ("EXAMPLE" * 10 + "\n") * 10 red = Color("#ff0000") green = Color("#00ff00") blue = Color("#0000ff") effect = ColorShift(text) effect.effect_config.gradient_stops = (red, green, blue) with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### ErrorCorrect Effect Example Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/errorcorrect.md Instantiate and run the ErrorCorrect effect with custom text. Ensure the effect is used within a context manager for proper terminal output handling. ```python from terminaltextefects.effects.effect_errorcorrect import ErrorCorrect effect = ErrorCorrect("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Use Smoke Effect Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/effects/smoke.md Instantiate and run the Smoke effect. Requires importing the Smoke class. The effect is applied to the provided text. ```python from terminaltexteffects.effects import Smoke effect = Smoke("YourTextHere") with effect.terminal_output() as terminal: for frame in effect: terminal.print(frame) ``` -------------------------------- ### Instantiate ColorPair with Color Strings Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/engine/utils/colorpair.md Instantiate a ColorPair using color strings directly for foreground and background. The library will automatically convert these to Color objects. Ensure terminaltexteffects is imported. ```python import terminaltexteffects as tte color_pair = tte.ColorPair("#FF0000", "#00FF00") ``` -------------------------------- ### Custom Effect Discovery Path (Default) Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/changeblog/changeblog_0.15.0.md Shows the default path for discovering custom effects when XDG_CONFIG_HOME is not set. ```text ~/.config/terminaltexteffects/effects ``` -------------------------------- ### Compare Benchmark Reports Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/performance.md Compare the generated baseline and candidate JSON reports to analyze performance deltas. This command provides a summary of changes. ```bash ./.venv/bin/python tools/perf/benchmark_effects.py \ --compare /tmp/tte-baseline.json /tmp/tte-candidate.json ``` -------------------------------- ### Iterate Over Effect Frames Manually Source: https://github.com/chrisbuilds/terminaltexteffects/blob/main/docs/libguide.md Iterate directly over the effect to get each frame as a string, allowing you to handle output to TUIs or GUIs. The `merge` option in `effect_config` makes text slide in from alternating sides. ```python from terminaltextefects.effects.effect_slide import Slide text = ("EXAMPLE" * 10 + "\n") * 10 effect = Slide(text) effect.effect_config.merge = True # (1) for frame in effect: # frame is a string, do something with it ```