closestColor = function(x, colscale){
choices = rev(heat.colors(length(colscale)))
diffs = abs(x-colscale)
return(choices[which.min(diffs)])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.