example/js/svg.js
function(o) {
      if (typeof o == 'number' || o instanceof SVG.Number) {
        o = {
          offset:  arguments[0]
        , color:   arguments[1]
        , opacity: arguments[2]
        }
      }

      // set attributes
      if (o.opacity != null) this.attr('stop-opacity', o.opacity)
      if (o.color   != null) this.attr('stop-color', o.color)
      if (o.offset  != null) this.attr('offset', new SVG.Number(o.offset))

      return this
    }
function(o) {
      if (typeof o == 'number' || o instanceof SVG.Number) {
        o = {
          offset:  arguments[0]
        , color:   arguments[1]
        , opacity: arguments[2]
        }
      }

      // set attributes
      if (o.opacity != null) this.attr('stop-opacity', o.opacity)
      if (o.color   != null) this.attr('stop-color', o.color)
      if (o.offset  != null) this.attr('offset', new SVG.Number(o.offset))

      return this
    }
function ( o ) { if ( typeof o == 'number' || o instanceof SVG . Number ) { o = { offset : arguments [ 0 ] , color : arguments [ 1 ] , opacity : arguments [ 2 ] } } // set attributes if ( o . opacity != null ) this . attr ( 'stop-opacity' , o . opacity ) if ( o . color != null ) this . attr ( 'stop-color' , o . color ) if ( o . offset != null ) this . attr ( 'offset' , new SVG . Number ( o . offset ) ) return this }
add color stops
add color stops