From 12e3c5653f8c7d7363d378fc4204bd21926692c7 Mon Sep 17 00:00:00 2001 From: Franco Speziali Date: Thu, 17 Mar 2022 14:48:29 +0100 Subject: [PATCH] Added utility for generating random color --- src/utilities.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/utilities.ts diff --git a/src/utilities.ts b/src/utilities.ts new file mode 100644 index 0000000..31b99b2 --- /dev/null +++ b/src/utilities.ts @@ -0,0 +1,10 @@ +export function generateRandomColor(): { r: number; g: number; b: number } { + const r = Math.random() * 255; + const g = Math.random() * 255; + const b = Math.random() * 255; + return { + r, + g, + b, + }; +}