Learn R Programming

aRtsy (version 0.2.4)

canvas_watercolors: Draw Watercolors

Description

This function paints watercolors on a canvas.

Usage

canvas_watercolors(
  colors,
  background = "#fafafa",
  layers = 50,
  depth = 2,
  resolution = 250
)

Value

A ggplot object containing the artwork.

Arguments

colors

a string specifying the color used for the artwork.

background

a character specifying the color used for the background.

layers

the number of layers of each color.

depth

the maximum depth of the recursive algorithm.

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.

Author

Koen Derks, koen-derks@hotmail.com

References

https://tylerxhobbs.com/essays/2017/a-generative-approach-to-simulating-watercolor-paints

See Also

colorPalette

Examples

Run this code
# \donttest{
set.seed(1)

# Simple example
canvas_watercolors(colors = colorPalette("tuscany2"))
# }

Run the code above in your browser using DataLab