def get_color_index(color,palette):
    """Returns the index of color in palette.

    Parameters:
        color:    List with 3 int values (RGB)
        palette:  List with colors each represented by 3 int values (RGB)

    Returns:
        Index of color in palette.
        -1 if not found.
    """

    for x in range(0,len(palette),3):
        if palette[x:x+3]==color: return x//3
    return -1