Functions / colorStops
colorStops(colorStops)
colorStops( )
colorStops(array colorStops)

colorStops( )
return: array of colorStops

colorStops(array colorStops)
return: object
colorStops is [[float position,string color],...] or [[float position, int R, int G, int B, float alpha],...] array.
Code
<script type="text/javascript">
var colorStops=[[0,255,0,0,1],
				[0.5,255,255,0,0.5],
				[0.6,200,255,0,1],
				[0.8,0,255,0,1],
				[1,0,0,255,1]];
	function start_2(idCanvas)
	{
		jc('#myGradient_2')
			.colorStops(colorStops);
	}
	function stop_2(idCanvas)
	{
		jc.clear(idCanvas);
		onload_2(idCanvas);
	}
	function onload_2(idCanvas)
	{
		jc.start(idCanvas,true);
		gradient=jc.lGradient(0,0,250,265)
			.id('myGradient_2');
		jc.rect(0,0,250,265,gradient,1);
	}
</script>
<canvas id="canvas_2" width="250px" height="265px">
</canvas>
View