let colors = ["#94472f", "#20283a", "#0e5264", "#522829", "#20283a", "#c97a5a", "#debe98"]
let xLine, yLine, bgColor, xdiv
let noiseAmount, center, m
m = min(windowWidth, windowHeight)
center = createVector(random(m * 0.25, m * 0.75), random(m * 0.25, m * 0.75))
noiseAmount = height / 20
let bgIndex = floor(random(colors.length))
let angleSet = random(TAU)
let fullAngle = TAU * 0.66
let incAmount = fullAngle / 150
for (let r = width / 10; r < width; r += width / 10) {
for (let a = angleSet; a < angleSet + fullAngle; a += incAmount) {
let thickness = map(a, angleSet, angleSet + fullAngle, 0, width / 30)
let x = center.x + cos(a) * (r - thickness)
let y = center.y + sin(a) * (r - thickness)
let pt = createVector(x, y)
for (let a = angleSet + fullAngle; a > angleSet; a -= incAmount) {
let thickness = map(a, angleSet, angleSet + fullAngle, 0, width / 30)
let x = center.x + cos(a) * (r + thickness)
let y = center.y + sin(a) * (r + thickness)
let pt = createVector(x, y)
shapes.push(new shape(pts, colors[0]))
angleSet += random(HALF_PI, PI + QUARTER_PI)
for (let y = noiseAmount * 2; y < height; y += noiseAmount) {
let x = noise(y, frameCount) * width
let r = random(noiseAmount * 0.1, noiseAmount * 0.35)
addInk(x, y, r, colors[1])
for (let y = noiseAmount * 2; y < height; y += noiseAmount) {
let x = noise(y, frameCount) * width
let r = random(noiseAmount * 0.05, noiseAmount * 0.15)
addInk(x, y, r, colors[1])
addInk(random(width * 0.1, width * 0.9), random(height), random(4), colors[2])
function addInk(x, y, r, color) {
let droppy = new drop(x, y, r, color)
for (let other of drops) {
constructor(pts, color) {
let u = 1 / pow(2, 1 / c)
for (let pt of this.points) {
let b = createVector(x, y)
let pb = p5.Vector.sub(pt, b)
let n = m.copy().rotate(HALF_PI)
pt.add(m.copy().mult(mag))
for (let pt of this.points) {
let root = sqrt(1 + (r * r) / (m * m))
for (let i = 0; i < this.points.length; i++) {
vertex(this.points[i].x, this.points[i].y)
let opposite = this.points[this.points.length - i - 1]
line(this.points[i].x, this.points[i].y, opposite.x, opposite.y)
constructor(x, y, r, color) {
this.pos = createVector(x, y)
this.stroke = random(colors)
for (let i = 0; i < VerticesNO; i++) {
let angle = map(i, 0, VerticesNO, 0, TAU)
let v = createVector(x + cos(angle) * r, y + sin(angle) * r)
if (this.r < this.finalR) {
for (let other of drops) {
for (let pt of this.points) {
let root = sqrt(1 + (r * r) / (m * m))
for (let i = 0; i < this.points.length; i++) {
vertex(this.points[i].x, this.points[i].y)
for (let i = 0; i < this.points.length; i += 5) {
let length = noise(i, this.points.x, frameCount / 300) / 2
let innerPoint = p5.Vector.lerp(this.points[i], this.pos, length)
line(this.points[i].x, this.points[i].y, innerPoint.x, innerPoint.y)