Functions / addColorStop
addColorStop(position, color)
addColorStop(float position, string color)

addColorStop(float position, string color)
return: object
Code
<script type="text/javascript">
var colorStops=[[0,"#ff0000"],
				[0.5,"rgba(255,255,0,0.5)"],
				[0.6,"rgb(200,255,0)"],
				[0.8,"rgb(0,255,0)"],
				[1,"#0000ff"]];
var count=0;
	function start_1(idCanvas)
	{
		if(count>4)stop_1(idCanvas);
		jc('#myGradient_1')
			.addColorStop(colorStops[count][0],colorStops[count][1]);
		count++;
	}
	function stop_1(idCanvas)
	{
		count=0;
		jc.clear(idCanvas);
		onload_1(idCanvas);
	}
	function onload_1(idCanvas)
	{
		jc.start(idCanvas,true);
		gradient=jc.lGradient(0,0,250,265)
			.id('myGradient_1')
		jc.rect(0,0,250,265,gradient,1);
	}
</script>
<canvas id="canvas_1" width="250px" height="265px">
</canvas>
View