summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-paint-api/paint2d-canvasFilter-ref.html
blob: e8231c254c6500ed37eae68a5d29e04a7921707a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
<body>
<canvas id="output" width="100" height="100"></canvas>
<script>
var canvas = document.getElementById('output');
var ctx = canvas.getContext('2d');

ctx.filter = new CanvasFilter([
  {filter: "gaussianBlur", stdDeviation: 10},
  {filter: "colorMatrix", type: "hueRotate", values: 90}
]);

ctx.fillStyle = "cyan";
ctx.fillRect(40, 0, 70, 70);
ctx.fillStyle = "magenta";
ctx.fillRect(40, 40, 70, 70);
ctx.fillStyle = "yellow";
ctx.fillRect(0, 40, 70, 70);
</script>
</body>
</html>