Leeway
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 backgroundColor = '#fafad4';
var upperLeftColor = '#1aada2';
var lowerRightColor = '#ed6a3a';
var strokeWidth = 100;
var rotatability = 9;
s.rect(0, 0, width, height).attr({fill: backgroundColor});
// upper left
for (var i = 0; i <= width - 50; i += strokeWidth * 0.7){
s.line(0, i, i, 0)
.attr({strokeWidth: strokeWidth, stroke: upperLeftColor, strokeOpacity: 1-(i/width)})
.transform("r" + getRandomInt(-rotatability, rotatability));
}
// bottom right
var opacity = 1;
for (var i = 0; i <= width - 50; i += strokeWidth * 0.7){
s.line(width, height - i, width - i, height)
.attr({strokeWidth: strokeWidth, stroke: lowerRightColor, strokeOpacity: 1-(i/width)})
.transform("r" + getRandomInt(-rotatability, rotatability));
}
Copyright © 2014–2025 Kevin Marsh. All rights reserved. Questions? Comments? hello@variart.io