Skip to content

Instantly share code, notes, and snippets.

@jaddoescad
Last active April 20, 2021 19:24
Show Gist options
  • Save jaddoescad/79a6f0cf90a964d8c9380de8d8a6a581 to your computer and use it in GitHub Desktop.
Save jaddoescad/79a6f0cf90a964d8c9380de8d8a6a581 to your computer and use it in GitHub Desktop.
change background color in manim
from big_ol_pile_of_manim_imports import *
def set_background(self):
background = Rectangle(
width = FRAME_WIDTH,
height = FRAME_HEIGHT,
stroke_width = 0,
fill_color = "#3E746F",
fill_opacity = 1)
self.add(background)
class background_setter(Scene):
#A few simple shapes
def construct(self):
#set background color
set_background(self)
self.wait(2)
@aevedis
Copy link

aevedis commented Jun 23, 2019

@jaddoescad, I'm really sorry for the stupid question but I'm a newbie, how should I use this py file in a separate project, in a different Python script?

@pedroslrey
Copy link

You can import the file the same way you import a library using import command. See this tutorial: https://www.pythoncentral.io/how-to-create-a-python-package/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment