def get_colors(
    n: int,
    *,
    cmap: str = "viridis",
    start: float = 0,
    stop: float = 1,
    alpha: float | None = None,
) -> list[str]:
    """
    Return `n` evenly-spaced colors from a matplotlib colormap.

    Parameters
    ----------
    n
        How many colors to sample.
    cmap
        Name of the matplotlib colormap from which to sample the colors.
    start
        Where to start sampling from the colorspace (from 0 to 1).
    stop
        Where to end sampling from the colorspace (from 0 to 1).
    alpha
        If `None`, return colors as HTML-like hex triplet "#rrggbb" RGB
        strings. If `float`, return as "#rrggbbaa" RGBa strings.

    Returns
    -------
    color_list
        The sampled colors.
    """
    _verify_mpl()
    color_gen = (colormaps[cmap](x) for x in np.linspace(start, stop, n))
    keep_alpha = alpha is not None
    if keep_alpha:
        color_gen = ((r, g, b, alpha) for r, g, b, _ in color_gen)
    return [colors.to_hex(c, keep_alpha=keep_alpha) for c in color_gen]

    Return `n` evenly-spaced colors from a matplotlib colormap.

    Parameters
    ----------
    n
        How many colors to sample.
    cmap
        Name of the matplotlib colormap from which to sample the colors.
    start
        Where to start sampling from the colorspace (from 0 to 1).
    stop
        Where to end sampling from the colorspace (from 0 to 1).
    alpha
        If `None`, return colors as HTML-like hex triplet "#rrggbb" RGB
        strings. If `float`, return as "#rrggbbaa" RGBa strings.

    Returns
    -------
    color_list
        The sampled colors.
    
osmnx/plot.py