def invert(percentage=1.0):
    """
    Color inversion filter.

    Author: Printed in XNA Unleashed - readpated for GLSL by SolarLune
    Date Updated: 6/6/11
    """

    return ("""

    // Name: Invert
    // Author: printed in XNA Unleashed, readapted by SolarLune
    // Date Updated: 6/6/11

    uniform sampler2D bgl_RenderedTexture;

    void main(void)
    {
        vec4 invert = 1.0 - texture2D(bgl_RenderedTexture, gl_TexCoord[0].st);
        vec4 color = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st);
        gl_FragColor = mix(color, invert, """ + str(float(percentage)) + """);
        gl_FragColor.a = 1.0;
    }
    """)