# Path: mugen/video/segments/ColorSegment.py
# class ColorSegment(Segment, ColorClip):
#     """
#     A segment with a color
#     """
# 
#     color: str
# 
#     @convert_color_to_hex_code(["color"])
#     def __init__(
#         self,
#         color: str,
#         duration: float = 1,
#         size: Optional[Tuple[int, int]] = (300, 300),
#         **kwargs
#     ):
#         """
#         Parameters
#         ----------
#         color
#             hex code of the color, i.e. #000000 for black.
#             OR the special inputs 'black' and 'white'.
#         """
#         super().__init__(
#             size, conversion.hex_to_rgb(color), duration=duration, **kwargs
#         )
# 
#         self.color = color
#         self.fps = Segment.DEFAULT_VIDEO_FPS
# 
#     @property
#     def name(self):
#         return self.color
# 
#     def trailing_buffer(self, duration) -> "ColorSegment":
#         return ColorSegment(self.color, duration, self.size)
# 
# Path: mugen/video/sources/Source.py
# class Source(Taggable, Weightable, ABC):
#     """
#     A content source for sampling segments of content
#     """
# 
#     @property
#     @abstractmethod
#     def name(self) -> str:
#         """
#         Human-readable name for the source
#         """
#         pass
# 
#     @abstractmethod
#     def sample(self, duration: float) -> Segment:
#         pass


from mugen.video.segments.ColorSegment import ColorSegment
from mugen.video.sources.Source import Source


class ColorSource(Source):
    """
    An color source for sampling color segments
    """

    def __init__(self, color: str, **kwargs):
        """
        Parameters
        ----------
        color
            hex code of the color, i.e. #000000 for black.
            OR the special inputs 'black' and 'white'.
        """
        super().__init__(**kwargs)
        self.segment = ColorSegment(color)

    @property
    def color(self):
        return self.segment.color

    @property
    def name(self):
        return self.segment.name


# Path: mugen/video/segments/ColorSegment.py
# class ColorSegment(Segment, ColorClip):
#     """
#     A segment with a color
#     """
# 
#     color: str
# 
#     @convert_color_to_hex_code(["color"])
#     def __init__(
#         self,
#         color: str,
#         duration: float = 1,
#         size: Optional[Tuple[int, int]] = (300, 300),
#         **kwargs
#     ):
#         """
#         Parameters
#         ----------
#         color
#             hex code of the color, i.e. #000000 for black.
#             OR the special inputs 'black' and 'white'.
#         """
#         super().__init__(
#             size, conversion.hex_to_rgb(color), duration=duration, **kwargs
#         )
# 
#         self.color = color
#         self.fps = Segment.DEFAULT_VIDEO_FPS
# 
#     @property
#     def name(self):
#         return self.color
# 
#     def trailing_buffer(self, duration) -> "ColorSegment":
#         return ColorSegment(self.color, duration, self.size)
# 
# Path: mugen/video/sources/Source.py
# class Source(Taggable, Weightable, ABC):
#     """
#     A content source for sampling segments of content
#     """
# 
#     @property
#     @abstractmethod
#     def name(self) -> str:
#         """
#         Human-readable name for the source
#         """
#         pass
# 
#     @abstractmethod
#     def sample(self, duration: float) -> Segment:
#         pass


# Path: mugen/video/sources/ColorSource.py
from mugen.video.segments.ColorSegment import ColorSegment
from mugen.video.sources.Source import Source



class ColorSource(Source):
    """
    An color source for sampling color segments
    """

    def __init__(self, color: str, **kwargs):
        """
        Parameters
        ----------
        color
            hex code of the color, i.e. #000000 for black.
            OR the special inputs 'black' and 'white'.
        """
        super().__init__(**kwargs)
        self.segment = ColorSegment(color)

    @property
    def color(self):
        return self.segment.color

    @property
    def name(self):
        return self.segment.name


    def sample(self, duration: float) -> ColorSegment: