mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Give set_color_by_gradient more expected behavior
https://github.com/3b1b/manim/issues/1882
This commit is contained in:
parent
834c806e83
commit
8e6265d35e
1 changed files with 4 additions and 1 deletions
|
@ -1265,7 +1265,10 @@ class Mobject(object):
|
||||||
return self.data["rgbas"][0, 3]
|
return self.data["rgbas"][0, 3]
|
||||||
|
|
||||||
def set_color_by_gradient(self, *colors: ManimColor):
|
def set_color_by_gradient(self, *colors: ManimColor):
|
||||||
self.set_submobject_colors_by_gradient(*colors)
|
if self.has_points():
|
||||||
|
self.set_color(colors)
|
||||||
|
else:
|
||||||
|
self.set_submobject_colors_by_gradient(*colors)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def set_submobject_colors_by_gradient(self, *colors: ManimColor):
|
def set_submobject_colors_by_gradient(self, *colors: ManimColor):
|
||||||
|
|
Loading…
Add table
Reference in a new issue