Description Usage Arguments Details Value References See Also Examples

View source: R/divergingx_hcl.R

Diverging HCL color palettes generated through combination of two fully flexible (and possibly unbalanced) multi-hue sequential palettes.

1 2 3 4 5 |

`n` |
the number of colors ( |

`palette` |
character with the name (see details). |

`...` |
arguments passed to |

`fixup` |
logical. Should the color be corrected to a valid RGB value? |

`alpha` |
numeric vector of values in the range |

`rev` |
logical. Should the palette be reversed? |

`h1` |
numeric. Starting hue coordinate. |

`h2` |
numeric. Center hue coordinate. |

`h3` |
numeric. Ending hue coordinate. |

`c1` |
numeric. Chroma coordinate corresponding to |

`c2` |
numeric. Chroma coordinate corresponding to |

`c3` |
numeric. Chroma coordinate corresponding to |

`l1` |
numeric. Luminance coordinate corresponding to |

`l2` |
numeric. Luminance coordinate corresponding to |

`l3` |
numeric. Luminance coordinate corresponding to |

`p1` |
numeric. Power parameter for chroma coordinates in first sequential palette. |

`p2` |
numeric. Power parameter for luminance coordinates in first sequential palette (if |

`p3` |
numeric. Power parameter for chroma coordinates in second sequential palette (if |

`p4` |
numeric. Power parameter for luminance coordinates in second sequential palette (if |

`cmax1` |
numeric. Maximum chroma coordinate in first sequential palette (not used if |

`cmax2` |
numeric. Maximum chroma coordinate in second sequential palette (if |

`plot` |
logical. Should the selected HCL color palettes be visualized? |

The `divergingx_hcl`

function simply calls `sequential_hcl`

twice with a prespecified set of hue, chroma, and luminance parameters. This is
similar to `diverging_hcl`

but allows for more flexibility:
`diverging_hcl`

employs two *single-hue* sequential palettes,
always uses zero chroma for the neutral/central color, and restricts the
chroma/luminance path to be the same in both “arms” of the palette.
In contrast, `divergingx_hcl`

relaxes this to two full *multi-hue*
palettes that can thus go through a non-gray neutral color (typically light
yellow). Consequently, the chroma/luminance paths can be rather unbalanced
between the two arms.

With this additional flexibility various diverging palettes suggested by http://ColorBrewer.org/ and CARTO (https://carto.com/carto-colors/), can be emulated along with the Zissou 1 palette from wesanderson and Cividis from viridis.

Available CARTO palettes: ArmyRose, Earth, Fall, Geyser, TealRose, Temps, and
Tropic (with Tropic also available in `diverging_hcl`

).

Available ColorBrewer.org palettes: PuOr, RdBu, RdGy, PiYG, PRGn, BrBG, RdYlBu, RdYlGn, Spectral.

A character vector with (s)RGB codings of the colors in the palette.

Zeileis A, Fisher JC, Hornik K, Ihaka R, McWhite CD, Murrell P, Stauffer R, Wilke CO (2019). “ccolorspace: A Toolbox for Manipulating and Assessing Colors and Palettes.” arXiv:1903.06490, arXiv.org E-Print Archive. http://arxiv.org/abs/1903.06490

1 2 3 4 5 6 | ```
## show emulated CARTO/ColorBrewer.org palettes
divergingx_palettes(plot = TRUE)
## compared to diverging_hcl() the diverging CARTO palettes are typically warmer
## but also less balanced with respect to chroma/luminance, see e.g.,
specplot(divergingx_hcl(7, "ArmyRose"))
``` |

```
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.