Rainbow Dot Flag

Create waved and dotef flag with javascript.

Create waved and dotef flag with javascript.

function drawDotFlag(dst_ctx, dots_x, dots_y, angle) {
    var sx = 0;
    var sy = 0;
    
    for (j = 0; j < dots_y; j++) {
         for (i = 0; i < dots_x; i++) {
              var x = i * 15 + 100;
              var y = j * 15 + 70;
              var sy = Math.floor(80 * (Math.sin((x / 2 + counter * 2) * Math.PI / 180)));
              var sx = Math.floor(280 * (Math.sin((y / 2 + counter * 2) * Math.PI / 180)));
              y+=sy;
              x+=sx;
              var color = parseInt(i + j + counter * 2);
              dst_ctx.strokeStyle = "hsla(" + color + ", 100%, 50%, 1.0)";
              dst_ctx.strokeRect(x, y, 1, 1);
         }
    }

    counter++;
}

 

fp.TAGS