Skip to content

Instantly share code, notes, and snippets.

@csenio
Created April 6, 2020 13:23
Show Gist options
  • Save csenio/d4c852e2ba8b5714958da98d1df1f28d to your computer and use it in GitHub Desktop.
Save csenio/d4c852e2ba8b5714958da98d1df1f28d to your computer and use it in GitHub Desktop.
generates a random, highly distinguishable number for every number. Adjust
function selectColor(number) {
const hue = number * 137.508 // use golden angle approximation
const saturation = '100%'
const lightness = '50%'
return `hsl(${hue},${saturation},${lightness})`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment