Description Usage Arguments Value Examples
Takes a simple palette and expands / oscillates it for use with Mandelbrot sets.
1 | mandelbrot_palette(palette, fold = TRUE, reps = 1L, in_set = "black")
|
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 |
an extended color vector
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.