# Path: css2video/interpolators/interpolators.py
# class Interpolators:
#     '''Standard interpolators'''
#     LINEAR = lambda v1, v2, f: v1 * (1-f) + v2 * f
#     EASE = lambda v1, v2, f: Interpolators.LINEAR(v1, v2, bezier_interpolate(0.25,0.1,0.25,1,f))
#     EASE_IN = lambda v1, v2, f: Interpolators.LINEAR(v1, v2, bezier_interpolate(0.42,0,1,1,f))
#     EASE_OUT = lambda v1, v2, f: Interpolators.LINEAR(v1, v2, bezier_interpolate(0,0,0.58,1,f))
#     EASE_IN_OUT = lambda v1, v2, f: Interpolators.LINEAR(v1, v2, bezier_interpolate(0.42,0,0.58,1,f))
# 
#     @staticmethod
#     def get_timing_function(name):
#         name = name.upper()
#         name = name.replace('-', '_')
#         return getattr(Interpolators, name)


import copy
from .interpolators import Interpolators
    have the same number of arguments'''


class ArrayLengthMismatch(Exception):
    '''Exception raised when trying to interpolate array values which don't
    have the same length'''


def interpolate_value(from_value, to_value, fraction, type='linear'):
    '''Interpolate a value between the given two values
    from_value - initial value
    to_value   - final value
    fraction   - fraction position from the initial value
    type       - type of interpolation function'''

    if from_value.get('type') != to_value.get('type'):
        raise ValueTypeMismatch()

    value_type = from_value.get('type')
    interpolator_fn = Interpolators.get_timing_function(name=type)

    required_value = copy.deepcopy(from_value)

    if value_type in ['number', 'length', 'percentage', 'time']:
        # Interpolate the value
        required_value['value'] = interpolator_fn(
            from_value['value'], to_value['value'], fraction)

    if value_type == 'color':
        # Interpolate RGBA values

# Path: css2video/interpolators/interpolators.py
# class Interpolators:
#     '''Standard interpolators'''
#     LINEAR = lambda v1, v2, f: v1 * (1-f) + v2 * f
#     EASE = lambda v1, v2, f: Interpolators.LINEAR(v1, v2, bezier_interpolate(0.25,0.1,0.25,1,f))
#     EASE_IN = lambda v1, v2, f: Interpolators.LINEAR(v1, v2, bezier_interpolate(0.42,0,1,1,f))
#     EASE_OUT = lambda v1, v2, f: Interpolators.LINEAR(v1, v2, bezier_interpolate(0,0,0.58,1,f))
#     EASE_IN_OUT = lambda v1, v2, f: Interpolators.LINEAR(v1, v2, bezier_interpolate(0.42,0,0.58,1,f))
# 
#     @staticmethod
#     def get_timing_function(name):
#         name = name.upper()
#         name = name.replace('-', '_')
#         return getattr(Interpolators, name)


# Path: css2video/interpolators/value.py
import copy
from .interpolators import Interpolators

    have the same number of arguments'''


class ArrayLengthMismatch(Exception):
    '''Exception raised when trying to interpolate array values which don't
    have the same length'''


def interpolate_value(from_value, to_value, fraction, type='linear'):
    '''Interpolate a value between the given two values
    from_value - initial value
    to_value   - final value
    fraction   - fraction position from the initial value
    type       - type of interpolation function'''

    if from_value.get('type') != to_value.get('type'):
        raise ValueTypeMismatch()

    value_type = from_value.get('type')
    interpolator_fn = Interpolators.get_timing_function(name=type)

    required_value = copy.deepcopy(from_value)

    if value_type in ['number', 'length', 'percentage', 'time']:
        # Interpolate the value
        required_value['value'] = interpolator_fn(
            from_value['value'], to_value['value'], fraction)

    if value_type == 'color':
        # Interpolate RGBA values

        required_value['red'] = interpolator_fn(