def hex_to_rgb(value):
    value = value.lstrip('#')
    lv = len(value)
    return tuple(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
Change a hex color to an rgb tuple
dataset/ETHPy150Open plotly/plotly.py/plotly/matplotlylib/mpltools.py/hex_to_rgb