diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py index caa26828e..bda751018 100644 --- a/moviepy/video/VideoClip.py +++ b/moviepy/video/VideoClip.py @@ -1190,6 +1190,10 @@ def __init__(self, size, color=None, is_mask=False, duration=None): color = (0, 0, 0) elif not hasattr(color, "__getitem__"): raise Exception("Color has to contain RGB of the clip") + elif isinstance(color, str): + raise Exception( + "Color cannot be string. Color has to contain RGB of the clip" + ) shape = (h, w, len(color)) super().__init__( diff --git a/tests/test_VideoClip.py b/tests/test_VideoClip.py index 151049ba3..635630537 100644 --- a/tests/test_VideoClip.py +++ b/tests/test_VideoClip.py @@ -264,7 +264,10 @@ def test_oncolor(util): clip = ColorClip(size=(100, 60), color=(255, 0, 0), is_mask=True) with pytest.raises(Exception): - clip = ColorClip(size=(100, 60), color=0.4, is_mask=False) + clip = ColorClip(size=(100, 60), color=0.4, ismask=False) + + with pytest.raises(Exception): + clip = ColorClip(size=(100, 60), color="black") def test_setaudio(util):