Skip to content

Instantly share code, notes, and snippets.

@tannerdolby
Last active January 7, 2022 21:04
Show Gist options
  • Save tannerdolby/d94040ad19c2917fba1a10dd74ec9a5a to your computer and use it in GitHub Desktop.
Save tannerdolby/d94040ad19c2917fba1a10dd74ec9a5a to your computer and use it in GitHub Desktop.
Generate 3 random numbers between the inclusive range [0-255] representing an RGB value.
var [r, g, b] = new Array(3).fill(0).map((_, i) => Math.floor(Math.random() * 256);
console.log(r, g, b);
// 11 210 159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment