mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 21:44:19 +08:00
Give set_color_by_gradient more expected behavior
https://github.com/3b1b/manim/issues/1882
This commit is contained in:
@ -1265,7 +1265,10 @@ class Mobject(object):
|
||||
return self.data["rgbas"][0, 3]
|
||||
|
||||
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
|
||||
|
||||
def set_submobject_colors_by_gradient(self, *colors: ManimColor):
|
||||
|
Reference in New Issue
Block a user