make_palette {colorfindr} | R Documentation |
Create a color palette from an image.
Description
make_palette
creates a color palette from colors extracted from Windows BMP, JPEG, PNG, TIFF, and SVG format images with
the get_colors
function.
Usage
make_palette(data, n = 10, clust_method = "kmeans",
extract_method = "hex_freq", show = TRUE)
Arguments
data |
a |
n |
the number of discrete colors to be extracted from the data. |
clust_method |
specifies the method used to cluster the pixels. By default, the colors are clustered by the
|
extract_method |
specifies the process for extracting the colors from the clusters obtained. By default |
show |
by default |
Value
A character vector with hex color codes, sorted by the weight of the associated clusters.
Examples
# Create palette from image
img <- system.file("extdata", "pic6.png", package = "colorfindr")
colors <- get_colors(img)
make_palette(colors)