Created
April 12, 2019 12:07
-
-
Save gosub/29337a0f55bf4a1cafdacf8b328c8dbb to your computer and use it in GitHub Desktop.
Phone wallpaper sketch 2019-04-12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// wallpaper sketch 2019-04-12 | |
// by Giampaolo Guiducci | |
// [email protected] | |
// 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