def hex_to_rgb ( h ) : h = h . lstrip ( '#' ) return tuple ( int ( h [ i : i + 2 ] , 16 ) / 255. for i in ( 0 , 2 , 4 ) )
python get rgb values from hex value
Returns 0 to 1 rgb from a hex list or tuple
def hex_to_rgb(h):
    """ Returns 0 to 1 rgb from a hex list or tuple """
    h = h.lstrip('#')
    return tuple(int(h[i:i+2], 16)/255. for i in (0, 2 ,4))