Monolith
to generate a new and unique variation
Every variart piece is a small program. This is the one that drew what you're looking at.
// Sky, ground, then the stone's light, middle and shadow facets.
var palettes = [
['#1F2A3A', '#C9D6DC', '#E3D63A', '#D2C630', '#B5AF2A'],
['#2B2626', '#E4D8C4', '#D9774A', '#C4633C', '#A24F32'],
['#1E3B33', '#EFE6D8', '#E7A3A8', '#D98E95', '#BD7680'],
['#34304A', '#DCD3E2', '#F2EDE4', '#E0D9CC', '#C7BEAE']
];
var margin = 50;
var palette = palettes[intVariable('Palette', 1, palettes.length) - 1];
var rise = intVariable('Height', 55, 90);
var horizon = getRandomInt(230, 330);
s.rect(0, 0, width, height).attr({fill: palette[1]});
s.rect(0, 0, width, horizon).attr({fill: palette[0]});
// The stone stands on the bottom edge and runs off it, like the canvas it
// was painted on; its top and sides keep to the face.
var base = height + 10;
var bl = [getRandomInt(margin, 110), base];
var br = [getRandomInt(360, width - margin - 40), base];
var top = height - (height - margin) * rise / 100;
var apex = [getRandomInt(bl[0] + 80, br[0] - 60), top];
var left = [getRandomInt(bl[0] + 20, apex[0] - 30), getRandomInt(top + 90, top + 200)];
var right = [br[0] + getRandomInt(0, 30), top + getRandomInt(40, 110)];
// A ridge from the base up to the top edge splits lit face from shade, and a
// shoulder crease carves one more plane off the upper left.
var t = getRandomArbitary(0.35, 0.7);
var ridgeTop = [apex[0] + (right[0] - apex[0]) * t, apex[1] + (right[1] - apex[1]) * t];
var ridgeFoot = [getRandomInt(apex[0] - 20, br[0] - 60), base];
var crease = [left[0] + (ridgeTop[0] - left[0]) * 0.8, left[1] + (ridgeTop[1] - left[1]) * 0.8];
function poly(points, fill){
var flat = [];
points.forEach(function(p){ flat.push(p[0], p[1]); });
s.polygon(flat).attr({fill: fill, stroke: fill, strokeWidth: 0.5});
}
poly([bl, left, crease, ridgeFoot], palette[3]);
poly([left, apex, ridgeTop, crease], palette[2]);
poly([ridgeFoot, crease, ridgeTop, right, br], palette[4 - getRandomInt(0, 1)]);
Copyright © 2014–2026 Logic and Matter. All rights reserved. Questions? Comments? hello@variart.io