tate_sample: Generate colour palette from image TO UPDATE

View source: R/tate_sample.R

tate_sampleR Documentation

Generate colour palette from image TO UPDATE

Description

This function allows you to generate a colour palette from an image.

Usage

tate_sample(path, n = 4, type = "discrete", direction = 1, plot = TRUE)

Arguments

path

The file path or url of the image you wish to sample colours from.

n

The number of colours to sample from the image. If n is not provided, the length of the palette defaults to 4.

type

Specify either "discrete" or "continuous". If "continuous", three colours are sampled from the image and automatically interpolated between. Defaults to "discrete".

direction

Specify the order of colours. Defaults to 1. If direction is -1, palette is reversed.

plot

(Logical) Plot sampled colour palette. Defaults to TRUE.

Examples

url <- "https://t4.ftcdn.net/jpg/02/90/91/11/240_F_290911157_rJMt9bp5sq64hyY6TklM9XS5GoDg07Vh.jpg"
london_sample(path = url, n = 4, type = "discrete")


LewisAJones/london documentation built on Aug. 31, 2022, 10:55 p.m.