Beams
Quick Start
from terminaltexteffects.effects.effect_beams import Beams
effect = Beams("YourTextHere")
with effect.terminal_output() as terminal:
for frame in effect:
terminal.print(frame)
Creates beams which travel over the canvas illuminating the characters.
Classes:
Name | Description |
---|---|
Beams |
Creates beams which travel over the canvas illuminating the characters. |
BeamsConfig |
Configuration for the Beams effect. |
BeamsIterator |
Iterates over the Beams effect. Does not normally need to be called directly. |
Beams
Bases: BaseEffect[BeamsConfig]
Creates beams which travel over the canvas illuminating the characters.
Attributes:
Name | Type | Description |
---|---|---|
effect_config |
BeamsConfig
|
Configuration for the effect. |
terminal_config |
TerminalConfig
|
Configuration for the terminal. |
Source code in terminaltexteffects/effects/effect_beams.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 |
BeamsConfig
dataclass
Bases: ArgsDataClass
Configuration for the Beams effect.
Attributes:
Name | Type | Description |
---|---|---|
beam_row_symbols |
tuple[str, ...] | str
|
Symbols to use for the beam effect when moving along a row. Strings will be used in sequence to create an animation. |
beam_column_symbols |
tuple[str, ...] | str
|
Symbols to use for the beam effect when moving along a column. Strings will be used in sequence to create an animation. |
beam_delay |
int
|
Number of frames to wait before adding the next group of beams. Beams are added in groups of size random(1, 5). Valid values are n > 0. |
beam_row_speed_range |
tuple[int, int]
|
Speed range of the beam when moving along a row. Valid values are n > 0. |
beam_column_speed_range |
tuple[int, int]
|
Speed range of the beam when moving along a column. Valid values are n > 0. |
beam_gradient_stops |
tuple[Color, ...]
|
Tuple of colors for the beam, a gradient will be created between the colors. |
beam_gradient_steps |
tuple[int, ...] | int
|
Tuple of the number 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. Valid values are n > 0. |
beam_gradient_frames |
int
|
Number of frames to display each gradient step. Increase to slow down the gradient animation. Valid values are n > 0. |
final_gradient_stops |
tuple[Color, ...]
|
Tuple of colors for the wipe gradient. |
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. Steps are paired with the colors in final-gradient-stops. 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. |
final_wipe_speed |
int
|
Speed of the final wipe as measured in diagonal groups activated per frame. Valid values are n > 0. |
Source code in terminaltexteffects/effects/effect_beams.py
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 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
beam_column_speed_range: tuple[int, int] = ArgField(cmd_name='--beam-column-speed-range', type_parser=argvalidators.IntRange.type_parser, default=(6, 10), metavar=argvalidators.IntRange.METAVAR, help='Speed range of the beam when moving along a column.')
class-attribute
instance-attribute
tuple[int, int] : Speed range of the beam when moving along a column.
beam_column_symbols: tuple[str, ...] | str = ArgField(cmd_name='--beam-column-symbols', type_parser=argvalidators.Symbol.type_parser, nargs='+', default=('▌', '▍', '▎', '▏'), metavar=argvalidators.Symbol.METAVAR, help='Symbols to use for the beam effect when moving along a column. Strings will be used in sequence to create an animation.')
class-attribute
instance-attribute
tuple[str, ...] | str : Symbols to use for the beam effect when moving along a column. Strings will be used in sequence to create an animation.
beam_delay: int = ArgField(cmd_name='--beam-delay', type_parser=argvalidators.PositiveInt.type_parser, default=10, metavar=argvalidators.PositiveInt.METAVAR, help='Number of frames to wait before adding the next group of beams. Beams are added in groups of size random(1, 5).')
class-attribute
instance-attribute
int : Number of frames to wait before adding the next group of beams. Beams are added in groups of size random(1, 5).
beam_gradient_frames: int = ArgField(cmd_name='--beam-gradient-frames', type_parser=argvalidators.PositiveInt.type_parser, default=2, metavar=argvalidators.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.
beam_gradient_steps: tuple[int, ...] | int = ArgField(cmd_name='--beam-gradient-steps', type_parser=argvalidators.PositiveInt.type_parser, nargs='+', default=(2, 8), metavar=argvalidators.PositiveInt.METAVAR, help='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.')
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. Steps are paired with the colors in final-gradient-stops.
beam_gradient_stops: tuple[Color, ...] = ArgField(cmd_name='--beam-gradient-stops', type_parser=argvalidators.ColorArg.type_parser, nargs='+', default=(Color('ffffff'), Color('00D1FF'), Color('8A008A')), metavar='(XTerm [0-255] OR RGB Hex [000000-ffffff])', help='Space separated, unquoted, list of colors for the beam, a gradient will be created between the colors.')
class-attribute
instance-attribute
tuple[Color, ...] : Tuple of colors for the beam, a gradient will be created between the colors.
beam_row_speed_range: tuple[int, int] = ArgField(cmd_name='--beam-row-speed-range', type_parser=argvalidators.IntRange.type_parser, default=(10, 40), metavar=argvalidators.IntRange.METAVAR, help='Speed range of the beam when moving along a row.')
class-attribute
instance-attribute
tuple[int, int] : Speed range of the beam when moving along a row.
beam_row_symbols: tuple[str, ...] | str = ArgField(cmd_name='--beam-row-symbols', type_parser=argvalidators.Symbol.type_parser, nargs='+', default=('▂', '▁', '_'), metavar=argvalidators.Symbol.METAVAR, help='Symbols to use for the beam effect when moving along a row. Strings will be used in sequence to create an animation.')
class-attribute
instance-attribute
tuple[str, ...] | str : Symbols to use for the beam effect when moving along a row. Strings will be used in sequence to create an animation.
final_gradient_direction: Gradient.Direction = ArgField(cmd_name='--final-gradient-direction', type_parser=argvalidators.GradientDirection.type_parser, default=Gradient.Direction.VERTICAL, metavar=argvalidators.GradientDirection.METAVAR, help='Direction of the final gradient.')
class-attribute
instance-attribute
Gradient.Direction : Direction of the final gradient.
final_gradient_frames: int = ArgField(cmd_name='--final-gradient-frames', type_parser=argvalidators.PositiveInt.type_parser, default=5, metavar=argvalidators.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: 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, 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.')
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. Steps are paired with the colors in final-gradient-stops.
final_gradient_stops: tuple[Color, ...] = ArgField(cmd_name='--final-gradient-stops', type_parser=argvalidators.ColorArg.type_parser, nargs='+', default=(Color('8A008A'), Color('00D1FF'), Color('ffffff')), metavar=argvalidators.ColorArg.METAVAR, help='Space separated, unquoted, list of colors for the wipe gradient.')
class-attribute
instance-attribute
tuple[Color, ...] : Tuple of colors for the wipe gradient.
final_wipe_speed: int = ArgField(cmd_name='--final-wipe-speed', type_parser=argvalidators.PositiveInt.type_parser, default=1, metavar=argvalidators.PositiveInt.METAVAR, help='Speed of the final wipe as measured in diagonal groups activated per frame.')
class-attribute
instance-attribute
int : Speed of the final wipe as measured in diagonal groups activated per frame.