---
title: "Fabio Crameri's Color Schemes"
author: "N. Frerebeau"
date: "`r Sys.Date()`"
output:
  rmarkdown::html_vignette:
    fig_caption: yes
    toc: true
bibliography: bibliography.bib
vignette: >
  %\VignetteIndexEntry{Fabio Crameri's Color Schemes}
  %\VignetteEncoding{UTF-8}
  %\VignetteEngine{knitr::rmarkdown}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.align = "center"
)
```

```{r packages}
library(khroma)
```

## Introduction
@crameri2018 offers carefully chosen schemes, ready for mapping data, with colors that are:

* Perceptually uniform,
* Perceptually ordered,
* Color vision deficiency friendly,
* Readable as black and white print,
* Citable & reproducible.

All the scales presented in @crameri2021 are implemented here, for use with base R **graphics** or [**ggplot2**](https://ggplot2.tidyverse.org/).

## Diverging data

### *broc*
```{r crameri_div_broc, fig.height=2, fig.width=7}
broc <- color("broc")
plot(broc(256))
```

### *cork*
```{r crameri_div_cork, fig.height=2, fig.width=7}
cork <- color("cork")
plot(cork(256))
```

### *vik*
```{r crameri_div_vik, fig.height=2, fig.width=7}
vik <- color("vik")
plot(vik(256))
```

### *lisbon*
```{r crameri_div_lisbon, fig.height=2, fig.width=7}
lisbon <- color("lisbon")
plot(lisbon(256))
```

### *tofino*
```{r crameri_div_tofino, fig.height=2, fig.width=7}
tofino <- color("tofino")
plot(tofino(256))
```

### *berlin*
```{r crameri_div_berlin, fig.height=2, fig.width=7}
berlin <- color("berlin")
plot(berlin(256))
```

### *roma*
```{r crameri_div_roma, fig.height=2, fig.width=7}
roma <- color("roma")
plot(roma(256))
```

### *bam*
```{r crameri_div_bam, fig.height=2, fig.width=7}
bam <- color("bam")
plot(bam(256))
```

### *vanimo*
```{r crameri_div_vanimo, fig.height=2, fig.width=7}
vanimo <- color("vanimo")
plot(vanimo(256))
```

## Sequential data

### *batlow*
```{r crameri_seq_batlow, fig.height=2, fig.width=7}
batlow <- color("batlow")
plot(batlow(256))
```

### *batlowW*
```{r crameri_seq_batlowW, fig.height=2, fig.width=7}
batlowW <- color("batlowW")
plot(batlowW(256))
```

### *batlowK*
```{r crameri_seq_batlowK, fig.height=2, fig.width=7}
batlowK <- color("batlowK")
plot(batlowK(256))
```

### *devon*
```{r crameri_seq_devon, fig.height=2, fig.width=7}
devon <- color("devon")
plot(devon(256))
```

### *lajolla*
```{r crameri_seq_lajolla, fig.height=2, fig.width=7}
lajolla <- color("lajolla")
plot(lajolla(256))
```

### *bamako*
```{r crameri_seq_bamako, fig.height=2, fig.width=7}
bamako <- color("bamako")
plot(bamako(256))
```

### *davos*
```{r crameri_seq_davos, fig.height=2, fig.width=7}
davos <- color("davos")
plot(davos(256))
```

### *bilbao*
```{r crameri_seq_bilbao, fig.height=2, fig.width=7}
bilbao <- color("bilbao")
plot(bilbao(256))
```

### *nuuk*
```{r crameri_seq_nuuk, fig.height=2, fig.width=7}
nuuk <- color("nuuk")
plot(nuuk(256))
```

### *oslo*
```{r crameri_seq_oslo, fig.height=2, fig.width=7}
oslo <- color("oslo")
plot(oslo(256))
```

### *grayC*
```{r crameri_seq_grayC, fig.height=2, fig.width=7}
grayC <- color("grayC")
plot(grayC(256))
```

### *hawaii*
```{r crameri_seq_hawaii, fig.height=2, fig.width=7}
hawaii <- color("hawaii")
plot(hawaii(256))
```

### *lapaz*
```{r crameri_seq_lapaz, fig.height=2, fig.width=7}
lapaz <- color("lapaz")
plot(lapaz(256))
```

### *tokyo*
```{r crameri_seq_tokyo, fig.height=2, fig.width=7}
tokyo <- color("tokyo")
plot(tokyo(256))
```

### *buda*
```{r crameri_seq_buda, fig.height=2, fig.width=7}
buda <- color("buda")
plot(buda(256))
```

### *acton*
```{r crameri_seq_acton, fig.height=2, fig.width=7}
acton <- color("acton")
plot(acton(256))
```

### *turku*
```{r crameri_seq_turku, fig.height=2, fig.width=7}
turku <- color("turku")
plot(turku(256))
```

### *imola*
```{r crameri_seq_imola, fig.height=2, fig.width=7}
imola <- color("imola")
plot(imola(256))
```

## Multi-sequential data

### *oleron*
```{r crameri_seq_oleron, fig.height=2, fig.width=7}
oleron <- color("oleron")
plot(oleron(256))
```

### *bukavu*
```{r crameri_seq_bukavu, fig.height=2, fig.width=7}
bukavu <- color("bukavu")
plot(bukavu(256))
```

### *fes*
```{r crameri_seq_fes, fig.height=2, fig.width=7}
fes <- color("fes")
plot(fes(256))
```

## References
