mandelbrot_palette {mandelbrot} | R Documentation |
Generate palette suitable for coloring a set
Description
Takes a simple palette and expands / oscillates it for use with Mandelbrot sets.
Usage
mandelbrot_palette(palette, fold = TRUE, reps = 1L, in_set = "black")
Arguments
palette |
vector of color hex strings (e.g. '#FFFFFF') |
fold |
wrap or fold the palette back on itself |
reps |
number of times to replicate the color vector |
in_set |
color for areas in the Mandelbrot set |
Value
an extended color vector
Examples
view <- mandelbrot(xlim = c(-0.8438146, -0.8226294),
ylim = c(0.1963144, 0.2174996), iter = 500)
# can be used to simply interpolate a color gradient
spectral <- RColorBrewer::brewer.pal(11, "Spectral")
cols <- mandelbrot_palette(spectral, fold = FALSE)
plot(view, col = cols, transform = "inv")
# simple palettes might need folds / reps to look good
blues <- RColorBrewer::brewer.pal(9, "Blues")
cols <- mandelbrot_palette(blues, in_set = "white",
fold = TRUE, reps = 2)
plot(view, col = cols, transform = "log")
[Package mandelbrot version 0.2.0 Index]