import colorsys


def gen_colors(N):
    """
    Generate N colors as far from each other as possible
    """
    HSV_tuples = [(x*1.0/N, 0.5, 0.5) for x in range(N)]
    RGB_tuples = [colorsys.hsv_to_rgb(*x) for x in HSV_tuples]
    RGB_tuples = [[int(x[0]*255), int(x[1]*255), int(x[2]*255)] for x in RGB_tuples]
    return RGB_tuples