def make_mid_color(self, color1, color2, distance, long_route=False):
def fade(a, b):<EOL><INDENT>x = b * distance<EOL>x += a * (<NUM_LIT:1> - distance)<EOL>return x<EOL><DEDENT>h1, s1, v1 = color1<EOL>h2, s2, v2 = color2<EOL>hue_diff = h1 - h2<EOL>if long_route:<EOL><INDENT>if hue_diff < <NUM_LIT:0.5> and hue_diff > -<NUM_LIT:0.5>:<EOL><INDENT>h1 += <NUM_LIT:1><EOL><DEDENT><DEDENT>else:<EOL><INDENT>if hue_diff > <NUM_LIT:0.5>:<EOL><INDENT>h2 += <NUM_LIT:1><EOL><DEDENT>elif hue_diff < -<NUM_LIT:0.5>:<EOL><INDENT>h1 += <NUM_LIT:1><EOL><DEDENT><DEDENT>return (modf(fade(h1, h2))[<NUM_LIT:0>], fade(s1, s2), fade(v1, v2))<EOL>
Generate a mid color between color1 and color2.
Colors should be a tuple (hue, saturation, value).

distance is a float between 0.0 and 1.0 describing how far between
color1 and color2 we want to return the color. 0.0 would return color1,
1.0 color2, and 0.5 a color midway.

long_route allows us to choose how we get from color1 to color2 around
the color wheel if True we go the long way, through as many colors as
we can, if False we go through the minimum number