Skip to content

Instantly share code, notes, and snippets.

@gosub
Created April 12, 2019 12:07
Show Gist options
  • Save gosub/29337a0f55bf4a1cafdacf8b328c8dbb to your computer and use it in GitHub Desktop.
Save gosub/29337a0f55bf4a1cafdacf8b328c8dbb to your computer and use it in GitHub Desktop.
Phone wallpaper sketch 2019-04-12
// wallpaper sketch 2019-04-12
// by Giampaolo Guiducci
// giampaolo.guiducci@gmail.com
// https://github.com/gosub
// render with: editor.p5js.org
function setup() {
var scale = 1;
createCanvas(1080/scale, 1920/scale);
colorMode(HSB);
background(15);
strokeWeight(7/scale);
noFill();
// shape seed
noiseSeed(964);
// color seed
randomSeed(1900);
var ydivisions = 30;
var xdivisions = 7;
var ystep = height/ydivisions;
var starthue = random(360);
var stophue = random(360);
var stephue = (stophue-starthue)/ydivisions;
var hue = starthue;
for(var starty=ystep*2; starty<height-ystep*2; starty += ystep) {
startx = width/10;
length = width-startx*2;
stroke(hue, 80, 70);
beginShape();
curveVertex(startx, starty);
curveVertex(startx, starty);
for(var i=1; i<xdivisions-1; i++){
var x = startx+(length/(xdivisions-1))*i;
var y = starty;
var noiz = noise(width/x, starty/height) - 0.5;
y += noiz * ystep*4;
curveVertex(x, y);
}
curveVertex(startx+length, starty);
curveVertex(startx+length, starty);
endShape();
hue += stephue;
}
save("wallpaper_sketch_2019-04-12.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment