let bg, fg, lineCol, lineFillCol;
createCanvas(sketch.size, sketch.size);
lineFillCol = color([70, 90, 100, 0.1]);
lineColor = color([160, 90, 100, 0.1]);
scale = sketch.size / 33;
rows = int(height / scale);
cols = int(width / scale);
if (lines.length < lineTotal) {
const pt = new p5.Vector(random(0, width * 0.95),
random(0, height * 0.95));
function generateField() {
for (let i = 0; i < cols; i++) {
for (let j = 0; j < rows; j++) {
if (field[i] === undefined) field[i] = [];
const v = createVector(j + 1, i + 1);
for (let i = 0; i < cols; i++) {
for (let j = 0; j < rows; j++) {
fc = color([map(sin(v.heading()), -1, 1, 220, 280), 80, 90]);
rect(i * scale, j * scale, scale, scale);
for (let l = lines.length - 1; l >= 0; l--) {
const lp = (lines.length - 1 - l) / lines.length;
strokeWeight(map(lp, 0, 1, 1, scale));
const lc = [hue(lineColor), map(lp, 0, 1, 30, 90), map(lp, 0, 1, 80, 100), 0.2];
for (let idx = pts.length - 1; idx >= 0; idx--) {
if (idx === (pts.length - 1) && pts.length < dotsPerLine) {
const i = constrain(int(pt.x / scale), 0, cols - 1);
const j = constrain(int(pt.y / scale), 0, rows - 1);
let newPt = p5.Vector.fromAngle(v.heading());
newPt = p5.Vector.add(pt, newPt);
for (let idx = pts.length - 1; idx >= 0; idx--) {