@classmethod
    def from_html(cls, col_str, a=1.0):

        """Creates a color object from an html style color string.

        col_str -- The color string (eg. "#FF0000")

        """

        if len(col_str) != 7 or col_str[0] != '#':
            raise ValueError("Requires a color encoded in a html style string")

        c = cls.__new__(cls, object)

        components = col_str[1:3], col_str[3:5], col_str[5:6]

        try:
            c._c = [ int(s, 16) / 255.0 for s in components ] + [ a ]
        except __HOLE__:
            raise ValueError \
                ("Components should be encoded as two hex characters")
dataset/ETHPy150Open PythonProgramming/Beginning-Game-Development-with-Python-and-Pygame/gameobjects/color.py/ColorRGBA.from_html