This function draws many points on the canvas and connects these points into a polygon. After repeating this for all the colors, the edges of all polygons are drawn on top of the artwork.
canvas_polylines(
colors,
background = "#fafafa",
ratio = 0.5,
iterations = 1000,
size = 0.1,
resolution = 500
)
a string or character vector specifying the color(s) used for the artwork.
a character specifying the color used for the lines.
a positive value specifying the width of the polygons. Larger ratios cause more overlap.
a positive integer specifying the number of iterations of the algorithm.
a positive value specifying the size of the borders.
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.
A ggplot
object containing the artwork.
colorPalette
# \donttest{
set.seed(1)
# Simple example
canvas_polylines(colors = colorPalette("retro1"))
# }