I have the following gradient on canvas.
My question is: Why, if I set the red to 0.5, does it appear in the middle of the bar?
How do I get my color to appear right in the center? How does the gradient system work?
LOOK AT COMPLETE SCREEN
function fade() {
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var gradient = canvas.getContext("2d").createLinearGradient(0, 0, 1, 500);
gradient.addColorStop(0, 'gray');
gradient.addColorStop(0.5, 'red');
gradient.addColorStop(0.6, 'red');
gradient.addColorStop(1.0, 'gray');
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, 200, 800);
}
fade();
<canvas id="canvas" width="200px" height="800"></canvas>