         
         
         // Add the last gradient
-        string = "color = mix(color, color0, smoothstep(location\(colors.count - 1), 1.0, angle)); "
+        string = "color = mix(color, color0, smoothstep(location\(colors.count - 1), location0 + 1.0, angle)); "
         stringRange = (sweepGradientShader as NSString).rangeOfString("vec4 color = mix(color0, color1, smoothstep(location0, location1, angle)); ")
         sweepGradientShader = sweepGradientShader.insert(string: string, atIndex: stringRange.location + stringRange.length)
         

            string = "color = mix(color, color\(i), smoothstep(location\(i - 1), location\(i), angle)); "
            sweepGradientShader = sweepGradientShader.insert(string: string, atIndex: stringRange.location + stringRange.length)
        }
        
        
        // startAngle
        string = " - \(angle)"
        stringRange = (sweepGradientShader as NSString).rangeOfString("angle = mod(angle / (2.0 * M_PI), 1.0)")
        sweepGradientShader = sweepGradientShader.insert(string: string, atIndex: stringRange.location + stringRange.length)
        
        
        // Remap (0, 0)

    
    :param: center A optional point in the coordinate system of (0.0, 0.0) to (1.0, 1.0), where (0.0, 0.0) is the bottom left corner of the sprite and (1.0, 1.0) is the top right. Default is (0.5, 0.5).
    
    :param: startAngle An optional angle in radians between 0 and 2Pi, where 0 is to the right along the x axis. Red will start at this angle. Default is 0.  The related uniform is u_startAngle.
    
    :param: blended If true, the given colors will be blended with the texture's existing colors; if false the node will have purely the given colors. Note that if true the keepShape value will be ignored.
    
