     @_setColor(@_bottomColor, arguments...)
 
   _setColor: (varColor, color) ->
-    if arguments.length >= 3
-      varColor._red = arguments[0]
-      varColor._green = arguments[1]
-      varColor._blue = arguments[2]
-      varColor._strength = arguments[3] if typeof arguments[3] is 'number'
+    if arguments.length >= 4
+      varColor._red = arguments[1]
+      varColor._green = arguments[2]
+      varColor._blue = arguments[3]
+      varColor._strength = arguments[4] if typeof arguments[4] is 'number'
     else
       # First argument is color name
       Crafty.assignColor(color, varColor)
       # Second argument, if present, is strength of color
       # Note that assignColor will give a default strength of 1.0 if none exists.
-      varColor._strength = arguments[1] if typeof arguments[1] is 'number'
+      varColor._strength = arguments[2] if typeof arguments[2] is 'number'
 
     @trigger 'Invalidate'
     this

  init: ->
    @bind 'Draw', @_drawGradient
    if @has 'WebGL'
      @_establishShader 'Gradient',
        GRADIENT_FRAGMENT_SHADER,
        GRADIENT_VERTEX_SHADER,
        GRADIENT_ATTRIBUTE_LIST

  _drawGradient: (e) ->
    if e.type is 'webgl'
      e.program.writeVector('aColor',
        @_topColor._red/255,
        @_topColor._green/255,
        @_topColor._blue/255,
        @_topColor._strength,

        @_bottomColor._red/255,
        @_bottomColor._green/255,
        @_bottomColor._blue/255,
        @_bottomColor._strength
      )

  topColor: (color) ->
