Skip to contents

The package provides color and fill scales to match the OMNI color palette. Here is the “Main” color palette.

There is a omni_colors() function that allows you to extract individual colors. You can choose from: Gray, Dark Blue, Medium Blue, Light Blue, Teal, Orange, and Tan.

You can add the line scale_fill_omni_discrete() to change the fill on a plot.

iris |>
  group_by(Species) |>
  summarise(sepal_length_mean = mean(Sepal.Length)) |>
  ggplot(ggplot2::aes(x = Species, y = sepal_length_mean, fill = Species)) +
  geom_bar(stat = "identity") +
  coord_flip() +
  scale_fill_omni_discrete() +
  theme_omni(show_legend = FALSE)

You can change the palette by using the palette argument.

iris |>
  group_by(Species) |>
  summarise(sepal_length_mean = mean(Sepal.Length)) |>
  ggplot(ggplot2::aes(x = Species, y = sepal_length_mean, fill = Species)) +
  geom_bar(stat = "identity") +
  coord_flip() +
  scale_fill_omni_discrete(palette = "Blues") +
  theme_omni(show_legend = FALSE)

You can reverse the order by using the reverse argument.

iris |>
  group_by(Species) |>
  summarise(sepal_length_mean = mean(Sepal.Length)) |>
  ggplot(ggplot2::aes(x = Species, y = sepal_length_mean, fill = Species)) +
  geom_bar(stat = "identity") +
  coord_flip() +
  scale_fill_omni_discrete(palette = "Blues",
                           reverse = TRUE) +
  theme_omni(show_legend = FALSE)

There is also a scale_fill_omni_continuous() function as well as scale_color_omni_discrete() and scale_color_omni_continuous() functions for colors.

You can specify a list of colors if needed :

iris |>
  group_by(Species) |>
  summarise(sepal_length_mean = mean(Sepal.Length)) |>
  ggplot(ggplot2::aes(x = Species, y = sepal_length_mean, fill = Species)) +
  geom_bar(stat = "identity") +
  coord_flip() +
  scale_fill_omni_discrete(palette = c("Dark Blue", "Orange", "Tan")) +
  theme_omni(show_legend = FALSE)