JSFiddle - React, Tailwind, and code Playground
by Florent27000
HTML
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="200" height="20"
style="border:1px solid #c3c3c3;">
Your browser does not support the canvas element.
</canvas>
</body>
</html>
JavaScript
var canvas = document.getElementById("myCanvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "#FF0000";
ctx.fillRect(0,0,20,20);
ctx.fillRect(180,0,20,20);
ctx.fillStyle = "#ffc107";
ctx.fillRect(20,0,20,20);
ctx.fillRect(160,0,20,20);
ctx.fillStyle = "#47B155";
ctx.fillRect(40,0,120,20);