R/desaturate.R

Defines functions desaturate

desaturate <-
function(x, f = 1) {
    r <- x[, 1L]
    g <- x[, 2L]
    b <- x[, 3L]
    L <- 0.3 * r + 0.6 * g + 0.1 * b
    #L <- 0.6 * r + 0.1 * g + 0.3 * b
    cbind(r + f * (L - r),
          g + f * (L - g),
          b + f * (L - b))
}

Try the MuMIn package in your browser

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

MuMIn documentation built on June 22, 2024, 6:44 p.m.