def fill_surface(
    surface: Surface,
    color: {
        'widget_name': 'color_button',
        'widget_kwargs': {'color_format': 'rgb_tuple'},
        'type': (tuple, list, str, Color),
    } = (255, 0, 0),
    rect: (Rect, type(None)) = None,
    special_flags=0,
) -> [
    {'name': 'surface', 'type': Surface},
    {'name': 'affected_rect', 'type': Rect},
]:
    """Fill surface and return affected area and surface itself."""
    affected_rect = surface.fill(color, rect, special_flags)

    return {
        'surface': surface,
        'affected_rect': affected_rect,
    }
Fill surface and return affected area and surface itself.
nodezator/graphman/capsulenode/pygamedefs.py