HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <canvas id="point" width="160" height="160">Your browser does not support the canvas element. </canvas> <script> var canvas = document.getElementById("point"); var ctx = canvas.getContext("2d"); ctx.globalCompositeOperation = "hue"; ctx.fillStyle = "blue"; ctx.fillRect(10, 10, 100, 100); ctx.fillStyle = 'red'; ctx.fillRect(50, 50, 100, 100); </script> </body> </html>
OUTPUT
×

Save as Private