Create a color generating function from a vector of colors

makeColorscheme(col)

Arguments

col

a vector of colors

Value

a function that generates a vector of colors interpolated among the colors in col

Examples

cs <- makeColorscheme( c('red','white','blue') )
cs(10)
#>  [1] "#FF0000FF" "#FF0000FF" "#FF0000FF" "#FFFFFFFF" "#FFFFFFFF" "#FFFFFFFF"
#>  [7] "#0000FFFF" "#0000FFFF" "#0000FFFF" "#0000FFFF"
cs(10, alpha=.5)
#>  [1] "#FF000080" "#FF000080" "#FF000080" "#FFFFFF80" "#FFFFFF80" "#FFFFFF80"
#>  [7] "#0000FF80" "#0000FF80" "#0000FF80" "#0000FF80"