From 217819954fa3ee999e837dafd26817f69b5746b9 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 19 Apr 2025 10:30:57 +0200 Subject: rename directory P5 -> p5.js; update report content --- P5/light.js | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 P5/light.js (limited to 'P5') diff --git a/P5/light.js b/P5/light.js deleted file mode 100644 index 20eb1c0..0000000 --- a/P5/light.js +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-FileCopyrightText: 2025 Noor Ahmad -// SPDX-License-Identifier: GPL-3.0-or-later - -let button; -let bgColor; // a variable that keeps track of the background color -let isBlack = true; // Starts with black - -function setup() { - createCanvas(800, 500); - bgColor = color(15, 15, 60); - button = createButton("Color"); - button.mouseClicked(changeBackground); - button.size(50, 50); - button.position(350, 210); -} - -function draw() { - background(bgColor); -} - -function changeBackground() { - if (isBlack) { - bgColor = color(255, 223, 0); // Yellow - } else { - bgColor = color(15, 15, 60); // Black - } - isBlack = !isBlack; // Changing between true and false -} \ No newline at end of file -- cgit v1.2.3