       else
         "color-stop(#{color})"
 
+  # Fix radial direction syntax
+  fixRadial: (params) ->
+    first = params[0].split(/\s+at\s+/)
+    params.splice(0, 1, first[1], first[0])
+
   # Remove old WebKit gradient too
   old: (prefix) ->
     if prefix == '-webkit-'

    param = Math.abs(450 - param) % 360
    param = @roundFloat(param, 3)
    "#{param}deg"

  # Fix radial direction syntax
  fixRadial: (params) ->
    first = params[0].split(/\s+at\s+/)
    params.splice(0, 1, first[1], first[0])

  oldDirection: (params) ->
    params if params.length == 0

  @names = ['linear-gradient', 'repeating-linear-gradient',
            'radial-gradient', 'repeating-radial-gradient']

  # Change degrees for webkit prefix
  replace: (string, prefix) ->
    values = list.comma(string).map (value) =>
      return value if value[0..@name.length] != @name + '('

      close  = value.lastIndexOf(')')
      after  = value[close + 1..-1]
      args   = value[@name.length + 1..close - 1]
      params = list.comma(args)
      params = @newDirection(params)

      if prefix == '-webkit- old'
        @oldWebkit(value, args, params, after)
      else
        @convertDirection(params)
        prefix + @name + '(' + params.join(', ') + ')' + after

    values.join(', ')

