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)])
}
alyssafrazee/ballgown documentation built on Sept. 3, 2021, 7:15 p.m.