Gets the color palette of an image as a tibble
get_color_palette.Rd
Extracts the most common colors, configurable through parameters, from an image specified as a URL and returns them as a data frame of hex color codes and RGB values. Includes the share of each color in the image.
Arguments
- img_url
a character string representing the image URL
- limit
the maximum number of colors to be returned
Examples
url <- "https://visit.ubc.ca/wp-content/uploads/2019/04/plantrip_header-2800x1000_2x.jpg"
get_color_palette(url, 3)
#> # A tibble: 3 × 6
#> red green blue hex col_freq col_share
#> <int> <int> <int> <chr> <int> <dbl>
#> 1 107 159 181 #6B9FB5 3072 0.00110
#> 2 100 125 156 #647D9C 1494 0.000534
#> 3 9 18 13 #09120D 561 0.000200