def colstr2tuple(colstr):
    """Conterts a '#rrggbb' string to RGB 0-255 triple."""
    red = int("0x" + colstr[1:3], base=16)
    green = int("0x" + colstr[3:5], base=16)
    blue = int("0x" + colstr[5:7], base=16)
    return red, green, blue