This function draws diamonds on a canvas and (optionally) places two lines behind them. The diamonds can be transparent or have a random color sampled from the input.
canvas_diamonds(
colors,
background = "#fafafa",
col.line = "black",
radius = 10,
alpha = 1,
p = 0.2,
resolution = 500
)
a string or character vector specifying the color(s) used for the artwork.
a character specifying the color used for the background.
a character specifying the color of the diamond borders.
a positive value specifying the radius of the diamonds.
a value specifying the transparency of the diamonds. If NULL
(the default), added layers become increasingly more transparent.
a value specifying the probability of drawing an empty diamond.
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_diamonds(colors = colorPalette("tuscany1"))
# }