mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-07-04 07:27:00 +08:00
@ -23,7 +23,7 @@ class Slide(BaseSlide, Scene): # type: ignore[misc]
|
||||
|
||||
@property
|
||||
def _background_color(self) -> str:
|
||||
color = config["background_color"]
|
||||
color = self.camera.background_color
|
||||
if hex_color := getattr(color, "hex", None):
|
||||
return hex_color # type: ignore
|
||||
else: # manim>=0.18, see https://github.com/ManimCommunity/manim/pull/3020
|
||||
|
@ -6,6 +6,7 @@ import numpy as np
|
||||
import pytest
|
||||
from click.testing import CliRunner
|
||||
from manim import (
|
||||
BLACK,
|
||||
BLUE,
|
||||
DOWN,
|
||||
LEFT,
|
||||
@ -108,6 +109,13 @@ class TestSlide:
|
||||
assert len(self._canvas) == 0
|
||||
assert self._wait_time_between_slides == 0.0
|
||||
|
||||
@assert_constructs
|
||||
class TestBackgroundColor(Slide):
|
||||
def construct(self) -> None:
|
||||
assert self._background_color == BLACK.to_hex() # DEFAULT
|
||||
self.camera.background_color = BLUE
|
||||
assert self._background_color == BLUE.to_hex()
|
||||
|
||||
@assert_renders
|
||||
class TestMultipleAnimationsInLastSlide(Slide):
|
||||
"""Check against solution for issue #161."""
|
||||
|
Reference in New Issue
Block a user