canvas_diamonds {aRtsy}R Documentation

Draw Diamonds

Description

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.

Usage

canvas_diamonds(
  colors,
  background = "#fafafa",
  col.line = "black",
  radius = 10,
  alpha = 1,
  p = 0.2,
  resolution = 500
)

Arguments

colors

a string or character vector specifying the color(s) used for the artwork.

background

a character specifying the color used for the background.

col.line

a character specifying the color of the diamond borders.

radius

a positive value specifying the radius of the diamonds.

alpha

a value specifying the transparency of the diamonds. If NULL (the default), added layers become increasingly more transparent.

p

a value specifying the probability of drawing an empty diamond.

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

See Also

colorPalette

Examples


set.seed(1)

# Simple example
canvas_diamonds(colors = colorPalette("tuscany1"))



[Package aRtsy version 0.2.4 Index]