R/rgbv.R

Defines functions rgbv

Documented in rgbv

rgbv <-
function(colvec, maxColorValue = 255) {
	# convert a vector or matrix of RGB values to hexadecimal
	# like rgb(), but less picky about inputs
	if(grepl(":", colvec[1]))
		colvec <- strsplit(colvec, ":")[[1]]
	if(is.matrix(colvec)) {
		colvec <- as.vector(colvec)
	}
	rgb(colvec[1], colvec[2], colvec[3], maxColorValue = maxColorValue)
}
phiala/giscolor documentation built on Jan. 28, 2020, 3:35 a.m.