Add background color radial gradients
add_background_gradient(input, colors = c("white", "black"), stops = seq(0, 1, length.out = length(colors)), center_x = 0.5, center_y = 0.5, focus_x = 0.5, focus_y = 0.5, radius = sqrt(2), rounding = 0, openfile = TRUE, output = input)
File name of .svg file to input
Vector of gradient colors
Vector of stops for gradient colors. Ranges from 0 to 1.
x-coordinate for center of gradient. Number between 0 and 1.
y-coordinate for center of gradient. Number between 0 and 1.
x-coordinate for focus of gradient. Number between 0 and 1.
y-coordinate for focus of gradient. Number between 0 and 1.
Radius of radial gradient. The default is the square root of 2 so that the gradient extends to the corners of the square. If you want it to extend to the edges, set it to 1.
Rounding of background rectangle's corners. The default is 0 (no rounding). A rounding value of 1 creates a circle. If rounding is a vector of 2 values, the x and y rounding parameters are set separately.
Open file in default program for .svg format. Defaults to FALSE.
File name of .svg file to output. Default is to overwrite the input file.
library(spiro) spiro( fixed_radius = 3, cycling_radius = 1, file = "add_background_gradient.svg" ) %>% add_background_gradient(color = c("black","white"))