knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

The colorange package creates different corportate color palettes for your plots. It includes two functions scale_color_orange() and scale_fill_orange() that you can use with the ggplot2 package.

Colors and palettes respect the corporate identity and style guide of Orangeā„¢. See https://www.ateliers-orange.fr/index.php?page=marque for more details.

library("colorange")

Palette choice

The package contains height palettes.

names(list_orange_palettes)


To display all of them at once, you can use the display_orange_all() function.

display_orange_all()


If you want to see one particular palette, use the display_orange_palette() function.

display_orange_palette("main")


Interpolation is usefull when you need more colors than the number available in the palette.

For instance, we can interpolate the "bleus" palette which originally includes three colors to a length of 10.

display_orange_palette("blue", n = 10)

Usage

There are two main ways of using the colors and palettes of the package:

If you are going the first route, choose a color and specify it as always in the corresponding layer. You can access the hexadecimal code of a color with the orange_colors() function.

library("ggplot2")

ggplot(mtcars, aes(hp, mpg)) +
  geom_point(color = orange_colors("green"), size = 4, alpha = .8) +
  theme_minimal()


Using the scale_color_orange() and scale_fill_orange() functions is as simple.

With scale_color_orange():

ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
  geom_point(size = 4) +
  scale_color_orange(palette = "secondary", discrete = TRUE) +
  theme_minimal()


And with scale_fill_orange():

ggplot(mpg, aes(x = fl, y = displ, fill = fl)) +
  geom_boxplot() +
  scale_fill_orange(palette = "secondary", guide = "none") +
  theme_minimal()


thoera/colorange documentation built on May 26, 2019, 5:32 a.m.