Created a method `remove_all_except()` in scene.py and interactive_scene.py, and made default colors easily configurable. (#2346)

* created a method remove_all_except() in scene.py and interactive_scene.py

* Made it such that default mobject colors can be set through the yaml config file.

* * Default color initialisation wasn't working.
Changed conditional expression to `or` instead.

* Added default values to yaml file.

* added set_background_color() function to Scene class

* Changed default font back to Consolas
This commit is contained in:
Abdallah Soliman
2025-06-10 16:15:55 +01:00
committed by GitHub
parent 6fb1845f4a
commit fd2a6a69e5
18 changed files with 68 additions and 39 deletions

View File

@ -6,7 +6,7 @@ from pyglet.window import key as PygletWindowKeys
from manimlib.constants import FRAME_HEIGHT, FRAME_WIDTH
from manimlib.constants import DOWN, LEFT, ORIGIN, RIGHT, UP
from manimlib.constants import MED_LARGE_BUFF, MED_SMALL_BUFF, SMALL_BUFF
from manimlib.constants import BLACK, BLUE, GREEN, GREY_A, GREY_C, RED, WHITE
from manimlib.constants import BLACK, BLUE, GREEN, GREY_A, GREY_C, RED, WHITE, DEFAULT_MOBJECT_COLOR
from manimlib.mobject.mobject import Group
from manimlib.mobject.mobject import Mobject
from manimlib.mobject.geometry import Circle
@ -387,7 +387,7 @@ class Textbox(ControlMobject):
box_kwargs: dict = {
"width": 2.0,
"height": 1.0,
"fill_color": WHITE,
"fill_color": DEFAULT_MOBJECT_COLOR,
"fill_opacity": 1.0,
},
text_kwargs: dict = {