# Extract colors from a supplied image
my_colors <- palette_extract(image = system.file("extdata", "lyon-fire.png",
package = "lterpalettefinder"))
# Plot that result
palette_ggdemo(palette = my_colors)
# Now randomly subsample
random_colors <- palette_subsample(palette = my_colors, wanted = 5)
# And plot again to show change
palette_ggdemo(palette = random_colors)
Run the code above in your browser using DataLab