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