Here's a function that, given a color specification in hex RGB, returns its HSV color:
import colorsys
def get_hsv(hexrgb):
    hexrgb = hexrgb.lstrip("#")   # in case you have Web color specs
    r, g, b = (int(hexrgb[i:i+2], 16) / 255.0 for i in xrange(0,5,2))
    return colorsys.rgb_to_hsv(r, g, b)
Now you can use this to sort your list of RGB hex colors by hue:
color_list = ["000050", "005000", "500000"]  # GBR
color_list.sort(key=get_hsv)
print color_list