mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Improved gradient_hightlight of PointCloudMobject
This commit is contained in:
parent
0bf1a9e303
commit
83e28f9efb
1 changed files with 8 additions and 1 deletions
|
@ -37,7 +37,14 @@ class PMobject(Mobject):
|
||||||
mob.rgbas[:,:] = rgba
|
mob.rgbas[:,:] = rgba
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def gradient_highlight(self, start_color, end_color):
|
# def gradient_highlight(self, start_color, end_color):
|
||||||
|
def gradient_highlight(self, *colors):
|
||||||
|
self.rgbas = np.array(map(
|
||||||
|
color_to_rgba,
|
||||||
|
color_gradient(colors, len(self.points))
|
||||||
|
))
|
||||||
|
return self
|
||||||
|
|
||||||
start_rgba, end_rgba = map(color_to_rgba, [start_color, end_color])
|
start_rgba, end_rgba = map(color_to_rgba, [start_color, end_color])
|
||||||
for mob in self.family_members_with_points():
|
for mob in self.family_members_with_points():
|
||||||
num_points = mob.get_num_points()
|
num_points = mob.get_num_points()
|
||||||
|
|
Loading…
Add table
Reference in a new issue