Waves
Quick Start
from terminaltexteffects.effects.effect_waves import Waves
effect = Waves("YourTextHere")
with effect.terminal_output() as terminal:
for frame in effect:
terminal.print(frame)
Waves travel across the terminal leaving behind the characters.
Classes:
Name | Description |
---|---|
Waves |
Creates waves that travel across the terminal, leaving behind the characters. |
WavesConfig |
Configuration for the Waves effect. |
WavesIterator |
Iterates over the effect. Does not normally need to be called directly. |
Waves
Bases: BaseEffect[WavesConfig]
Creates waves that travel across the terminal, leaving behind the characters.
Attributes:
Name | Type | Description |
---|---|---|
effect_config |
ExpandConfig
|
Configuration for the effect. |
terminal_config |
TerminalConfig
|
Configuration for the terminal. |
Source code in terminaltexteffects/effects/effect_waves.py
__init__(input_data)
Initialize the effect with the provided input data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_data |
str
|
The input data to use for the effect. |
required |
WavesConfig
dataclass
Bases: ArgsDataClass
Configuration for the Waves effect.
Attributes:
Name | Type | Description |
---|---|---|
wave_symbols |
tuple[str, ...] | str
|
Symbols to use for the wave animation. Multi-character strings will be used in sequence to create an animation. |
wave_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. |
wave_gradient_steps |
tuple[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_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_direction |
Direction
|
Direction of the final gradient. |
wave_count |
int
|
Number of waves to generate. Valid values are n > 0. |
wave_length |
int
|
The number of frames for each step of the wave. Higher wave-lengths will create a slower wave. Valid values are n > 0. |
wave_direction |
Literal['column_left_to_right', 'column_right_to_left', 'row_top_to_bottom', 'row_bottom_to_top', 'center_to_outside', 'outside_to_center']
|
Direction of the wave. |
wave_easing |
EasingFunction
|
Easing function to use for wave travel. |
Source code in terminaltexteffects/effects/effect_waves.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
final_gradient_direction: Gradient.Direction = ArgField(cmd_name='--final-gradient-direction', type_parser=argvalidators.GradientDirection.type_parser, default=Gradient.Direction.DIAGONAL, metavar=argvalidators.GradientDirection.METAVAR, help='Direction of the final gradient.')
class-attribute
instance-attribute
Gradient.Direction : Direction of the final gradient.
final_gradient_steps: tuple[int, ...] | int = ArgField(cmd_name='--final-gradient-steps', type_parser=argvalidators.PositiveInt.type_parser, nargs='+', default=12, metavar=argvalidators.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: tuple[Color, ...] = ArgField(cmd_name='--final-gradient-stops', type_parser=argvalidators.ColorArg.type_parser, nargs='+', default=(Color('#ffb102'), Color('#31a0d4'), Color('#f0ff65')), metavar=argvalidators.ColorArg.METAVAR, help='Space separated, unquoted, list of colors for the character gradient (applied from bottom to top). 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.
wave_count: int = ArgField(cmd_name='--wave-count', type_parser=argvalidators.PositiveInt.type_parser, default=7, help='Number of waves to generate. n > 0.')
class-attribute
instance-attribute
int : Number of waves to generate. n > 0.
wave_direction: typing.Literal['column_left_to_right', 'column_right_to_left', 'row_top_to_bottom', 'row_bottom_to_top', 'center_to_outside', 'outside_to_center'] = ArgField(cmd_name='--wave-direction', default='column_left_to_right', help='Direction of the wave.', choices=['column_left_to_right', 'column_right_to_left', 'row_top_to_bottom', 'row_bottom_to_top', 'center_to_outside', 'outside_to_center'])
class-attribute
instance-attribute
typing.Literal['column_left_to_right','column_right_to_left','row_top_to_bottom','row_bottom_to_top','center_to_outside','outside_to_center']
wave_easing: easing.EasingFunction = ArgField(cmd_name='--wave-easing', type_parser=argvalidators.Ease.type_parser, default=easing.in_out_sine, help='Easing function to use for wave travel.')
class-attribute
instance-attribute
easing.EasingFunction : Easing function to use for wave travel.
wave_gradient_steps: tuple[int, ...] = ArgField(cmd_name='--wave-gradient-steps', type_parser=argvalidators.PositiveInt.type_parser, nargs='+', default=(6), metavar=argvalidators.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, ...] : Tuple of the number of gradient steps to use. More steps will create a smoother and longer gradient animation.
wave_gradient_stops: tuple[Color, ...] = ArgField(cmd_name='--wave-gradient-stops', type_parser=argvalidators.ColorArg.type_parser, nargs='+', default=(Color('#f0ff65'), Color('#ffb102'), Color('#31a0d4'), Color('#ffb102'), Color('#f0ff65')), metavar=argvalidators.ColorArg.METAVAR, help='Space separated, unquoted, list of colors for the character gradient (applied from bottom to top). 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.
wave_length: int = ArgField(cmd_name='--wave-length', type_parser=argvalidators.PositiveInt.type_parser, default=2, metavar=argvalidators.PositiveInt.METAVAR, help='The number of frames for each step of the wave. Higher wave-lengths will create a slower wave.')
class-attribute
instance-attribute
int : The number of frames for each step of the wave. Higher wave-lengths will create a slower wave.
wave_symbols: tuple[str, ...] = ArgField(cmd_name='--wave-symbols', type_parser=argvalidators.Symbol.type_parser, default=('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█', '▇', '▆', '▅', '▄', '▃', '▂', '▁'), nargs='+', metavar=argvalidators.Symbol.METAVAR, help='Symbols to use for the wave animation. Multi-character strings will be used in sequence to create an animation.')
class-attribute
instance-attribute
tuple[str, ...] : Symbols to use for the wave animation. Multi-character strings will be used in sequence to create an animation.