canvas_smoke {aRtsy} | R Documentation |
Draw Rainbow Smoke
Description
This function implements the rainbow smoke algorithm.
Usage
canvas_smoke(
colors,
init = 1,
shape = c("bursts", "clouds"),
algorithm = c("minimum", "average"),
resolution = 150
)
Arguments
colors |
a string or character vector specifying the color(s) used for the artwork. |
init |
an integer larger than zero and lower than or equal to |
shape |
a character indicating the shape of the smoke. Possible options are |
algorithm |
a character specifying how to select a new pixel. The default option |
resolution |
resolution of the artwork in pixels per row/column. Increasing the resolution increases the quality of the artwork but also increases the computation time exponentially. |
Value
A ggplot
object containing the artwork.
Author(s)
Koen Derks, koen-derks@hotmail.com
References
See Also
colorPalette
Examples
set.seed(1)
# Simple example
canvas_smoke(colors = "all", resolution = 500)
# Advanced example
reds <- colorRampPalette(c("red", "black"))
blues <- colorRampPalette(c("goldenrod", "navyblue"))
palette <- c(reds(100), blues(100))
canvas_smoke(colors = palette, init = 3, shape = "clouds", resolution = 500)