Created
August 21, 2021 18:15
-
-
Save YonatanKra/817e728b611845faffccfce8e35206c2 to your computer and use it in GitHub Desktop.
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 landscapeColors(percentage) { | |
const hue = percentage >= .66 ? 240 : percentage >= .33 ? 120 : 0; | |
const lightness = 50; | |
const saturation = 100; | |
return `hsl(${hue}, ${saturation}%, ${lightness}%)`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment