summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-backgrounds/bg-color-with-gradient-ref.html
blob: 5c76f3408aebe6e2964215af3f98745e833e190e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html>
<body>
  <canvas id="canvas" width="100" height="100"></canvas>
</body>
<script>
  var canvas = document.getElementById('canvas');
  var ctx = canvas.getContext('2d');
  var grad = ctx.createLinearGradient(0, 0, 0, 100);
  grad.addColorStop(0, 'red');
  grad.addColorStop(1, 'black');
  ctx.fillStyle = grad;
  ctx.fillRect(0, 0, 100, 100);
</script>