execution/run_utils.py
def draw_lerp_frames(
    pixels: neopixel.NeoPixel,
    last_frame: Frame,
    next_frame: Frame,
    transition_frames: int,
):
    """
    Interpolate between two frames and draw the result.

    :param pixels: The neopixel interface
    :param last_frame: The start frame
    :param next_frame: The end frame
    :param transition_frames: The number of frames to take to fade
    """
    for frame_index in range(1, transition_frames):
        ratio = frame_index / transition_frames
        draw_frame(
            pixels,
            [
                tuple(
                    round((1 - ratio) * channel_a + ratio * channel_b)
                    for channel_a, channel_b in zip(led_a, led_b)
                )
                for led, (led_a, led_b) in enumerate(zip(last_frame, next_frame))
            ],
            1 / 30,
        )

    Interpolate between two frames and draw the result.

    :param pixels: The neopixel interface
    :param last_frame: The start frame
    :param next_frame: The end frame
    :param transition_frames: The number of frames to take to fade
    
Interpolate between two frames and draw the result.
Interpolate between two frames and draw the result .
def draw_lerp_frames(
    pixels: neopixel.NeoPixel,
    last_frame: Frame,
    next_frame: Frame,
    transition_frames: int,
):
    for frame_index in range(1, transition_frames):
        ratio = frame_index / transition_frames
        draw_frame(
            pixels,
            [
                tuple(
                    round((1 - ratio) * channel_a + ratio * channel_b)
                    for channel_a, channel_b in zip(led_a, led_b)
                )
                for led, (led_a, led_b) in enumerate(zip(last_frame, next_frame))
            ],
            1 / 30,
        )
def draw_lerp_frames ( pixels : neopixel . NeoPixel , last_frame : Frame , next_frame : Frame , transition_frames : int , ) : for frame_index in range ( 1 , transition_frames ) : ratio = frame_index / transition_frames draw_frame ( pixels , [ tuple ( round ( ( 1 - ratio ) * channel_a + ratio * channel_b ) for channel_a , channel_b in zip ( led_a , led_b ) ) for led , ( led_a , led_b ) in enumerate ( zip ( last_frame , next_frame ) ) ] , 1 / 30 , )
Interpolate between two frames and draw the result.
Interpolate between two frames and draw the result .
"""
    Interpolate between two frames and draw the result.

    :param pixels: The neopixel interface
    :param last_frame: The start frame
    :param next_frame: The end frame
    :param transition_frames: The number of frames to take to fade
    """
pixels
neopixel.NeoPixel
The neopixel interface
The neopixel interface
last_frame
Frame
The start frame
The start frame
next_frame
Frame
The end frame
The end frame
transition_frames
int
The number of frames to take to fade
The number of frames to take to fade