Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ctx.setup = ctx.resize = function () {
rand = new Alea(settings.seed)
simplex = new SimplexNoise(rand)
randNormal = randomNormal.source(rand)
clear(ctx, `rgba(${settings.backgroundColor.join(',')}, 0)`)
clear(watercolorCtx, `rgb(${settings.backgroundColor.join(',')})`)
setupBackground(watercolorCtx)
// add boxes and stuff
createBoxes(settings.boxCount).forEach((box) => {
ctx.save()
ctx.translate(box.center[0], box.center[1])
ctx.rotate(box.rotation)
drawRect(ctx, [0, 0], box.width, box.height, 'rgba(250, 250, 250, 0.6)')
ctx.restore()
})
// addVignette(ctx)
addVignette(watercolorCtx)
}
ctx.setup = ctx.resize = function () {
center = [ctx.width / 2, ctx.height / 2]
ctx.clearRect(0, 0, ctx.width, ctx.height)
rand = new Alea(settings.seed)
randX = randomNormal.source(rand)(center[0], settings.sigma)
randY = randomNormal.source(rand)(center[1], settings.sigma)
simplex = new SimplexNoise(rand)
lines = []
clearTimeout(token)
token = setTimeout(createLine, 0)
}