Displaying 1 result from an estimated 1 matches for "roundcolor".
2013 Jul 24
1
Alpha channel in colorRamp() and colorRampPalette()
...un)
if ((nc <- nrow(colors)) == 1L) {
colors <- colors[c(1L, 1L), ]
nc <- 2L
}
x <- seq.int(0, 1, length.out = nc)^bias
palette <- c(interpolate(x, colors[, 1]), interpolate(x, colors[, 2]), interpolate(x, colors[, 3]), interpolate(x, colors[, 4]))
roundcolor <- function(rgb) pmax(pmin(rgb, 1), 0)
if (space == "Lab") {
function(x) {
roundcolor(convertColor(cbind(palette[[1L]](x), palette[[2L]](x),
palette[[3L]](x), palette[[4L]](x)), from = "Lab", to = "sRGB")) *...