def assign_colors(ref):
    """
    Assign colors to reference points, depending on user settings.

    Parameters
    ----------
    ref: list of ReferencePoint
        Reference points, which need to get their color property filled

    Returns
    -------
    ref: list of ReferencePoint
        Reference points, which got their color property filled
    """
    # loop over reference points
    auto_color_count = 0
    for i_ref in ref:
        if i_ref['auto_color']:
            auto_color_count += 1

    auto_colors = [
        [0.0, 0.5 * (1.0 + i_auto / auto_color_count), 0.0, 0.9]
        for i_auto in range(auto_color_count)
    ]

    # loop over reference points and assign auto_colors
    auto_color_count = 0
    for i_num, i_ref in enumerate(ref):
        if i_ref['auto_color']:
            i_ref['color'] = auto_colors[i_num]
            auto_color_count += 1

    return ref