Skip to content

Animate

The Animate class represents an SVG animation element. It allows you to animate an attribute by specifying repeat count and a sequence of values.

Info

This class inherits from SvgElement.

pydreamplet.core.Animate

Animate(attr: str, **kwargs)

Initializes a new animation for the specified attribute.

Parameters

  • attr (str): The SVG attribute to animate.
  • **kwargs: Additional attributes for the animate element.
anim = Animate("fill", from_="red", to="blue")

repeat_count

Getter: Returns the repeat count of the animation.

Setter: Updates the repeat count and the corresponding attribute.

print(anim.repeat_count)
anim.repeat_count = "indefinite"

values

Getter: Returns the list of animation values.

Setter: Sets the list of values and updates the values attribute.

anim.values = ["red", "green", "blue"]