Skip to content

Instantly share code, notes, and snippets.

@gabrielflorit
Last active January 17, 2019 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielflorit/db3b268a4aa293d716d2421c1fc0d4da to your computer and use it in GitHub Desktop.
Save gabrielflorit/db3b268a4aa293d716d2421c1fc0d4da to your computer and use it in GitHub Desktop.
SCRIPT-8
// title: poly mess
const shape = ({ x, y, h, w1, w2, c }) => {
polyStroke(
[
[x, y],
[x + w1, y],
[x + w1 - (w1 - w2)/2, y + h],
[x + w1 - (w1 - w2)/2 - w2, y + h]
], 512, c)
}
draw = () => {
clear()
const ps = {x: 7, y: 20, h: 66, w1: 164, w2: 80, c: 0}
range(ps.h / 2 + 1).forEach(i => {
shape({
...ps,
x: ps.x + 2 * i,
y: ps.y + i,
h: ps.h - 2 * i,
w1: ps.w1 - 4 * i,
w2: ps.w2,
c: i/2 % 7
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment