R/closestColor.R

Defines functions closestColor

closestColor = function(x, colscale){
    choices = rev(heat.colors(length(colscale)))
    diffs = abs(x-colscale)
    return(choices[which.min(diffs)])
}

Try the ballgown package in your browser

Any scripts or data that you put into this service are public.

ballgown documentation built on Nov. 8, 2020, 5:46 p.m.