def set_style_data(self, stroke_color=None, stroke_width=None, fill_color=None, fill_opacity=None, family=True ): if stroke_color is not None: self.stroke_rgb = color_to_rgb(stroke_color) if fill_color is not None: self.fill_rgb = color_to_rgb(fill_color) if stroke_width is not None: self.stroke_width = stroke_width if fill_opacity is not None: self.fill_opacity = fill_opacity if family: for mob in self.submobjects: mob.set_style_data( stroke_color=stroke_color, stroke_width=stroke_width, fill_color=fill_color, fill_opacity=fill_opacity, family=family ) return self
def fade_to_no_recurse(self, color, alpha): if self.get_num_points() > 0: start = color_to_rgb(self.get_color()) end = color_to_rgb(color) new_rgb = interpolate(start, end, alpha) self.set_color(Color(rgb=new_rgb), family=False) return self