Created
October 29, 2019 14:02
-
-
Save bradoyler/0e0a40ef5f9a00c1a8fec833e8faaf6f to your computer and use it in GitHub Desktop.
simple color scale function using HSL https://www.w3schools.com/colors/colors_hsl.asp
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 numToColor (num, maxHue = 350, minHue = 0) { | |
const hue = num * (maxHue - minHue) + minHue | |
return `hsl(${hue}, 70%, 45%)` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment