mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Rename radial_gradient_highlight to set_colors_by_radial_gradient
This commit is contained in:
parent
380a87acca
commit
91cba911f5
3 changed files with 7 additions and 7 deletions
|
@ -486,14 +486,14 @@ class Mobject(Container):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def set_color_by_gradient(self, *colors):
|
def set_color_by_gradient(self, *colors):
|
||||||
self.submobject_gradient_highlight(*colors)
|
self.set_submobject_colors_by_gradient(*colors)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def radial_gradient_highlight(self, center = None, radius = 1, inner_color = WHITE, outer_color = BLACK):
|
def set_colors_by_radial_gradient(self, center = None, radius = 1, inner_color = WHITE, outer_color = BLACK):
|
||||||
self.submobject_radial_gradient_highlight(center, radius, inner_color, outer_color)
|
self.set_submobject_colors_by_radial_gradient(center, radius, inner_color, outer_color)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def submobject_gradient_highlight(self, *colors):
|
def set_submobject_colors_by_gradient(self, *colors):
|
||||||
if len(colors) == 0:
|
if len(colors) == 0:
|
||||||
raise Exception("Need at least one color")
|
raise Exception("Need at least one color")
|
||||||
elif len(colors) == 1:
|
elif len(colors) == 1:
|
||||||
|
@ -506,7 +506,7 @@ class Mobject(Container):
|
||||||
mob.set_color(color, family = False)
|
mob.set_color(color, family = False)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def submobject_radial_gradient_highlight(self, center = None, radius = 1, inner_color = WHITE, outer_color = BLACK):
|
def set_submobject_colors_by_radial_gradient(self, center = None, radius = 1, inner_color = WHITE, outer_color = BLACK):
|
||||||
mobs = self.family_members_with_points()
|
mobs = self.family_members_with_points()
|
||||||
if center == None:
|
if center == None:
|
||||||
center = self.get_center()
|
center = self.get_center()
|
||||||
|
|
|
@ -404,7 +404,7 @@ class IntroScene(PiCreatureScene):
|
||||||
self.rects.add(rect)
|
self.rects.add(rect)
|
||||||
lines.add(line)
|
lines.add(line)
|
||||||
|
|
||||||
#self.rects.radial_gradient_highlight(ORIGIN, 5, YELLOW, BLUE)
|
#self.rects.set_colors_by_radial_gradient(ORIGIN, 5, YELLOW, BLUE)
|
||||||
|
|
||||||
self.little_euler_terms = VGroup()
|
self.little_euler_terms = VGroup()
|
||||||
for i in range(1,7):
|
for i in range(1,7):
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Chapter2(LinearTransformationScene):
|
||||||
for x in np.arange(-int(FRAME_X_RADIUS)+0.5, int(FRAME_X_RADIUS)+0.5)
|
for x in np.arange(-int(FRAME_X_RADIUS)+0.5, int(FRAME_X_RADIUS)+0.5)
|
||||||
for y in np.arange(-int(FRAME_Y_RADIUS)+0.5, int(FRAME_Y_RADIUS)+0.5)
|
for y in np.arange(-int(FRAME_Y_RADIUS)+0.5, int(FRAME_Y_RADIUS)+0.5)
|
||||||
])
|
])
|
||||||
vectors.submobject_gradient_highlight(PINK, BLUE_E)
|
vectors.set_submobject_colors_by_gradient(PINK, BLUE_E)
|
||||||
words = TextMobject("Span")
|
words = TextMobject("Span")
|
||||||
words.scale(3)
|
words.scale(3)
|
||||||
words.to_edge(UP)
|
words.to_edge(UP)
|
||||||
|
|
Loading…
Add table
Reference in a new issue