Skip to content

Instantly share code, notes, and snippets.

@inter-coder
Created July 6, 2021 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inter-coder/73dbac12de7fc1bfc257912767b3beaa to your computer and use it in GitHub Desktop.
Save inter-coder/73dbac12de7fc1bfc257912767b3beaa to your computer and use it in GitHub Desktop.
Calculating heat map colours
function heatMapColorforValue(value,alpha,max){
alpha=100*alpha;
value=value/max;
var h = parseInt((1.0 - value) * 240)
return "hsl(" + h + "deg 100% 50% / "+alpha+"%)";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment