movis.layer.texture.Gradient#

class movis.layer.texture.Gradient(size: tuple[int, int] = (100, 100), start_point: tuple[float, float] = (0.0, 0.0), end_point: tuple[float, float] = (100.0, 100.0), start_color: tuple[int, int, int] | str = (0, 0, 0), end_color: tuple[int, int, int] | str = (255, 255, 255), gradient_type: str = 'linear', duration: float = 1000000.0)[source]#

A layer that generates a gradient image.

Args:
size:

the size of the generated image. Defaults to (100, 100).

start_point:

the start point of the gradient. Defaults to (0., 0.).

end_point:

the end point of the gradient. Defaults to (100., 100.).

start_color:

the start color of the gradient. Defaults to (0, 0, 0). the color can be specified as a tuple of (R, G, B) or a string (e.g., "#ff0000", or "red").

end_color:

the end color of the gradient. Defaults to (255, 255, 255).

gradient_type:

the type of the gradient. “linear” or “radial” is expected. Defaults to "linear".

duration:

the duration of the layer. Defaults to 1e6.

Animatable Attributes:

start_point end_point start_color end_color

Methods

get_key(time: float) tuple[Hashable, ...]#

Returns a tuple of hashable values that represent the state of the instance at a given time.

Attributes

attributes

A dictionary of attributes that are used to generate cache keys.