(cls, pixel)
return cls(*map(int, list(pixel)))
Convert a pixel (list of 3-4 values) to a Color instance.
Convert a pixel (list of 3-4 values) to a Color instance.
Convert a pixel ( list of 3 - 4 values ) to a Color instance .
def from_pixel(cls, pixel):
        """
        Convert a pixel (list of 3-4 values) to a Color instance.
        """
        assert len(pixel) in (3,4), "Color.from_pixel only supports 3 and 4 value pixels"
        return cls(*map(int, list(pixel)))
def from_pixel ( cls , pixel ) : assert len ( pixel ) in ( 3 , 4 ) , "Color.from_pixel only supports 3 and 4 value pixels" return cls ( * map ( int , list ( pixel ) ) )