def colgen(*lstcol, **kargs):
 if (len(lstcol) < 2):
  lstcol *= 2
 trans = kargs.get('trans', (lambda x, y, z: (x, y, z)))
 while 1:
  for i in xrange(len(lstcol)):
   for j in xrange(len(lstcol)):
    for k in xrange(len(lstcol)):
     if ((i != j) or (j != k) or (k != i)):
      (yield trans(lstcol[((i + j) % len(lstcol))], lstcol[((j + k) % len(lstcol))], lstcol[((k + i) % len(lstcol))]))

def colgen ( * lstcol , ** kargs ) : if ( len ( lstcol ) < 2 ) : lstcol *= 2 trans = kargs . get ( 'trans' , ( lambda x , y , z : ( x , y , z ) ) ) while 1 : for i in xrange ( len ( lstcol ) ) : for j in xrange ( len ( lstcol ) ) : for k in xrange ( len ( lstcol ) ) : if ( ( i != j ) or ( j != k ) or ( k != i ) ) : ( yield trans ( lstcol [ ( ( i + j ) % len ( lstcol ) ) ] , lstcol [ ( ( j + k ) % len ( lstcol ) ) ] , lstcol [ ( ( k + i ) % len ( lstcol ) ) ] ) )
returns a generator that mixes provided quantities forever trans: a function to convert the three arguments into a color .