create_palette: Create a Color Palette of n Colors from an Image

Description Usage Arguments Value Examples

View source: R/paletters.R

Description

Creates a color palette of n distinct colors from a provided image.

Usage

1
create_palette(img, n, prominent.ord = FALSE, hue = NA, ...)

Arguments

img

Path to image file.

n

'n' distinct colors.

prominent.ord

Option to choose prominent colors instead of segmenting the colors from a random starting color.

...

Additional arguments passed to find_segmented.

Value

Vector of distinct hex colors.

Examples

1
2
3
4
5
  # return 20 semi-evenly distributed colors from some image
  create_palette('path/to/image.png', n = 20)

  # return the 10 most prominent colors from some image
  create_palette('path/to/image.jpg', n = 10, prominent.order = T)

jcbain/cuttlefish documentation built on Aug. 5, 2019, 1:49 p.m.