def colored_neighbours(pattern, index, color):
    """
    Count the number of neighbours with the color

    :param pattern: Pattern
    :param index: Index of a Polygon
    :param color: color
    :return: Int
    """

    polygon = pattern.list_polygons[index]

    count = 0

    for neigh_index in polygon.list_neighbours:
        other_polygon = pattern.list_polygons[index]

        if other_polygon.color_index == color:
            count += 1

    return count