EVOLUTION-MANAGER
Edit File: adjustcolor.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Adjust Colors in One or More Directions Conveniently.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for adjustcolor {grDevices}"><tr><td>adjustcolor {grDevices}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Adjust Colors in One or More Directions Conveniently.</h2> <h3>Description</h3> <p>Adjust or modify a vector of colors by “turning knobs” on one or more coordinates in <i>(r,g,b,α)</i> space, typically by up or down scaling them. </p> <h3>Usage</h3> <pre> adjustcolor(col, alpha.f = 1, red.f = 1, green.f = 1, blue.f = 1, offset = c(0, 0, 0, 0), transform = diag(c(red.f, green.f, blue.f, alpha.f)))</pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>col</code></td> <td> <p>vector of colors, in any format that col2rgb() accepts</p> </td></tr> <tr valign="top"><td><code>alpha.f</code></td> <td> <p>factor modifying the opacity alpha; typically in [0,1]</p> </td></tr> <tr valign="top"><td><code>red.f, green.f, blue.f</code></td> <td> <p>factors modifying the “red-”, “green-” or “blue-”ness of the colors, respectively.</p> </td></tr> <tr valign="top"><td><code>offset</code></td> <td> </td></tr> <tr valign="top"><td><code>transform</code></td> <td> </td></tr> </table> <h3>Value</h3> <p>a color vector of the same length as <code>col</code>, effectively the result of <code><a href="rgb.html">rgb</a>()</code>. </p> <h3>See Also</h3> <p><code><a href="rgb.html">rgb</a></code>, <code><a href="col2rgb.html">col2rgb</a></code>. For more sophisticated color constructions: <code><a href="convertColor.html">convertColor</a></code> </p> <h3>Examples</h3> <pre> ## Illustrative examples : opal <- palette("default") stopifnot(identical(adjustcolor(1:8, 0.75), adjustcolor(palette(), 0.75))) cbind(palette(), adjustcolor(1:8, 0.75)) ## alpha = 1/2 * previous alpha --> opaque colors x <- palette(adjustcolor(palette(), 0.5)) sines <- outer(1:20, 1:4, function(x, y) sin(x / 20 * pi * y)) matplot(sines, type = "b", pch = 21:23, col = 2:5, bg = 2:5, main = "Using an 'opaque ('translucent') color palette") x. <- adjustcolor(x, offset = c(0.5, 0.5, 0.5, 0), # <- "more white" transform = diag(c(.7, .7, .7, 0.6))) cbind(x, x.) op <- par(bg = adjustcolor("goldenrod", offset = -rep(.4, 4)), xpd = NA) plot(0:9, 0:9, type = "n", axes = FALSE, xlab = "", ylab = "", main = "adjustcolor() -> translucent") text(1:8, labels = paste0(x,"++"), col = x., cex = 8) par(op) ## and (M <- cbind( rbind( matrix(1/3, 3, 3), 0), c(0, 0, 0, 1))) adjustcolor(x, transform = M) ## revert to previous palette: active palette(opal) </pre> <hr /><div style="text-align: center;">[Package <em>grDevices</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>