# Path: mugen/constants.py
# class Color(str, Enum):
#     BLACK = "black"
#     WHITE = "white"
# 
#     def hex_code(self):
#         if self.value == self.BLACK:
#             return "#000000"
#         elif self.value == self.WHITE:
#             return "#ffffff"
#         else:
#             raise ValueError(f"No Hex code defined for {self}")
# 
# Path: mugen/lists.py
# class MugenList(list):
#     """
#     A subclass of list with extra functionality, used internally
#     """
# 
#     def __init__(self, items: Optional[List[Any]] = None):
#         if items is None:
#             items = []
# 
#         super().__init__(items)
# 
#     def __add__(self, rhs):
#         return type(self)((super().__add__(rhs)))
# 
#     def __getitem__(self, item):
#         result = list.__getitem__(self, item)
#         if isinstance(item, slice):
#             return type(self)(result)
#         else:
#             return result
# 
#     def pretty_repr(self, item_reprs: List[str] = None):
#         if item_reprs is None:
#             item_reprs = [repr(item) for item in self]
# 
#         repr_str = ""
#         for index, element_repr in enumerate(item_reprs):
#             if index != 0:
#                 repr_str += " "
#             repr_str += element_repr
#             if index != len(self) - 1:
#                 repr_str += ", \n"
#         return f"[{repr_str}]"
# 
#     def lget(self, attr) -> List[Any]:
#         """
#         Returns
#         -------
#         A list of values for the attribute, taken from each element in the array
#         """
#         return [getattr(elem, attr) for elem in self]
# 
#     def flatten(self):
#         """
#         Returns
#         -------
#         A new, flattened version of this list.
#         Flattens an arbitrarily nested list of objects
#         """
#         return type(self)(flatten(self))
# 
# Path: mugen/utilities/conversion.py
# def float_to_fraction(float_var: float) -> Fraction:
# def time_to_seconds(time: TIME_FORMAT) -> float:
# def seconds_to_time_code(seconds: float) -> str:
# def hex_to_rgb(hex_value) -> List[int]:
# def color_to_hex_code(color):
# def convert_float_to_fraction(*variable_names: str):
# def convert_time_to_seconds(*variable_names: str):
# def convert_color_to_hex_code(*variable_names: str):
# 
# Path: mugen/utilities/conversion.py
# def convert_color_to_hex_code(*variable_names: str):
#     """
#     Decorator to convert variables to hex color format
#     """
#     return preprocess_args(color_to_hex_code, *variable_names)
# 
# Path: mugen/video/events.py
# class VideoEvent(Event):
#     """
#     An event in a video
#     """
# 
#     pass


from typing import List, Optional
from mugen.constants import Color
from mugen.lists import MugenList
from mugen.utilities import conversion
from mugen.utilities.conversion import convert_color_to_hex_code
from mugen.video.events import VideoEvent

    def __init__(self, effects: Optional[List[VideoEffect]] = None):
        super().__init__(effects)

    def add_crossfade(self, duration: float = ONE_SECOND):
        """
        Adds a crossfade effect to the beginning of the video segment.

        Parameters
        ----------
        duration
            duration of the effect
        """
        self.append(CrossFade(duration))

    def add_fadein(self, duration: float = ONE_SECOND, color: str = Color.BLACK):
        """
        Adds a fade-in effect to the video segment.

        Parameters
        ----------
        duration
            duration of the effect

        color
            hex code of the color to fade in from, i.e. #000000 for black.
            OR the special inputs 'black' and 'white'.
        """
        self.append(FadeIn(duration, color))


# Path: mugen/constants.py
# class Color(str, Enum):
#     BLACK = "black"
#     WHITE = "white"
# 
#     def hex_code(self):
#         if self.value == self.BLACK:
#             return "#000000"
#         elif self.value == self.WHITE:
#             return "#ffffff"
#         else:
#             raise ValueError(f"No Hex code defined for {self}")
# 
# Path: mugen/lists.py
# class MugenList(list):
#     """
#     A subclass of list with extra functionality, used internally
#     """
# 
#     def __init__(self, items: Optional[List[Any]] = None):
#         if items is None:
#             items = []
# 
#         super().__init__(items)
# 
#     def __add__(self, rhs):
#         return type(self)((super().__add__(rhs)))
# 
#     def __getitem__(self, item):
#         result = list.__getitem__(self, item)
#         if isinstance(item, slice):
#             return type(self)(result)
#         else:
#             return result
# 
#     def pretty_repr(self, item_reprs: List[str] = None):
#         if item_reprs is None:
#             item_reprs = [repr(item) for item in self]
# 
#         repr_str = ""
#         for index, element_repr in enumerate(item_reprs):
#             if index != 0:
#                 repr_str += " "
#             repr_str += element_repr
#             if index != len(self) - 1:
#                 repr_str += ", \n"
#         return f"[{repr_str}]"
# 
#     def lget(self, attr) -> List[Any]:
#         """
#         Returns
#         -------
#         A list of values for the attribute, taken from each element in the array
#         """
#         return [getattr(elem, attr) for elem in self]
# 
#     def flatten(self):
#         """
#         Returns
#         -------
#         A new, flattened version of this list.
#         Flattens an arbitrarily nested list of objects
#         """
#         return type(self)(flatten(self))
# 
# Path: mugen/utilities/conversion.py
# def float_to_fraction(float_var: float) -> Fraction:
# def time_to_seconds(time: TIME_FORMAT) -> float:
# def seconds_to_time_code(seconds: float) -> str:
# def hex_to_rgb(hex_value) -> List[int]:
# def color_to_hex_code(color):
# def convert_float_to_fraction(*variable_names: str):
# def convert_time_to_seconds(*variable_names: str):
# def convert_color_to_hex_code(*variable_names: str):
# 
# Path: mugen/utilities/conversion.py
# def convert_color_to_hex_code(*variable_names: str):
#     """
#     Decorator to convert variables to hex color format
#     """
#     return preprocess_args(color_to_hex_code, *variable_names)
# 
# Path: mugen/video/events.py
# class VideoEvent(Event):
#     """
#     An event in a video
#     """
# 
#     pass


# Path: mugen/video/effects.py
from typing import List, Optional
from mugen.constants import Color
from mugen.lists import MugenList
from mugen.utilities import conversion
from mugen.utilities.conversion import convert_color_to_hex_code
from mugen.video.events import VideoEvent


    def __init__(self, effects: Optional[List[VideoEffect]] = None):
        super().__init__(effects)

    def add_crossfade(self, duration: float = ONE_SECOND):
        """
        Adds a crossfade effect to the beginning of the video segment.

        Parameters
        ----------
        duration
            duration of the effect
        """
        self.append(CrossFade(duration))

    def add_fadein(self, duration: float = ONE_SECOND, color: str = Color.BLACK):
        """
        Adds a fade-in effect to the video segment.

        Parameters
        ----------
        duration
            duration of the effect

        color
            hex code of the color to fade in from, i.e. #000000 for black.
            OR the special inputs 'black' and 'white'.
        """
        self.append(FadeIn(duration, color))


    def add_fadeout(self, duration: float = ONE_SECOND, color: str = Color.BLACK):