-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
107 lines (77 loc) · 2.76 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
dpi = 300
)
```
# lisa <img src="man/figures/logo.png" align="right" height=150/>
<!-- badges: start -->
[![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)
<!-- badges: end -->
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