read_kde: Read colors from KDE Palette (colors) files

Description Usage Arguments Note Examples

View source: R/kde.R

Description

Given a path or URL to an .colors file, this function will return a named character vector (if color names are present) of hex RGB colors.

Usage

1
read_kde(path, use_names = TRUE, .verbose = FALSE)

Arguments

path

partial or full file path or URL to a GPL file

use_names

add color names to the vector (defaults to TRUE). See NOTE

.verbose

show extra information about GPL file processing

Note

When using named color palettes in a ggplot2 scale_ context, you must unname, set use_names to FALSE or override their names to map to your own factor levels.

Examples

1
2
3
4
5
6
# built-in palette
fourty <- read_kde(system.file("palettes", "fourty.colors", package="swatches"))
print(fourty)
#show_palette(fourty)

# show_palette(bright)

hrbrmstr/swatches documentation built on Dec. 22, 2017, 10:40 p.m.