Objects / lGradient
lGradient(x1, y1, x2, y2, colors)
lGradient(float x1, float y1, float x2, float y2, array colors)
lGradient(object parameters)

Create a jCanvaScript object, which you can use to set linear gradient as a color of other jCanvaScript objects.
lGradient(float x1, float y1, float x2, float y2, array colors)
Code
<script type="text/javascript">
	function onload_1(idCanvas)
	{
		jc.start(idCanvas,true);
		var colors=[[0,'rgb(0,0,0)'],
					[0.5,'rgb(255,0,0)'],
					[0.75,'rgb(255,255,0)']];
		var gradient=jc.lGradient(10,30,100,200,colors);
		jc.rect(1,1,248,263,gradient,1);
	}
</script>
<canvas id="canvas_1" width="250px" height="265px">
</canvas>
View
lGradient(object parameters)
Code
<script type="text/javascript">
	function onload_2(idCanvas)
	{
		jc.start(idCanvas,true);
		var colors=[[0,'rgb(0,0,0)'],
					[0.5,'rgb(255,0,0)'],
					[0.75,'rgb(255,255,0)']];
		var gradient=jc.lGradient({x2:100,y2:200,colors:colors});
		jc.rect(1,1,248,263,gradient,1);
	}
</script>
<canvas id="canvas_2" width="250px" height="265px">
</canvas>
View