ludo.svg.Gradient

ludo.svg.


new ludo.svg.Gradient(config)

Class for linear gradients

Parameters:
Name Type Description
config Object
Source:
Example
var gradient = new ludo.svg.Gradient({
		id:'myGradient'
	});
	gradient.addStop('0%', 'red');
	gradient.addStop('100%', '#FFF', 1);

Extends

  • canvas.NamedNode

Methods


addStop(offset, stopColor, stopOpacity) → {ludo.svg.Stop}

Add stop point

Parameters:
Name Type Description
offset String
stopColor String
stopOpacity Number | undefined
Source:
Returns:

stop

Type
ludo.svg.Stop
Example
var gradient = new ludo.svg.Gradient({
			id:'myGradient'
		 });
		 gradient.addStop('0%', 'red');
		 gradient.addStop('100%', '#FFF', 1);
	 	 canvas.append(gradient);

getStop(index) → {canvas.Stop}

Get stop node by index

Parameters:
Name Type Description
index Number
Source:
Returns:

stop

Type
canvas.Stop