Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tyluRp/lisa

:woman_artist: Color palettes from Color Lisa
https://github.com/tyluRp/lisa

color-palette colorlisa data-visualization palettes r rstats

Last synced: 30 days ago
JSON representation

:woman_artist: Color palettes from Color Lisa

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
dpi = 300
)
```
# lisa

[![R build status](https://github.com/tyluRp/lisa/workflows/R-CMD-check/badge.svg)](https://github.com/tyluRp/lisa/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/lisa)](https://cran.r-project.org/package=lisa)
[![CRAN_Download_Badge](https://cranlogs.r-pkg.org/badges/lisa)](https://cran.r-project.org/package=lisa)
[![Codecov test coverage](https://codecov.io/gh/tyluRp/lisa/branch/master/graph/badge.svg)](https://codecov.io/gh/tyluRp/lisa?branch=master)

This is a color palette R package that contains 128 palettes from [**Color Lisa**](http://colorlisa.com/).

```{r waffle, echo=FALSE, fig.height=2, warning=FALSE, message=FALSE}
library(lisa)

parts <- data.frame(
names = names(lisa),
vals = 1
)

waffle::waffle(parts, rows = 5, colors = purrr::flatten_chr(lisa)) +
ggplot2::theme(legend.position = "none")
```

## Installation

Install the released version of `lisa` from CRAN:

```r
install.packages("lisa")
```

Or install the development version from GitHub with:

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

If you aren't an R user, you might be interested in [palettes.yml](inst/extdata/palettes.yml) which contains all palettes in [YAML](https://en.wikipedia.org/wiki/YAML) format.

## Palettes

Here's a sample of the available palettes:

```{r, include=FALSE}
set.seed(4376)
```

```{r example1, results='hide'}
library(lisa)

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

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

```{r example2, fig.height=1, results='hide'}
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, you can access them with the `lisa` list:

```{r}
lisa$VincentvanGogh
```

There is also a table with more information of all available palettes:

```{r}
artwork
```

Example `ggplot2` usage:

```{r ggplot2-example, fig.height=4}
library(ggplot2)

ggplot(mtcars, aes(mpg, disp)) +
geom_point(aes(col = factor(gear)), size = 5, show.legend = FALSE) +
scale_color_manual(values = lisa$`Jean-MichelBasquiat`) +
theme_void()
```

## Acknowledgements

* [**Color Lisa**](http://colorlisa.com/) for the color palettes
* [`wesanderson`](https://github.com/karthik/wesanderson) for source code that powers most things in this repository