mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 03:37:44 +00:00
Add Mobject.get_opacities
This commit is contained in:
parent
2836acc3c7
commit
a713868f3d
1 changed files with 3 additions and 0 deletions
|
|
@ -1404,6 +1404,9 @@ class Mobject(object):
|
||||||
def get_opacity(self) -> float:
|
def get_opacity(self) -> float:
|
||||||
return float(self.data["rgba"][0, 3])
|
return float(self.data["rgba"][0, 3])
|
||||||
|
|
||||||
|
def get_opacities(self) -> float:
|
||||||
|
return self.data["rgba"][:, 3]
|
||||||
|
|
||||||
def set_color_by_gradient(self, *colors: ManimColor) -> Self:
|
def set_color_by_gradient(self, *colors: ManimColor) -> Self:
|
||||||
if self.has_points():
|
if self.has_points():
|
||||||
self.set_color(colors)
|
self.set_color(colors)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue