clpalettes {colourlovers}R Documentation

Retrieve color palette or palettes

Description

Retrieve a color palette or set of palletes from the COLOURlovers API.

Usage

clpalettes(set = NULL, ..., fmt = "xml")

clpalette(id, widths = FALSE, fmt = "xml")

Arguments

set

Optionally, a subset of COLOURlovers palettes. Allowed values are “new”, “top”, and “random”.

...

A named list of parameters passed to the API request. Allowed parameters are lover, hueOption, hex, hex_logic, keywords, keywordExact, orderCol, sortBy, numResults, and resultOffset. Specifying orderCol overrules any argument to set. See details.

fmt

A format for the API response, one of “xml” (the default) or “json”. This has essentially no effect on function behavior.

id

The COLOURlovers id (an integer) for a specific palette.

widths

A boolean indicating whether to include the color widths for the palette. Default is FALSE.

Details

Retrieve details about a palette or set of palettes.

Specifying named arguments to ... allows the user to request a specific response, as follows:

Value

A list of class “clpalette”. This should be the same regardless of the value of fmt.

Author(s)

Thomas J. Leeper

References

http://www.colourlovers.com/api/#palettes

Examples

## Not run: 
# Get a random palette
clpalettes('random')

# Download top palettes
clpalettes('top', fmt = 'json')

# Plot a single palette
pid <- '113451'
p <- clpalette(pid, fmt = 'json')
plot(p)

## End(Not run)

[Package colourlovers version 0.3.6 Index]