rgba

class janim.components.rgba.Cmpt_Rgba(*args, **kwargs)

Bases: Component, Generic

Single-color component

DEFAULT_RGBA_ARRAY = <janim.utils.data.Array object>
copy() Self
become(other: Cmpt_Rgba) Self
not_changed(other: Cmpt_Rgba) bool
classmethod align_for_interpolate(cmpt1: Cmpt_Rgba, cmpt2: Cmpt_Rgba)
interpolate(cmpt1: Cmpt_Rgba, cmpt2: Cmpt_Rgba, alpha: float, *, path_func=None) None
set_rgba(rgba: Rgba) Self
static format_rgba(rgba: Rgba) ndarray
static format_color(color: JAnimColor) ndarray
set(color: JAnimColor | None = None, alpha: Alpha | None = None, *, root_only: bool = False) Self
  • color represents the passed RGB color data, a single color (supports representations such as '#FF0000', 'red', and [1, 0, 0.5])

  • alpha represents the passed transparency data (1 means opaque, 0 means fully transparent)

  • By default, all descendant items will also be set to the specified property; passing root_only=True limits it to only the root item

Special argument handling:

  • When color is a four-component RGBA color value, it represents both color and alpha, so the alpha parameter cannot be passed again

get() ndarray
mix(color: JAnimColor, factor: float = 0.5, *, root_only: bool = False) Self
mix_alpha(alpha: Alpha, factor: float = 0.5, *, root_only: bool = False) Self