mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 17:29:06 +08:00
Farther along EoLA chapter 3
This commit is contained in:
@ -26,9 +26,10 @@ class PMobject(Mobject):
|
||||
self.rgbs = np.append(self.rgbs, rgbs, axis = 0)
|
||||
return self
|
||||
|
||||
def highlight(self, color = YELLOW_C, condition = None):
|
||||
def highlight(self, color = YELLOW_C, family = True, condition = None):
|
||||
rgb = Color(color).get_rgb()
|
||||
for mob in self.family_members_with_points():
|
||||
mobs = self.family_members_with_points() if family else [self]
|
||||
for mob in mobs:
|
||||
if condition:
|
||||
to_change = np.apply_along_axis(condition, 1, mob.points)
|
||||
mob.rgbs[to_change, :] = rgb
|
||||
|
Reference in New Issue
Block a user