Skip to content

Instantly share code, notes, and snippets.

View 6km's full-sized avatar

Mohammed Taha 6km

View GitHub Profile
@6km
6km / getRandomRgb.js
Created July 21, 2022 18:01
Generate a random RGB color
function getRandom() {
return Math.floor((Math.random() * 255) + 1)
}
function getRandomRgb() {
const r = getRandom();
const g = getRandom();
const b = getRandom();
return `rgb(${r}, ${g}, ${b})`