from typing import Optional
from typing import Tuple
from typing import Any


def top_color_and_depth(container: tuple) -> Optional[Tuple[Any, int]]:
    """
    Returns the top color from the container, along with the number
    of continuous segments that are that color.
    """
    if len(container) == 0:
        return None

    top_c = None
    for i, color in enumerate(container):
        if top_c is None:
            top_c = color
        elif top_c != color:
            return top_c, i

    return top_c, len(container)