function parseLinearGradient(gradient) {
		var direction = defaultLinearDirections[0];
		
		// extract tokens
		/** @type StringStream */
		var stream = require('stringStream').create(require('utils').trim(gradient));
		var colorStops = [], ch;
		while (ch = stream.next()) {
			if (stream.peek() == ',') {
				colorStops.push(stream.current());
				stream.next();
				stream.eatSpace();
				stream.start = stream.pos;
			} else if (ch == '(') { // color definition, like 'rgb(0,0,0)'
				stream.skipTo(')');
			}
		}
		
		// add last token
		colorStops.push(stream.current());
		colorStops = _.compact(_.map(colorStops, normalizeSpace));
		
		if (!colorStops.length)
			return null;
		
		// let's see if the first color stop is actually a direction
		if (reDeg.test(colorStops[0]) || reKeyword.test(colorStops[0])) {
			direction = colorStops.shift();
		}
		
		return {
			type: 'linear',
			direction: direction,
			colorStops: _.map(colorStops, parseColorStop)
		};
	}
function parseLinearGradient(gradient) {
		var direction = defaultLinearDirections[0];
		
		
		
		var stream = require('stringStream').create(require('utils').trim(gradient));
		var colorStops = [], ch;
		while (ch = stream.next()) {
			if (stream.peek() == ',') {
				colorStops.push(stream.current());
				stream.next();
				stream.eatSpace();
				stream.start = stream.pos;
			} else if (ch == '(') { 
				stream.skipTo(')');
			}
		}
		
		
		colorStops.push(stream.current());
		colorStops = _.compact(_.map(colorStops, normalizeSpace));
		
		if (!colorStops.length)
			return null;
		
		
		if (reDeg.test(colorStops[0]) || reKeyword.test(colorStops[0])) {
			direction = colorStops.shift();
		}
		
		return {
			type: 'linear',
			direction: direction,
			colorStops: _.map(colorStops, parseColorStop)
		};
	}
function parseLinearGradient ( gradient ) { var direction = defaultLinearDirections [ 0 ] ; // extract tokens /** @type StringStream */ var stream = require ( 'stringStream' ) . create ( require ( 'utils' ) . trim ( gradient ) ) ; var colorStops = [ ] , ch ; while ( ch = stream . next ( ) ) { if ( stream . peek ( ) == ',' ) { colorStops . push ( stream . current ( ) ) ; stream . next ( ) ; stream . eatSpace ( ) ; stream . start = stream . pos ; } else if ( ch == '(' ) { // color definition, like 'rgb(0,0,0)' stream . skipTo ( ')' ) ; } } // add last token colorStops . push ( stream . current ( ) ) ; colorStops = _ . compact ( _ . map ( colorStops , normalizeSpace ) ) ; if ( ! colorStops . length ) return null ; // let's see if the first color stop is actually a direction if ( reDeg . test ( colorStops [ 0 ] ) || reKeyword . test ( colorStops [ 0 ] ) ) { direction = colorStops . shift ( ) ; } return { type : 'linear' , direction : direction , colorStops : _ . map ( colorStops , parseColorStop ) } ; }
Parses linear gradient definition
@param {String}
Parses linear gradient definition