def color_cmp(a, b):
if a == b:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>a, b = rgb_to_hsv(a), rgb_to_hsv(b)<EOL>return -<NUM_LIT:1> if a < b else <NUM_LIT:1><EOL>
Order colors by hue, saturation and value, in that order.

    Returns -1 if a < b, 0 if a == b and 1 if a < b.