knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

paleval

CRAN status Lifecycle: experimental Travis build status Codecov test coverage

The goal of paleval is to help you evaluate the effectiveness of color palettes and color maps. It builds from the colorspace package, used to design color maps, and the farver package, used to evaluate the perceptual difference between two colors.

This will have to go into a design-document eventually, but for now, I'll "puke" this here.

For the purpose of this package, following colorRamp and ggplot2 usage, we define some classes:

These follow the palette argument for ggplot2::continuous_scale() and ggplot2::discrete_scale(), as well as graphics::colorRamp() and graphics::colorRampPalette(), respectively.

I'm suspect I'm doing things in a way that the authors of colorspace, ggplot2, farver, and graphics might prefer not to consider while eating. As much as anything, this package is an attempt to reationalize and harmonize all of these concepts to myself.

There are ways to create continuous-palette functions:

There are ways to create discrete-palette functions:

Other functions:

Here's a reference on delta E - can we find something more definitive?

Installation

You can install the development version of paleval from GitHub with:

devtools::install_github("ijlyttle/paleval")

Example

library("paleval")

fcont <- pev_fcont("Dynamic") # continuous palette-function, from colorspace
fdisc <- pev_fdisc(fcont, method = "panel") # discrete palette-function

data_sep <- pev_data_separation(fdisc(7))
print(data_sep)

pev_gg_separation(data_sep)
data_drv <- pev_data_derivative("Purple-Green")
data_drv

pev_gg_derivative(data_drv)
data_dist <- pev_data_distance("Purple-Green")
data_dist

pev_gg_distance(data_dist)
data_hcl <- pev_data_hcl("Viridis", n = 41)
data_hcl

data_hcl_ref <- pev_data_hcl_ref("Viridis", pev_fcont("Viridis")(0.55))

pev_gg_hcl_bloom(data_hcl, data_hcl_ref)
pev_data_hcl("Dynamic", n = 12) %>% pev_gg_hcl_bloom()
pev_gg_hcl_plane(data_hcl, data_hcl_ref)
pev_gg_hcl_spectrum(data_hcl, data_hcl_ref)

Code of Conduct

Please note that the 'paleval' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



ijlyttle/paleval documentation built on Dec. 25, 2019, 9:17 a.m.