def render_rect(width, height, color=BLACK):
    """Return surface representing rect with a single color.

    Parameters
    ==========

    width (integer)
        indicates desired width of the generated surface
        or obj.
    height (integer)
        indicates desired height of the generated surface
        or obj.
    color (sequence with 3 or 4 integers)
        represents a color to fill the surface;
        the integers are in the range(256) and represent
        values of red, green and blue channels of a color
        (a fourth integer may also appear, indicating the
        value of the alpha channel, indicating the
        opacity/transparency).
    """
    ### instantiate surface taking transparency into account

    try:
        has_transparency = color[3] < 255

    except IndexError:
        has_transparency = False

    finally:

        if has_transparency:
            surf = Surface((width, height)).convert_alpha()

        else:
            surf = Surface((width, height)).convert()

    surf.fill(color)

    ### finally return the surf
    return surf
Return surface representing rect with a single color.

    Parameters
    ==========

    width (integer)
        indicates desired width of the generated surface
        or obj.
    height (integer)
        indicates desired height of the generated surface
        or obj.
    color (sequence with 3 or 4 integers)
        represents a color to fill the surface;
        the integers are in the range(256) and represent
        values of red, green and blue channels of a color
        (a fourth integer may also appear, indicating the
        value of the alpha channel, indicating the
        opacity/transparency).
    
nodezator/surfsman/render.py