human
I wrote the below code

    def rgb_to_hex(rgb):
        return (u'#%02x%02x%02x' % tuple(rgb))
    triples = [(1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 0), (0, 1, 1), (1, 0, 1), (1, 1, 1)]
    n = (1 << 7)
    so_far = [[0, 0, 0]]
    while True:
        if (n == 0):
            (yield u'#000000')
        copy_so_far = list(so_far)
        for triple in triples:
            for previous in copy_so_far:
                rgb = [((n * triple[i]) + previous[i]) for i in range(3)]
                so_far.append(rgb)
                (yield rgb_to_hex(rgb))
        n >>= 1

What's a good function header?
assistant
#Here's a good function header.

def contrasting_color_generator():