From c44678e7ab5c95412502c1b792065237855d3ac1 Mon Sep 17 00:00:00 2001 From: Jonathan Branan Date: Tue, 27 Aug 2024 22:25:20 -0500 Subject: [PATCH] Finished tool --- a.html | 8 ++++---- a.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/a.html b/a.html index 48afaa9..8579018 100644 --- a/a.html +++ b/a.html @@ -24,9 +24,9 @@

Color Flipper

- - - - + + + + \ No newline at end of file diff --git a/a.js b/a.js index e69de29..43573fc 100644 --- a/a.js +++ b/a.js @@ -0,0 +1,14 @@ +const body = document.getElementsByTagName("body")[0] + +function setColor(name) { + body.style.backgroundColor = name; +} + +function randomColor(){ + const red = Math.round(Math.random() * 255) + const green = Math.round(Math.random() * 255) + const blue = Math.round(Math.random() * 255) + const color = `rgb(${red},${green},${blue})` + + body.style.backgroundColor = color; +} \ No newline at end of file