Matrix Effect¶
Copyright 2023 Ethan Christensen
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- class bruhanimate.bruheffect.matrix_effect.MatrixEffect(buffer: Buffer, background: str, settings: MatrixSettings = None)[source]¶
Bases:
BaseEffectEffect to mimic the classic cascading random-character terminal background.
- __init__(buffer: Buffer, background: str, settings: MatrixSettings = None)[source]¶
Initializes the MatrixEffect.
- Parameters:
buffer (Buffer) – Effect buffer to push changes to.
background (str) – Character or string used for the background.
settings (MatrixSettings, optional) – Configuration for the matrix effect. Defaults to None.
- set_properties(character_halt_range: tuple = (1, 2), color_halt_range: tuple = (1, 2), character_randomness_one: float = 0.7, character_randomness_two: float = 0.6, color_randomness: float = 0.5, gradient_length: int = 1)[source]¶
Updates the matrix effect properties.
- Parameters:
character_halt_range (tuple, optional) – Frame range between character updates. Defaults to (1, 2).
color_halt_range (tuple, optional) – Frame range between color updates. Defaults to (1, 2).
character_randomness_one (float, optional) – Probability of a row updating characters. Defaults to 0.70.
character_randomness_two (float, optional) – Probability of each cell in a row updating. Defaults to 0.60.
color_randomness (float, optional) – Probability of a row shifting its color gradient. Defaults to 0.50.
gradient_length (int, optional) – How many times each color is repeated in the gradient. Defaults to 1.