def hex_int(hexstring):
    """converts #hexdigits to r,g,b integer colours"""
    if not hexstring:
        return 0, 0, 0
    hexstring = hexstring.strip('#')
    r = int(hexstring[0:2], base=16)
    g = int(hexstring[2:4], base=16)
    b = int(hexstring[4:6], base=16)
    return r, g, b
