programming-examples/js/Drawing/Draw two intersecting rectangles, one of which has alpha transparency.js

14 lines
459 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
function draw()
{
var canvas = document.getElementById("canvas");
if (canvas.getContext)
{
var context = canvas.getContext("2d");
context.fillStyle = "rgb(256,0,0)";
context.fillRect (15, 10, 55, 50);
context.fillStyle = "rgba(0, 0, 200, 0.6)";
context.fillRect (35, 30, 55, 50);
}
}