Created
April 6, 2020 13:23
-
-
Save csenio/d4c852e2ba8b5714958da98d1df1f28d to your computer and use it in GitHub Desktop.
generates a random, highly distinguishable number for every number. Adjust
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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