lisa

Travis build status AppVeyor build status CRAN status CRAN_Download_Badge Codecov test coverage

This is a color palette R package that contains 128 palettes from Color Lisa.

Installation

Install the released version of lisa from CRAN:

install.packages("lisa")

Or install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("tylurp/lisa")

If you aren’t an R user, you might be interested in palettes.yml which contains all palettes in YAML format.

Palettes

Here’s a sample of the available palettes:

library(lisa)

par(mfrow = c(6, 3))
lapply(sample(lisa, 18), plot)

You can also call and/or modify palettes using lisa_palette:

x <- lisa_palette("JackBush_1", 1000, "continuous")
y <- lisa_palette("PabloPicasso", 2, "discrete")
z <- lisa_palette("KatsushikaHokusai", 1000, "continuous")
lapply(list(x, y, z), plot)

All palettes have 3 attributes associated with them:

# shows the class, artist name, and name of work
attributes(lisa$VincentvanGogh)
#> $class
#> [1] "lisa_palette" "character"   
#> 
#> $name
#> [1] "VincentvanGogh"
#> 
#> $work
#> [1] "The Starry Night"

# attributes do not print by default
lisa$VincentvanGogh
#> [1] "#1a3431" "#2b41a7" "#6283c8" "#ccc776" "#c7ad24"

# there is also a data.frame with palette descriptions
head(artwork, 5)
#>              artist          palette                              work
#> 1      Josef Albers      JosefAlbers     Adobe (Variant): Luminous Day
#> 2      Josef Albers    JosefAlbers_1 Homage to the Square (La Tehuana)
#> 3 Gretchen Albrecht GretchenAlbrecht                      Golden Cloud
#> 4       Billy Apple       BillyApple                           Rainbow
#> 5       Per Arnoldi       PerArnoldi                              Spar

Example ggplot2 usage:

library(ggplot2)

ggplot(mtcars, aes(mpg, disp)) + 
  geom_point(aes(col = factor(gear)), size = 3) + 
  scale_color_manual(values = lisa$`Jean-MichelBasquiat`) + 
  theme_bw()

Acknowledgements