R/ccolor.gradient.R

Defines functions ccolor.gradient

#' Conventional color gradient for faces
#'
#' set up signed color gradient
#' @param x vector of values to be converted to colors
#' @noRd

ccolor.gradient <- function(x, colors=c('blue', 'skyblue', 'turquoise', 'aquamarine', 'springgreen', 'green','greenyellow','yellow','gold','orange','red', 'firebrick'), colsteps=1000) {
	return(colorRampPalette(colors) (colsteps) [ findInterval(x, seq(0,1,length.out=colsteps))])
}

Try the molaR package in your browser

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

molaR documentation built on Feb. 16, 2023, 10:33 p.m.