read_palette {swatches}R Documentation

Read colors from palette files

Description

Given a path or URL to an palette file, this function will attempt to determine which palette file format to read by the file type and return a named character vector (if color names are present) of hex RGB colors.

Usage

read_palette(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.


[Package swatches version 0.5.0 Index]