Expand

Quick Start
from terminaltexteffects.effects.effect_expand import Expand
effect = Expand("YourTextHere")
with effect.terminal_output() as terminal:
for frame in effect:
terminal.print(frame)
Characters expand from the center.
Classes:
| Name | Description |
|---|---|
Expand |
Characters expand from the center. |
ExpandConfig |
Configuration for the Expand effect. |
ExpandIterator |
Iterates over the effect. |
Expand
Bases: BaseEffect[ExpandConfig]
Characters expand from the center.
Attributes:
| Name | Type | Description |
|---|---|---|
effect_config |
ExpandConfig
|
Configuration for the effect. |
terminal_config |
TerminalConfig
|
Configuration for the terminal. |
Source code in terminaltexteffects/effects/effect_expand.py
ExpandConfig
dataclass
Bases: BaseConfig
Configuration for the Expand effect.
Attributes:
| Name | Type | Description |
|---|---|---|
movement_speed |
float
|
Movement speed of the characters. |
expand_easing |
EasingFunction
|
Easing function to use for character movement. |
final_gradient_stops |
tuple[Color, ...]
|
Tuple of colors for the final color gradient. If only one color is provided, the characters will be displayed in that color. |
final_gradient_steps |
tuple[int, ...] | int
|
Tuple of the number of gradient steps to use. More steps will create a smoother and longer gradient animation. Valid values are n > 0. |
final_gradient_frames |
int
|
Number of frames to display each gradient step. Increase to slow down the gradient animation. |
final_gradient_direction |
Direction
|
Direction of the final gradient. |
Source code in terminaltexteffects/effects/effect_expand.py
expand_easing = ArgSpec(name='--expand-easing', default=(easing.in_out_quart), type=(argutils.Ease.type_parser), help='Easing function to use for character movement.')
class-attribute
instance-attribute
easing.EasingFunction : Easing function to use for character movement.
final_gradient_direction = ArgSpec(name='--final-gradient-direction', type=(argutils.GradientDirection.type_parser), default=(Gradient.Direction.VERTICAL), metavar=(argutils.GradientDirection.METAVAR), help='Direction of the final gradient.')
class-attribute
instance-attribute
Gradient.Direction : Direction of the final gradient.
final_gradient_frames = ArgSpec(name='--final-gradient-frames', type=(argutils.PositiveInt.type_parser), default=5, metavar=(argutils.PositiveInt.METAVAR), help='Number of frames to display each gradient step. Increase to slow down the gradient animation.')
class-attribute
instance-attribute
int : Number of frames to display each gradient step. Increase to slow down the gradient animation.
final_gradient_steps = ArgSpec(name='--final-gradient-steps', type=(argutils.PositiveInt.type_parser), nargs='+', action=(argutils.TupleAction), default=12, metavar=(argutils.PositiveInt.METAVAR), help='Space separated, unquoted, list of the number of gradient steps to use. More steps will create a smoother and longer gradient animation.')
class-attribute
instance-attribute
tuple[int, ...] | int : Int or Tuple of ints for the number of gradient steps to use. More steps will create a smoother and longer gradient animation.
final_gradient_stops = ArgSpec(name='--final-gradient-stops', type=(argutils.ColorArg.type_parser), nargs='+', action=(argutils.TupleAction), default=(Color('#8A008A'), Color('#00D1FF'), Color('#FFFFFF')), metavar=(argutils.ColorArg.METAVAR), help='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.')
class-attribute
instance-attribute
tuple[Color, ...] : Tuple of colors for the final color gradient. If only one color is provided, the characters will be displayed in that color.
movement_speed = ArgSpec(name='--movement-speed', type=(argutils.PositiveFloat.type_parser), default=0.35, metavar=(argutils.PositiveFloat.METAVAR), help='Movement speed of the characters. ')
class-attribute
instance-attribute
float : Movement speed of the characters.
ExpandIterator
Bases: BaseEffectIterator[ExpandConfig]
Iterates over the Expand effect.
Source code in terminaltexteffects/effects/effect_expand.py
__init__(effect)
Initialize the Expand effect iterator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
effect
|
Expand
|
The effect to use for the iterator. |
required |
Source code in terminaltexteffects/effects/effect_expand.py
__next__()
build()
Build the Expand effect.
Source code in terminaltexteffects/effects/effect_expand.py
get_effect_resources()
Get the command, effect class, and configuration class for the effect.
Returns:
| Type | Description |
|---|---|
tuple[str, type[BaseEffect], type[BaseConfig]]
|
tuple[str, type[BaseEffect], type[BaseConfig]]: The command name, effect class, and configuration class. |