This function draws line segments on a canvas. The length and direction of the line segments is determined randomly.
canvas_segments(
colors,
background = "#fafafa",
n = 250,
p = 0.5,
H = 0.1,
size = 0.2
)
a string or character vector specifying the color(s) used for the artwork.
a character specifying the color used for the background.
a positive integer specifying the number of line segments to draw.
a value specifying the probability of drawing a vertical line segment.
a positive value specifying the scaling factor for the line segments.
a positive value specifying the size of the line segments.
A ggplot
object containing the artwork.
colorPalette
# \donttest{
set.seed(1)
# Simple example
canvas_segments(colors = colorPalette("dark1"))
# }