RGB 0-100

How to use RGB on a scale to 0 - 100.

by peterbode1989

HTML

<canvas id="foo"></canvas>

CSS

#foo {
  width: 100%;
  height: 100%;
}

JavaScript

var c = document.getElementById("foo");



var i = 0;
var timer = setInterval(function() {
console.log(i);
		var ctx = c.getContext("2d");
	ctx.beginPath();
  ctx.arc(75, 75, 50, 0, (i / 100) * Math.PI);
  ctx.strokeStyle = 'RGB('+((100-i)*2)+', '+i+', 0)';
  ctx.stroke();
  if((i / 100) == 2) {
  	clearInterval(timer);
  	console.log('FULL');
  }
  i++;
}, 100);