Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
simple color scale function using HSL https://www.w3schools.com/colors/colors_hsl.asp
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