Smaller Triangles
to generate a new and unique variation
Every variart piece is open source, you can see exactly how it is drawn from the code.
var colors = ["#000000", "#D29A27", "#C67FA3", "#2EA6D7", "#C73135", "#524FA3", "#C6B9AD", "#DD6830"];
var squareSize = 50;
for (var x = 0; x < 500; x += squareSize){
for (var y = 0; y < 500; y += squareSize){
var offset = getRandomInt(0, colors.length - 1);
var mask = s.group(s.rect(x, y, squareSize, squareSize));
s.circle(x, y, squareSize).attr({mask: mask, fill: colors[offset]});
if(getRandomInt(0, 1) == 1){
s.polygon([x, y, x, y + squareSize, x + squareSize, y])
.attr({
fill: colors[offset]
});
} else {
s.polygon([x, y, x, y + squareSize, x + squareSize, y + squareSize])
.attr({
fill: colors[offset]
});
}
}
}
Copyright © 2014–2025 Kevin Marsh. All rights reserved. Questions? Comments? hello@variart.io