def get_colored_surface(self, color):
        """Return new colored surface w/ alpha masked out.

        Parameters
        ==========
        color (sequence of integers)
            represent a color with which to fill the surface
            before masking out the alpha/transparency;

            the integers, in the range(0, 256) interval,
            represent values of red, green and blue channels
            of a color; a fourth integer can optionally be
            provided as well, which represents the alpha.
        """
        ### create a surface with an alpha channel, having
        ### the same size as the mask and fill it with the
        ### given color

        surf = Surface(self.size).convert_alpha()
        surf.fill(color)

        ### mask the transparency out of the surface using
        ### the best masking method according to whether
        ### the color has transparency or not, that is,
        ### whether it has a fourth value lower than 255

        ## check whether the color has an alpha value
        try:
            alpha = color[3]

        ## if it hasn't, it means it is a solid color, so
        ## so we use the masking operation which replaces
        ## the alpha values
        except IndexError:
            self.mask_by_replacing(surf)

        ## otherwise, pick the operation according to the
        ## value of the alpha

        else:

            ### pick operation

            (
                ## if alpha is lower than 255, it means the
                ## color has some transparency to it,
                ## so we pick the operation suitable for such
                ## kind of color
                self.mask_by_multiplying
                if alpha < 255
                ## otherwise we use the one best suited to
                ## mask surfaces with solid colors
                else self.mask_by_replacing
                ## we then pass the surface to the
                ## operation we just chose
            )(surf)

        ### finally, return the surface
        return surf
Return new colored surface w/ alpha masked out.

        Parameters
        ==========
        color (sequence of integers)
            represent a color with which to fill the surface
            before masking out the alpha/transparency;

            the integers, in the range(0, 256) interval,
            represent values of red, green and blue channels
            of a color; a fourth integer can optionally be
            provided as well, which represents the alpha.
        
nodezator/alphamask/basicop.py