Two Letters
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 = '#f0f0d8';
var letterA = intVariable('letterA', 0, 25);
var letterB = intVariable('letterB', 0, 25);
var letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
s.rect(0, 0, width, height).attr({fill: backgroundColor})
function getRandomColor() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function drawLetter(x, y, letter) {
s.text(x, y, letter).attr({
'fill': getRandomColor(),
'opacity': 0.7,
'font-size': 350,
'font-family': 'Helvetica',
'font-weight': 'bold',
'text-anchor': 'middle'
});
}
drawLetter(175, 375, letters[letterA]);
drawLetter(325, 375, letters[letterB]);
Copyright © 2014–2025 Kevin Marsh. All rights reserved. Questions? Comments? hello@variart.io