Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created August 21, 2021 18:15
Show Gist options
  • Save YonatanKra/817e728b611845faffccfce8e35206c2 to your computer and use it in GitHub Desktop.
Save YonatanKra/817e728b611845faffccfce8e35206c2 to your computer and use it in GitHub Desktop.
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