def colorpicker(value, colors):
    """
    Given set of colors, picks a color from comma-separated list
    based on initial character of string.

    Example:

    {{ user.username|colorpicker:"#00ff00,#ff0000,#0000ff" }}
    """
    choices = colors.split(",")
    return choices[ord(value[0] if value else " ") % len(choices)]