def get_wedge_color(theta, depth, scalar_cmap):
    """Gets a color for a wedge to be, of the form
    (r, g, b, a).
    Each component is scaled from 0 to 1."""
    # get the index of the color in the colormap
    # (convert from degrees to float 0-to-1)
    color_index = theta / 360.0
    # get the color at that index
    color = scalar_cmap.to_rgba(color_index)

    # modify the alpha of the color
    # greater depths --> lighter color
    amod = 0.8 ** (depth)
    color = (
        color[0],
        color[1],
        color[2],
        color[3] * amod)

    return color