Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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