Plasma 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.plasma_effect.PlasmaEffect(buffer: Buffer, background: str, settings: PlasmaSettings = None)[source]¶
Bases:
BaseEffectClass to generate an animated plasma effect.
- __init__(buffer: Buffer, background: str, settings: PlasmaSettings = None)[source]¶
Initializes the PlasmaEffect class.
- Parameters:
buffer (Buffer) – Effect buffer to push updates to.
background (str) – Character or string to use as the background.
settings (PlasmaSettings, optional) – Configuration for the plasma effect. Defaults to None.
- set_show_info(visible: bool)[source]¶
Toggles visibility of debug info overlay.
- Parameters:
visible (bool) – Whether to show the info overlay.
- set_grey_scale_size(size: int)[source]¶
Sets the grey scale size, which controls detail level.
- Parameters:
size (int) – Must be 8, 10, or 16.
- Raises:
ValueError – If size is not one of the supported values.
- set_color_properties(color: bool, characters: bool = True, random_colors: bool = False)[source]¶
Configures color rendering. random_colors overrides the palette.
- set_colors(colors: list[int])[source]¶
Sets a custom color palette. Has no effect if random_colors is enabled.
- Parameters:
colors (list[int]) – List of 256-color indices, one per scale character.
- Raises:
ValueError – If the number of colors does not match the scale length.
- set_background(background: str)[source]¶
Updates the background character or string.
- Parameters:
background (str) – Character or string to use as background.
- render_frame(frame_number: int)[source]¶
Renders a single frame of the plasma effect.
- Parameters:
frame_number (int) – The current frame number.